当前位置: 首页>>代码示例>>PHP>>正文


PHP CommonGLPI::isLayoutExcludedPage方法代码示例

本文整理汇总了PHP中CommonGLPI::isLayoutExcludedPage方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonGLPI::isLayoutExcludedPage方法的具体用法?PHP CommonGLPI::isLayoutExcludedPage怎么用?PHP CommonGLPI::isLayoutExcludedPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommonGLPI的用法示例。


在下文中一共展示了CommonGLPI::isLayoutExcludedPage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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
     $body_class = "layout_" . $_SESSION['glpilayout'];
     if (strpos($_SERVER['REQUEST_URI'], "form.php") !== false && isset($_GET['id']) && $_GET['id'] > 0) {
         if (!CommonGLPI::isLayoutExcludedPage()) {
             $body_class .= " form";
         } else {
             $body_class = "";
         }
     }
     echo "<body class='{$body_class}'>";
     // Main Headline
     echo "<div id='header'>";
     echo "<div id='header_top'>";
     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>";
     echo "</div>";
     // Les préférences + lien déconnexion
     echo "<div id='c_preference' >";
     echo "<ul>";
     echo "<li id='deconnexion'>";
     echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/logout.php";
     /// logout witout noAuto login for extauth
     if (isset($_SESSION['glpiextauth']) && $_SESSION['glpiextauth']) {
         echo "?noAUTO=1";
     }
     echo "' title=\"" . __s('Logout') . "\">";
     // check user id : header used for display messages when session logout
     echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/logout.png' title=\"" . __s('Logout') . "\"  alt=\"" . __s('Logout') . "\" class='button-icon'>";
     echo "</a>";
     echo "</li>\n";
     echo "<li id='preferences_link'><a href='" . $CFG_GLPI["root_doc"] . "/front/preference.php' title=\"" . __s('My settings') . "\">";
     echo "<span id='preferences_icon' title=\"" . __s('My settings') . "\"  alt=\"" . __s('My settings') . "\" class='button-icon' /></span>";
     // check user id : header used for display messages when session logout
     if (Session::getLoginUserID()) {
         echo "<span id='myname'>";
         echo formatUserName(0, $_SESSION["glpiname"], $_SESSION["glpirealname"], $_SESSION["glpifirstname"], 0, 20);
         echo "</span>";
     }
     echo "</a></li>";
     echo "<li>";
     Ajax::createIframeModalWindow('loadbookmark', $CFG_GLPI["root_doc"] . "/front/bookmark.php?action=load", array('title' => __('Load a bookmark'), 'reloadonclose' => true));
     echo "<a href='#' onClick=\"" . Html::jsGetElementbyID('loadbookmark') . ".dialog('open');\">";
     echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/bookmark.png' title=\"" . __s('Load a bookmark') . "\"  alt=\"" . __s('Load a bookmark') . "\" class='button-icon'>";
     echo "</a></li>";
     echo "<li id='help_link'>" . "<a href='" . (empty($CFG_GLPI["helpdesk_doc_url"]) ? "http://glpi-project.org/help-helpdesk" : $CFG_GLPI["helpdesk_doc_url"]) . "' target='_blank' title=\"" . __s('Help') . "\">" . "<img src='" . $CFG_GLPI["root_doc"] . "/pics/help.png' title=\"" . __s('Help') . "\"  alt=\"" . __s('Help') . "\" class='button-icon'>";
     "</a></li>";
     echo "</ul>";
     echo "</div>";
     //-- Le moteur de recherche --
     echo "<div id='c_recherche'></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("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();
//.........这里部分代码省略.........
开发者ID:OlivierLM,项目名称:glpi,代码行数:101,代码来源:html.class.php

