本文整理汇总了PHP中Notification::getTypeName方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::getTypeName方法的具体用法?PHP Notification::getTypeName怎么用?PHP Notification::getTypeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notification
的用法示例。
在下文中一共展示了Notification::getTypeName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Notification
*/
include '../inc/includes.php';
Session::checkRight("notification", 'r');
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
$notification = new Notification();
if (isset($_POST["add"])) {
$notification->check(-1, 'w', $_POST);
$newID = $notification->add($_POST);
Event::log($newID, "notifications", 4, "notification", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
Html::redirect($_SERVER['PHP_SELF'] . "?id={$newID}");
} else {
if (isset($_POST["delete"])) {
$notification->check($_POST["id"], 'd');
$notification->delete($_POST);
Event::log($_POST["id"], "notifications", 4, "notification", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
$notification->redirectToList();
} else {
if (isset($_POST["update"])) {
$notification->check($_POST["id"], 'w');
$notification->update($_POST);
Event::log($_POST["id"], "notifications", 4, "notification", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
Html::back();
} else {
Html::header(Notification::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailing", "notification");
$notification->showForm($_GET["id"]);
Html::footer();
}
}
}
示例2: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
if (!$withtemplate && Notification::canView()) {
$nb = 0;
switch ($item->getType()) {
case 'Group':
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = self::countForGroup($item);
}
return self::createTabEntry(Notification::getTypeName(Session::getPluralNumber()), $nb);
case 'Notification':
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = countElementsInTable($this->getTable(), "notifications_id = '" . $item->getID() . "'");
}
return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), $nb);
}
}
return '';
}
示例3: NotificationMailSetting
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("config", UPDATE);
$notificationmail = new NotificationMailSetting();
if (!empty($_POST["test_smtp_send"])) {
NotificationMail::testNotification();
Html::back();
} else {
if (!empty($_POST["update"])) {
$config = new Config();
$config->update($_POST);
Html::back();
}
}
Html::header(Notification::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "config", "notification", "config");
$notificationmail->display(array('id' => 1));
Html::footer();
示例4: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
if (!$withtemplate && Session::haveRight('notification', 'r')) {
switch ($item->getType()) {
case 'Group':
if ($_SESSION['glpishow_count_on_tabs']) {
return self::createTabEntry(Notification::getTypeName(2), self::countForGroup($item));
}
return Notification::getTypeName(2);
case 'Notification':
if ($_SESSION['glpishow_count_on_tabs']) {
return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), "notifications_id\n = '" . $item->getID() . "'"));
}
return self::getTypeName(2);
}
}
return '';
}