本文整理汇总了PHP中Plugin::getInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugin::getInfo方法的具体用法?PHP Plugin::getInfo怎么用?PHP Plugin::getInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::getInfo方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAdditionalCriteriaDisplayPattern
/**
* @since version 0.84
*
* @see Rule::getAdditionalCriteriaDisplayPattern()
**/
function getAdditionalCriteriaDisplayPattern($ID, $condition, $pattern)
{
$crit = $this->getCriteria($ID);
if ($crit['field'] == '_source') {
$name = Plugin::getInfo($pattern, 'name');
if (empty($name)) {
return false;
}
return $name;
}
}
示例2: helpHeader
//.........这里部分代码省略.........
echo "<ul id='menu'>";
// Build the navigation-elements
// Home
echo "<li id='menu1'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' title=\"" . __s('Home') . "\" class='itemP'>" . __('Home') . "</a>";
echo "</li>";
// Create ticket
if (Session::haveRight("ticket", CREATE)) {
echo "<li id='menu2'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?create_ticket=1' " . "title=\"" . __s('Create a ticket') . "\" class='itemP'>" . __('Create a ticket') . "</a>";
echo "</li>";
}
// Suivi ticket
if (Session::haveRight("ticket", Ticket::READMY) || Session::haveRight("followup", TicketFollowup::SEEPUBLIC)) {
echo "<li id='menu3'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/ticket.php' title=\"" . __s('Ticket followup') . "\" class='itemP'>" . _n('Ticket', 'Tickets', Session::getPluralNumber()) . "</a>";
echo "</li>";
}
// Reservation
if (Session::haveRight("reservation", ReservationItem::RESERVEANITEM)) {
echo "<li id='menu4'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.php' title=\"" . _sn('Reservation', 'Reservations', Session::getPluralNumber()) . "\" class='itemP'>" . _n('Reservation', 'Reservations', Session::getPluralNumber()) . "</a>";
echo "</li>";
}
// FAQ
if (Session::haveRight('knowbase', KnowbaseItem::READFAQ)) {
echo "<li id='menu5' >";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.faq.php' title=\"" . __s('FAQ') . "\" class='itemP'>" . __('FAQ') . "</a>";
echo "</li>";
}
// PLUGINS
$plugins = array();
if (isset($PLUGIN_HOOKS["helpdesk_menu_entry"]) && count($PLUGIN_HOOKS["helpdesk_menu_entry"])) {
foreach ($PLUGIN_HOOKS["helpdesk_menu_entry"] as $plugin => $active) {
if ($active) {
$plugins[$plugin] = Plugin::getInfo($plugin);
}
}
}
if (isset($plugins) && count($plugins) > 0) {
$list = array();
foreach ($plugins as $key => $val) {
$list[$key] = $val["name"];
}
asort($list);
echo "<li id='menu5' onmouseover=\"javascript:menuAff('menu5','menu');\">";
echo "<a href='#' title=\"" . _sn('Plugin', 'Plugins', Session::getPluralNumber()) . "\" class='itemP'>" . __('Plugins') . "</a>";
// default none
echo "<ul class='ssmenu'>";
// list menu item
foreach ($list as $key => $val) {
$link = "";
if (is_string($PLUGIN_HOOKS["helpdesk_menu_entry"][$key])) {
$link = $PLUGIN_HOOKS["helpdesk_menu_entry"][$key];
}
echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/plugins/" . $key . $link . "'>" . $plugins[$key]["name"] . "</a></li>\n";
}
echo "</ul></li>";
}
echo "</ul>";
echo "</div>";
// End navigation bar
// End headline
// Le fil d ariane
echo "<div id='c_ssmenu2'>";
echo "<ul>";
echo "<li class='breadcrumb_item'>" . "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' title=\"" . __s('Home') . "\">" . __('Home') . "</a></li>";
if (TicketValidation::getValidateRights()) {
$opt = array();
$opt['reset'] = 'reset';
$opt['criteria'][0]['field'] = 55;
// validation status
$opt['criteria'][0]['searchtype'] = 'equals';
$opt['criteria'][0]['value'] = TicketValidation::WAITING;
$opt['criteria'][0]['link'] = 'AND';
$opt['criteria'][1]['field'] = 59;
// validation aprobator
$opt['criteria'][1]['searchtype'] = 'equals';
$opt['criteria'][1]['value'] = Session::getLoginUserID();
$opt['criteria'][1]['link'] = 'AND';
$url_validate = $CFG_GLPI["root_doc"] . "/front/ticket.php?" . Toolbox::append_params($opt, '&');
$pic_validate = "<a href='{$url_validate}'>" . "<img title=\"" . __s('Ticket waiting for your approval') . "\" alt=\"" . __s('Ticket waiting for your approval') . "\" src='" . $CFG_GLPI["root_doc"] . "/pics/menu_showall.png' class='pointer'></a>";
echo "<li class='icons_block'>{$pic_validate}</li>\n";
}
if (Session::haveRight('ticket', CREATE) && strpos($_SERVER['PHP_SELF'], "ticket")) {
echo "<li class='icons_block'><a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?create_ticket=1'>";
echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/menu_add.png' title=\"" . __s('Add') . "\" alt=\"" . __s('Add') . "\" class='pointer'></a></li>";
}
// check user id : header used for display messages when session logout
if (Session::getLoginUserID()) {
self::showProfileSelecter($CFG_GLPI["root_doc"] . "/front/helpdesk.public.php");
}
echo "</ul></div>";
echo "</div>";
// fin header
echo "<div id='page' >";
// call static function callcron() every 5min
CronTask::callCron();
self::displayMessageAfterRedirect();
}
示例3: title
/**
* @since version 0.84
**/
static function title()
{
global $PLUGIN_HOOKS, $CFG_GLPI;
$opt_list["Ticket"] = __('Tickets');
$stat_list["Ticket"]["Ticket_Global"]["name"] = __('Global');
$stat_list["Ticket"]["Ticket_Global"]["file"] = "stat.global.php?itemtype=Ticket";
$stat_list["Ticket"]["Ticket_Ticket"]["name"] = __('By ticket');
$stat_list["Ticket"]["Ticket_Ticket"]["file"] = "stat.tracking.php?itemtype=Ticket";
$stat_list["Ticket"]["Ticket_Location"]["name"] = __('By hardware characteristics');
$stat_list["Ticket"]["Ticket_Location"]["file"] = "stat.location.php?itemtype=Ticket";
$stat_list["Ticket"]["Ticket_Item"]["name"] = __('By hardware');
$stat_list["Ticket"]["Ticket_Item"]["file"] = "stat.item.php";
if (Problem::canView()) {
$opt_list["Problem"] = _n('Problem', 'Problems', Session::getPluralNumber());
$stat_list["Problem"]["Problem_Global"]["name"] = __('Global');
$stat_list["Problem"]["Problem_Global"]["file"] = "stat.global.php?itemtype=Problem";
$stat_list["Problem"]["Problem_Problem"]["name"] = __('By problem');
$stat_list["Problem"]["Problem_Problem"]["file"] = "stat.tracking.php?itemtype=Problem";
}
if (Change::canView()) {
$opt_list["Change"] = _n('Change', 'Changes', Session::getPluralNumber());
$stat_list["Change"]["Change_Global"]["name"] = __('Global');
$stat_list["Change"]["Change_Global"]["file"] = "stat.global.php?itemtype=Change";
$stat_list["Change"]["Change_Change"]["name"] = __('By change');
$stat_list["Change"]["Change_Change"]["file"] = "stat.tracking.php?itemtype=Change";
}
//Affichage du tableau de presentation des stats
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='2'>" . __('Select statistics to be displayed') . "</th></tr>";
echo "<tr class='tab_bg_1'><td class='center'>";
$values = array($CFG_GLPI["root_doc"] . '/front/stat.php' => Dropdown::EMPTY_VALUE);
$i = 0;
$selected = -1;
$count = count($stat_list);
foreach ($opt_list as $opt => $group) {
while ($data = each($stat_list[$opt])) {
$name = $data[1]["name"];
$file = $data[1]["file"];
$comment = "";
if (isset($data[1]["comment"])) {
$comment = $data[1]["comment"];
}
$key = $CFG_GLPI["root_doc"] . "/front/" . $file;
$values[$group][$key] = $name;
if (stripos($_SERVER['REQUEST_URI'], $key) !== false) {
$selected = $key;
}
}
}
// Manage plugins
$names = array();
$optgroup = array();
if (isset($PLUGIN_HOOKS["stats"]) && is_array($PLUGIN_HOOKS["stats"])) {
foreach ($PLUGIN_HOOKS["stats"] as $plug => $pages) {
if (is_array($pages) && count($pages)) {
foreach ($pages as $page => $name) {
$names[$plug . '/' . $page] = array("name" => $name, "plug" => $plug);
$optgroup[$plug] = Plugin::getInfo($plug, 'name');
}
}
}
asort($names);
}
foreach ($optgroup as $opt => $title) {
$group = $title;
foreach ($names as $key => $val) {
if ($opt == $val["plug"]) {
$file = $CFG_GLPI["root_doc"] . "/plugins/" . $key;
$values[$group][$file] = $val["name"];
if (stripos($_SERVER['REQUEST_URI'], $file) !== false) {
$selected = $file;
}
}
}
}
Dropdown::showFromArray('statmenu', $values, array('on_change' => "window.location.href=this.options[this.selectedIndex].value", 'value' => $selected));
echo "</td>";
echo "</tr>";
echo "</table>";
}
示例4: title
/**
* Show report title
**/
static function title()
{
global $PLUGIN_HOOKS, $CFG_GLPI;
// Report generation
// Default Report included
$report_list["default"]["name"] = __('Default report');
$report_list["default"]["file"] = "report.default.php";
if (Contract::canView()) {
// Rapport ajoute par GLPI V0.2
$report_list["Contrats"]["name"] = __('By contract');
$report_list["Contrats"]["file"] = "report.contract.php";
}
if (Infocom::canView()) {
$report_list["Par_annee"]["name"] = __('By year');
$report_list["Par_annee"]["file"] = "report.year.php";
$report_list["Infocoms"]["name"] = __('Hardware financial and administrative information');
$report_list["Infocoms"]["file"] = "report.infocom.php";
$report_list["Infocoms2"]["name"] = __('Other financial and administrative information (licenses, cartridges, consumables)');
$report_list["Infocoms2"]["file"] = "report.infocom.conso.php";
}
if (Session::haveRight("networking", READ)) {
$report_list["Rapport prises reseau"]["name"] = __('Network report');
$report_list["Rapport prises reseau"]["file"] = "report.networking.php";
}
if (Session::haveRight("reservation", READ)) {
$report_list["reservation"]["name"] = __('Loan');
$report_list["reservation"]["file"] = "report.reservation.php";
}
if (Computer::canView() || Monitor::canView() || Session::haveRight("networking", READ) || Peripheral::canView() || Printer::canView() || Phone::canView()) {
$report_list["state"]["name"] = _n('Status', 'Statuses', Session::getPluralNumber());
$report_list["state"]["file"] = "report.state.php";
}
//Affichage du tableau de presentation des stats
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='2'>" . __('Select the report you want to generate') . "</th></tr>";
echo "<tr class='tab_bg_1'><td class='center'>";
$count = count($report_list);
$selected = -1;
$values = array($CFG_GLPI["root_doc"] . '/front/report.php' => Dropdown::EMPTY_VALUE);
while ($data = each($report_list)) {
$val = $data[0];
$name = $report_list["{$val}"]["name"];
$file = $report_list["{$val}"]["file"];
$key = $CFG_GLPI["root_doc"] . "/front/" . $file;
$values[$key] = $name;
if (stripos($_SERVER['REQUEST_URI'], $key) !== false) {
$selected = $key;
}
}
$names = array();
$optgroup = array();
if (isset($PLUGIN_HOOKS["reports"]) && is_array($PLUGIN_HOOKS["reports"])) {
foreach ($PLUGIN_HOOKS["reports"] as $plug => $pages) {
if (is_array($pages) && count($pages)) {
foreach ($pages as $page => $name) {
$names[$plug . '/' . $page] = array("name" => $name, "plug" => $plug);
$optgroup[$plug] = Plugin::getInfo($plug, 'name');
}
}
}
asort($names);
}
foreach ($optgroup as $opt => $title) {
$group = $title;
foreach ($names as $key => $val) {
if ($opt == $val["plug"]) {
$file = $CFG_GLPI["root_doc"] . "/plugins/" . $key;
$values[$group][$file] = $val["name"];
if (stripos($_SERVER['REQUEST_URI'], $file) !== false) {
$selected = $file;
}
}
}
}
Dropdown::showFromArray('statmenu', $values, array('on_change' => "window.location.href=this.options[this.selectedIndex].value", 'value' => $selected));
echo "</td>";
echo "</tr>";
echo "</table>";
}
示例5: title
/**
* Show report title
**/
static function title()
{
global $PLUGIN_HOOKS, $CFG_GLPI;
// Report generation
// Default Report included
$report_list["default"]["name"] = __('Default report');
$report_list["default"]["file"] = "report.default.php";
if (Session::haveRight("contract", "r")) {
// Rapport ajoute par GLPI V0.2
$report_list["Contrats"]["name"] = __('By contract');
$report_list["Contrats"]["file"] = "report.contract.php";
}
if (Session::haveRight("infocom", "r")) {
$report_list["Par_annee"]["name"] = __('By year');
$report_list["Par_annee"]["file"] = "report.year.php";
$report_list["Infocoms"]["name"] = __('Hardware financial and administrative information');
$report_list["Infocoms"]["file"] = "report.infocom.php";
$report_list["Infocoms2"]["name"] = __('Other financial and administrative information (licenses, cartridges, consumables)');
$report_list["Infocoms2"]["file"] = "report.infocom.conso.php";
}
if (Session::haveRight("networking", "r")) {
$report_list["Rapport prises reseau"]["name"] = __('Network report');
$report_list["Rapport prises reseau"]["file"] = "report.networking.php";
}
if (Session::haveRight("reservation_central", "r")) {
$report_list["reservation"]["name"] = __('Loan');
$report_list["reservation"]["file"] = "report.reservation.php";
}
if (Session::haveRight("computer", "r") || Session::haveRight("monitor", "r") || Session::haveRight("networking", "r") || Session::haveRight("peripheral", "r") || Session::haveRight("printer", "r") || Session::haveRight("phone", "r")) {
$report_list["state"]["name"] = _n('Status', 'Statuses', 2);
$report_list["state"]["file"] = "report.state.php";
}
//Affichage du tableau de presentation des stats
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='2'>" . __('Select the report you want to generate') . "</th></tr>";
echo "<tr class='tab_bg_1'><td class='center'>";
echo "<select name='statmenu' onchange='window.location.href=this.options\n [this.selectedIndex].value'>";
echo "<option value='-1' selected>" . Dropdown::EMPTY_VALUE . "</option>";
$i = 0;
$count = count($report_list);
while ($data = each($report_list)) {
$val = $data[0];
$name = $report_list["{$val}"]["name"];
$file = $report_list["{$val}"]["file"];
echo "<option value='" . $CFG_GLPI["root_doc"] . "/front/" . $file . "'>" . $name . "</option>";
$i++;
}
$names = array();
$optgroup = array();
if (isset($PLUGIN_HOOKS["reports"]) && is_array($PLUGIN_HOOKS["reports"])) {
foreach ($PLUGIN_HOOKS["reports"] as $plug => $pages) {
if (is_array($pages) && count($pages)) {
foreach ($pages as $page => $name) {
$names[$plug . '/' . $page] = array("name" => $name, "plug" => $plug);
$optgroup[$plug] = Plugin::getInfo($plug, 'name');
}
}
}
asort($names);
}
foreach ($optgroup as $opt => $title) {
echo "<optgroup label=\"" . $title . "\">";
foreach ($names as $key => $val) {
if ($opt == $val["plug"]) {
echo "<option value='" . $CFG_GLPI["root_doc"] . "/plugins/" . $key . "'>" . $val["name"] . "</option>";
}
}
echo "</optgroup>";
}
echo "</select>";
echo "</td>";
echo "</tr>";
echo "</table>";
}
示例6: title
/**
* @since version 0.84
**/
static function title()
{
global $PLUGIN_HOOKS, $CFG_GLPI;
$show_problem = Session::haveRight("edit_all_problem", "1") || Session::haveRight("show_all_problem", "1");
$opt_list["Ticket"] = __('Tickets');
$stat_list["Ticket"]["Ticket_Global"]["name"] = __('Global');
$stat_list["Ticket"]["Ticket_Global"]["file"] = "stat.global.php?itemtype=Ticket";
$stat_list["Ticket"]["Ticket_Ticket"]["name"] = __('By ticket');
$stat_list["Ticket"]["Ticket_Ticket"]["file"] = "stat.tracking.php?itemtype=Ticket";
$stat_list["Ticket"]["Ticket_Location"]["name"] = __('By hardware characteristics');
$stat_list["Ticket"]["Ticket_Location"]["file"] = "stat.location.php?itemtype=Ticket";
$stat_list["Ticket"]["Ticket_Item"]["name"] = __('By hardware');
$stat_list["Ticket"]["Ticket_Item"]["file"] = "stat.item.php";
if ($show_problem) {
$opt_list["Problem"] = _n('Problem', 'Problems', 2);
$stat_list["Problem"]["Problem_Global"]["name"] = __('Global');
$stat_list["Problem"]["Problem_Global"]["file"] = "stat.global.php?itemtype=Problem";
$stat_list["Problem"]["Problem_Problem"]["name"] = __('By problem');
$stat_list["Problem"]["Problem_Problem"]["file"] = "stat.tracking.php?itemtype=Problem";
}
//Affichage du tableau de presentation des stats
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='2'>" . __('Select statistics to be displayed') . "</th></tr>";
echo "<tr class='tab_bg_1'><td class='center'>";
echo "<select name='statmenu' onchange='window.location.href=this.options\n [this.selectedIndex].value'>";
echo "<option value='-1' selected>" . Dropdown::EMPTY_VALUE . "</option>";
$i = 0;
$count = count($stat_list);
foreach ($opt_list as $opt => $group) {
echo "<optgroup label=\"" . $group . "\">";
while ($data = each($stat_list[$opt])) {
$name = $data[1]["name"];
$file = $data[1]["file"];
$comment = "";
if (isset($data[1]["comment"])) {
$comment = $data[1]["comment"];
}
echo "<option value='" . $CFG_GLPI["root_doc"] . "/front/" . $file . "'\n title=\"" . Html::cleanInputText($comment) . "\">" . $name . "</option>";
$i++;
}
echo "</optgroup>";
}
$names = array();
$optgroup = array();
if (isset($PLUGIN_HOOKS["stats"]) && is_array($PLUGIN_HOOKS["stats"])) {
foreach ($PLUGIN_HOOKS["stats"] as $plug => $pages) {
if (is_array($pages) && count($pages)) {
foreach ($pages as $page => $name) {
$names[$plug . '/' . $page] = array("name" => $name, "plug" => $plug);
$optgroup[$plug] = Plugin::getInfo($plug, 'name');
}
}
}
asort($names);
}
foreach ($optgroup as $opt => $title) {
echo "<optgroup label=\"" . $title . "\">";
foreach ($names as $key => $val) {
if ($opt == $val["plug"]) {
echo "<option value='" . $CFG_GLPI["root_doc"] . "/plugins/" . $key . "'>" . $val["name"] . "</option>";
}
}
echo "</optgroup>";
}
echo "</select>";
echo "</td>";
echo "</tr>";
echo "</table>";
}
示例7: helpHeader
/**
* Print a nice HTML head for help page
*
* @param $title title of the page
* @param $url not used anymore (default '')
**/
static function helpHeader($title, $url = '')
{
global $CFG_GLPI, $HEADER_LOADED, $PLUGIN_HOOKS, $DB;
// Print a nice HTML-head for help page
if ($HEADER_LOADED) {
return;
}
$HEADER_LOADED = true;
self::includeHeader($title);
// Body
echo "<body>";
echo '
<nav class="navbar navbar-default" id="menuHeader">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="' . $CFG_GLPI["root_doc"] . '/front/central.php">
<img src="' . $CFG_GLPI["root_doc"] . '/pics/fd_logo1.png" style="margin-top:-4px;" />
<span class=\'invisible\'>Logo</span>
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">';
echo "<li id='menu1'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' title=\"" . __s('Home') . "\" class='itemP'>" . __('Home') . "</a>";
echo "</li>";
// Create ticket
if (Session::haveRight("ticket", CREATE)) {
echo "<li id='menu2'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?create_ticket=1' " . "title=\"" . __s('Create a ticket') . "\" class='itemP'>" . __('Create a ticket') . "</a>";
echo "</li>";
}
// Suivi ticket
if (Session::haveRight("ticket", Ticket::READMY) || Session::haveRight("followup", TicketFollowup::SEEPUBLIC)) {
echo "<li id='menu3'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/ticket.php' title=\"" . __s('Ticket followup') . "\" class='itemP'>" . _n('Ticket', 'Tickets', Session::getPluralNumber()) . "</a>";
echo "</li>";
}
// Reservation
if (Session::haveRight("reservation", ReservationItem::RESERVEANITEM)) {
echo "<li id='menu4'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.php' title=\"" . _sn('Reservation', 'Reservations', Session::getPluralNumber()) . "\" class='itemP'>" . _n('Reservation', 'Reservations', Session::getPluralNumber()) . "</a>";
echo "</li>";
}
// FAQ
if (Session::haveRight('knowbase', KnowbaseItem::READFAQ)) {
echo "<li id='menu5' >";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.faq.php' title=\"" . __s('FAQ') . "\" class='itemP'>" . __('FAQ') . "</a>";
echo "</li>";
}
// PLUGINS
$plugins = array();
if (isset($PLUGIN_HOOKS["helpdesk_menu_entry"]) && count($PLUGIN_HOOKS["helpdesk_menu_entry"])) {
foreach ($PLUGIN_HOOKS["helpdesk_menu_entry"] as $plugin => $active) {
if ($active) {
$plugins[$plugin] = Plugin::getInfo($plugin);
}
}
}
if (isset($plugins) && count($plugins) > 0) {
$list = array();
foreach ($plugins as $key => $val) {
$list[$key] = $val["name"];
}
asort($list);
//echo "<li id='menu5' onmouseover=\"javascript:menuAff('menu5','menu');\">";
echo "<li id='menu5'>";
echo "<a href='#' title=\"" . _sn('Plugin', 'Plugins', Session::getPluralNumber()) . "\" class='itemP'>" . __('Plugins') . "</a>";
// default none
echo "<ul class='ssmenu'>";
// list menu item
foreach ($list as $key => $val) {
$link = "";
if (is_string($PLUGIN_HOOKS["helpdesk_menu_entry"][$key])) {
$link = $PLUGIN_HOOKS["helpdesk_menu_entry"][$key];
}
echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/plugins/" . $key . $link . "'>" . $plugins[$key]["name"] . "</a></li>\n";
}
echo "</ul></li>";
}
echo "<div class='sep'></div>";
echo '</ul>';
echo '<ul class="nav navbar-nav navbar-right">';
$sql_photo2 = "SELECT picture\n\t\t\t\t\t\t\t\tFROM glpi_users\n\t\t\t\t\t\t\t\tWHERE id = " . $_SESSION["glpiID"] . " ";
$res_photo2 = $DB->query($sql_photo2);
$pic2 = $DB->result($res_photo2, 0, 'picture');
//.........这里部分代码省略.........
示例8: helpHeader
/**
* Print a nice HTML head for help page
*
* @param $title title of the page
* @param $url not used anymore (default '')
**/
static function helpHeader($title, $url = '')
{
global $CFG_GLPI, $HEADER_LOADED, $PLUGIN_HOOKS;
// Print a nice HTML-head for help page
if ($HEADER_LOADED) {
return;
}
$HEADER_LOADED = true;
self::includeHeader($title);
// Body
echo "<body>";
// Main Headline
echo "<div id='header'>";
echo "<div id='c_logo' >";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' accesskey='1' title=\"" . __s('Home') . "\"><span class='invisible'>Logo</span></a></div>";
// Les préférences + lien déconnexion
echo "<div id='c_preference' >";
echo "<ul><li id='deconnexion'><a href='" . $CFG_GLPI["root_doc"] . "/logout.php' title=\"" . __s('Logout') . "\">" . __('Logout') . "</a>";
// check user id : header used for display messages when session logout
if (Session::getLoginUserID()) {
echo " (";
echo formatUserName(0, $_SESSION["glpiname"], $_SESSION["glpirealname"], $_SESSION["glpifirstname"], 0, 20);
echo ")";
}
echo "</li>\n";
echo "<li><a href='" . (empty($CFG_GLPI["helpdesk_doc_url"]) ? "http://glpi-project.org/help-helpdesk" : $CFG_GLPI["helpdesk_doc_url"]) . "' target='_blank' title=\"" . __s('Help') . "\"> " . __('Help') . "</a></li>";
echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/front/preference.php' title=\"" . __s('Settings') . "\">" . __('Settings') . "</a></li>\n";
echo "</ul>";
echo "<div class='sep'></div>";
echo "</div>";
//-- Le moteur de recherche --
echo "<div id='c_recherche'>";
echo "<div class='sep'></div>";
echo "</div>";
//-- Le menu principal --
echo "<div id='c_menu'>";
echo "<ul id='menu'>";
// Build the navigation-elements
// Home
echo "<li id='menu1'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' title=\"" . __s('Home') . "\" class='itemP'>" . __('Home') . "</a>";
echo "</li>";
// Create ticket
if (Session::haveRight("create_ticket", "1")) {
echo "<li id='menu2'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?create_ticket=1' " . "title=\"" . __s('Create a ticket') . "\" class='itemP'>" . __('Create a ticket') . "</a>";
echo "</li>";
}
// Suivi ticket
if (Session::haveRight("observe_ticket", "1") || Session::haveRight("create_ticket", "1")) {
echo "<li id='menu3'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/ticket.php' title=\"" . __s('Ticket followup') . "\" class='itemP'>" . _n('Ticket', 'Tickets', 2) . "</a>";
echo "</li>";
}
// Reservation
if (Session::haveRight("reservation_helpdesk", "1")) {
echo "<li id='menu4'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.php' title=\"" . _sn('Reservation', 'Reservations', 2) . "\" class='itemP'>" . _n('Reservation', 'Reservations', 2) . "</a>";
echo "</li>";
}
// FAQ
if (Session::haveRight("faq", "r")) {
echo "<li id='menu5' >";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.faq.php' title=\"" . __s('FAQ') . "\" class='itemP'>" . __('FAQ') . "</a>";
echo "</li>";
}
// PLUGINS
$plugins = array();
if (isset($PLUGIN_HOOKS["helpdesk_menu_entry"]) && count($PLUGIN_HOOKS["helpdesk_menu_entry"])) {
foreach ($PLUGIN_HOOKS["helpdesk_menu_entry"] as $plugin => $active) {
if ($active) {
$plugins[$plugin] = Plugin::getInfo($plugin);
}
}
}
if (isset($plugins) && count($plugins) > 0) {
$list = array();
foreach ($plugins as $key => $val) {
$list[$key] = $val["name"];
}
asort($list);
echo "<li id='menu5' onmouseover=\"javascript:menuAff('menu5','menu');\">";
echo "<a href='#' title=\"" . __s('Plugins') . "\" class='itemP'>" . __('Plugins') . "</a>";
// default none
echo "<ul class='ssmenu'>";
// list menu item
foreach ($list as $key => $val) {
$link = "";
if (is_string($PLUGIN_HOOKS["helpdesk_menu_entry"][$key])) {
$link = $PLUGIN_HOOKS["helpdesk_menu_entry"][$key];
}
echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/plugins/" . $key . $link . "'>" . $plugins[$key]["name"] . "</a></li>\n";
}
echo "</ul></li>";
//.........这里部分代码省略.........
示例9: __
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkCentralAccess();
Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "rule", -1);
echo "<table class='tab_cadre'>";
echo "<tr><th>" . __('Rule type') . "</th></tr>";
foreach ($CFG_GLPI["rulecollections_types"] as $rulecollectionclass) {
$rulecollection = new $rulecollectionclass();
if ($rulecollection->canList()) {
if ($plug = isPluginItemType($rulecollectionclass)) {
$title = sprintf(__('%1$s - %2$s'), Plugin::getInfo($plug['plugin'], 'name'), $rulecollection->getTitle());
} else {
$title = $rulecollection->getTitle();
}
echo "<tr class='tab_bg_1'><td class='center b'>";
echo "<a href='" . Toolbox::getItemTypeSearchURL($rulecollection->getRuleClassName()) . "'>";
echo $title . "</a></td></tr>";
}
}
if (Session::haveRight("transfer", "r") && Session::isMultiEntitiesMode()) {
echo "<tr class='tab_bg_1'><td class='center b'>";
echo "<a href='" . $CFG_GLPI['root_doc'] . "/front/transfer.php'>" . __('Transfer') . "</a>";
echo "</td></tr>";
}
if (Session::haveRight("config", "r")) {
echo "<tr class='tab_bg_1'><td class='center b'>";
示例10: getItemtypes
static function getItemtypes()
{
global $PLUGIN_HOOKS;
$tab = array(__("Assets") => array('Computer' => _n("Computer", "Computers", 2), 'Monitor' => _n("Monitor", "Monitors", 2), 'Software' => _n("Software", "Software", 2), 'NetworkEquipment' => _n("Network", "Networks", 2), 'Peripheral' => _n("Device", "Devices", 2), 'Printer' => _n("Printer", "Printers", 2), 'CartridgeItem' => _n("Cartridge", "Cartridges", 2), 'ConsumableItem' => _n("Consumable", "Consumables", 2), 'Phone' => _n("Phone", "Phones", 2)), __("Assistance") => array('Ticket' => _n("Ticket", "Tickets", 2), 'Problem' => _n("Problem", "Problems", 2), 'Change' => _n("Change", "Changes", 2), 'TicketRecurrent' => __("Recurrent tickets")), __("Management") => array('SoftwareLicense' => _n("License", "Licenses", 2), 'Budget' => _n("Budget", "Budgets", 2), 'Supplier' => _n("Supplier", "Suppliers", 2), 'Contact' => _n("Contact", "Contacts", 2), 'Contract' => _n("Contract", "Contracts", 2), 'Document' => _n("Document", "Documents", 2)), __("Tools") => array('Project' => __("Project"), 'ProjectTask' => _n("Project task", "Project tasks", 2), 'Reminder' => _n("Note", "Notes", 2), 'RSSFeed' => __("RSS feed")), __("Administration") => array('User' => _n("User", "Users", 2), 'Group' => _n("Group", "Groups", 2), 'Entity' => _n("Entity", "Entities", 2), 'Profile' => _n("Profile", "Profiles", 2)));
foreach ($PLUGIN_HOOKS['plugin_fields'] as $itemtype) {
$isPlugin = isPluginItemType($itemtype);
if ($isPlugin) {
$plugin_name = Plugin::getInfo($isPlugin['plugin'], 'name');
$tab[__("Plugins")][$itemtype] = $plugin_name . ' - ' . $itemtype::getTypeName(Session::getPluralNumber());
}
}
return $tab;
}