Html::displayMenuAll PHP Method

displayMenuAll() static public method

Display responsive menu
Since: 0.90.1
static public displayMenuAll ( $menu = [] )
$menu array of menu items - key : plugin system name - value : array of options * id : html id attribute * default : defaul url * title : displayed label * content : menu sub items, array with theses options : - page : url - title : displayed label - shortcut : keyboard shortcut letter
    static function displayMenuAll($menu = array())
    {
        global $CFG_GLPI, $PLUGIN_HOOKS;
        // Display MENU ALL
        echo "<div id='show_all_menu' class='invisible'>";
        $items_per_columns = 15;
        $i = -1;
        foreach ($menu as $part => $data) {
            if (isset($data['content']) && count($data['content'])) {
                echo "<table class='all_menu_block'>";
                $link = "#";
                if (isset($data['default']) && !empty($data['default'])) {
                    $link = $CFG_GLPI["root_doc"] . $data['default'];
                }
                echo "<tr><td class='tab_bg_1 b'>";
                echo "<a href='{$link}' title=\"" . $data['title'] . "\" class='itemP'>" . $data['title'] . "</a>";
                echo "</td></tr>";
                $i++;
                // list menu item
                foreach ($data['content'] as $key => $val) {
                    if (isset($val['page']) && isset($val['title'])) {
                        echo "<tr><td>";
                        if (isset($PLUGIN_HOOKS["helpdesk_menu_entry"][$key]) && is_string($PLUGIN_HOOKS["helpdesk_menu_entry"][$key])) {
                            echo "<a href='" . $CFG_GLPI["root_doc"] . "/plugins/" . $key . $val['page'] . "'";
                        } else {
                            echo "<a href='" . $CFG_GLPI["root_doc"] . $val['page'] . "'";
                        }
                        if (isset($data['shortcut']) && !empty($data['shortcut'])) {
                            echo " accesskey='" . $val['shortcut'] . "'";
                        }
                        echo ">";
                        echo $val['title'] . "</a></td></tr>\n";
                        $i++;
                    }
                }
                echo "</table>";
            }
        }
        echo "</div>";
        // init menu in jquery dialog
        Html::scriptStart();
        echo self::jsGetElementbyID('show_all_menu') . ".dialog({\n         height: 'auto',\n         width: 'auto',\n         modal: true,\n         autoOpen: false\n         });";
        echo Html::scriptEnd();
        /// Button to toggle responsive menu
        echo "<a href='#' onClick=\"" . self::jsGetElementbyID('show_all_menu') . ".dialog('open');\"\n            id='menu_all_button' class='button-icon'>";
        echo "</a>";
        echo "</div>";
    }
Html