示例2: createTabs

 /**
  *  Create Ajax Tabs apply to 'tabspanel' div. Content is displayed in 'tabcontent'
  *
  * @param $tabdiv_id                ID of the div containing the tabs (default 'tabspanel')
  * @param $tabdivcontent_id         ID of the div containing the content loaded by tabs
  *                                  (default 'tabcontent')
  * @param $tabs               array of tabs to create :
  *                                  tabs is array('key' => array('title'=> 'x',
  *                                                                url    => 'url_toload',
  *                                                                params => 'url_params')...
  * @param $type                     itemtype for active tab
  * @param $ID                       ID of element for active tab (default 0)
  * @param $orientation              orientation of tabs (default vertical may also be horizontal)
  *
  * @return nothing
  **/
 static function createTabs($tabdiv_id = 'tabspanel', $tabdivcontent_id = 'tabcontent', $tabs = array(), $type, $ID = 0, $orientation = 'vertical')
 {
     global $CFG_GLPI;
     /// TODO need to clean params !!
     $active_tabs = Session::getActiveTab($type);
     $rand = mt_rand();
     if (count($tabs) > 0) {
         echo "<div id='tabs{$rand}' class='center {$orientation}'>";
         if (CommonGLPI::isLayoutWithMain() && !CommonGLPI::isLayoutExcludedPage()) {
             $orientation = 'horizontal';
         }
         echo "<ul>";
         $current = 0;
         $selected_tab = 0;
         foreach ($tabs as $key => $val) {
             if ($key == $active_tabs) {
                 $selected_tab = $current;
             }
             echo "<li><a title=\"" . str_replace(array("<sup class='tab_nb'>", '</sup>'), '', $val['title']) . "\" ";
             echo " href='" . $val['url'] . (isset($val['params']) ? '?' . $val['params'] : '') . "'>";
             // extract sup information
             // $title = '';
             // $limit = 16;
             // No title strip for horizontal menu
             $title = $val['title'];
             echo $title . "</a></li>";
             $current++;
         }
         echo "</ul>";
         echo "</div>";
         echo "<div id='loadingtabs{$rand}' class='invisible'>" . "<div class='loadingindicator'>" . __s('Loading...') . "</div></div>";
         $js = "\n         forceReload{$rand} = false;\n         \$('#tabs{$rand}').tabs({\n            active: {$selected_tab},\n            // Loading indicator\n            beforeLoad: function (event, ui) {\n               if (\$(ui.panel).html()\n                   && !forceReload{$rand}) {\n                  event.preventDefault();\n               } else {\n                  ui.panel.html(\$('#loadingtabs{$rand}').html());\n                  forceReload{$rand} = false;\n                }\n            },\n            ajaxOptions: {type: 'POST'},\n            activate : function( event, ui ) {\n               // Get future value\n               var newIndex = ui.newTab.parent().children().index(ui.newTab);\n               \$.get('" . $CFG_GLPI['root_doc'] . "/ajax/updatecurrenttab.php',\n                  { itemtype: '{$type}', id: '{$ID}', tab: newIndex });\n            }\n         });";
         if ($orientation == 'vertical') {
             $js .= "\$('#tabs{$rand}').tabs().addClass( 'ui-tabs-vertical ui-helper-clearfix' );";
         }
         if (CommonGLPI::isLayoutWithMain() && !CommonGLPI::isLayoutExcludedPage()) {
             $js .= "\$('#tabs{$rand}').scrollabletabs();";
         } else {
             $js .= "\$('#tabs{$rand}').removeClass( 'ui-corner-top' ).addClass( 'ui-corner-left' );";
         }
         $js .= "// force reload\n            function reloadTab(add) {\n               forceReload{$rand} = true;\n               var current_index = \$('#tabs{$rand}').tabs('option','active');\n               // Save tab\n               currenthref = \$('#tabs{$rand} ul>li a').eq(current_index).attr('href');\n               \$('#tabs{$rand} ul>li a').eq(current_index).attr('href',currenthref+'&'+add);\n               \$('#tabs{$rand}').tabs( 'load' , current_index);\n               // Restore tab\n               \$('#tabs{$rand} ul>li a').eq(current_index).attr('href',currenthref);\n            };";
         echo Html::scriptBlock($js);
     }
 }
开发者ID:btry,项目名称:glpi,代码行数:60,代码来源:ajax.class.php


注:本文中的CommonGLPI::isLayoutExcludedPage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。