本文整理汇总了PHP中gpOutput::FixMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP gpOutput::FixMenu方法的具体用法?PHP gpOutput::FixMenu怎么用?PHP gpOutput::FixMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpOutput
的用法示例。
在下文中一共展示了gpOutput::FixMenu方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMenuArray
/**
* Return the data for the requested menu, return the main menu if the requested menu doesn't exist
* @param string $id String identifying the requested menu
* @return array menu data
*/
static function GetMenuArray($id)
{
global $dataDir, $gp_menu;
$menu_file = $dataDir . '/data/_menus/' . $id . '.php';
if (empty($id) || !gpFiles::Exists($menu_file)) {
return gpPlugin::Filter('GetMenuArray', array($gp_menu));
}
$menu = gpFiles::Get('_menus/' . $id, 'menu');
if (gpFiles::$last_version && version_compare(gpFiles::$last_version, '3.0b1', '<')) {
$menu = gpOutput::FixMenu($menu);
}
return gpPlugin::Filter('GetMenuArray', array($menu));
}
示例2: GetMenuArray
/**
* Return the data for the requested menu, return the main menu if the requested menu doesn't exist
* @param string $id String identifying the requested menu
* @return array menu data
*/
function GetMenuArray($id)
{
global $dataDir, $gp_menu, $config;
$menu_file = $dataDir . '/data/_menus/' . $id . '.php';
if (!file_exists($menu_file)) {
return gpPlugin::Filter('GetMenuArray', array($gp_menu));
}
$menu = array();
$fileVersion = false;
require $menu_file;
if ($fileVersion && version_compare($fileVersion, '3.0b1', '<')) {
$menu = gpOutput::FixMenu($menu);
}
return gpPlugin::Filter('GetMenuArray', array($menu));
}
示例3: GetPagesPHP
/**
* Set global variables ( $gp_index, $gp_titles, $gp_menu and $gpLayouts ) from _site/pages.php
*
*/
static function GetPagesPHP()
{
global $gp_index, $gp_titles, $gp_menu, $gpLayouts, $config;
$gp_index = array();
$pages = gpFiles::Get('_site/pages');
//update for < 2.0a3
if (array_key_exists('gpmenu', $pages) && array_key_exists('gptitles', $pages) && !array_key_exists('gp_titles', $pages) && !array_key_exists('gp_menu', $pages)) {
foreach ($pages['gptitles'] as $title => $info) {
$index = common::NewFileIndex();
$gp_index[$title] = $index;
$gp_titles[$index] = $info;
}
foreach ($pages['gpmenu'] as $title => $level) {
$index = $gp_index[$title];
$gp_menu[$index] = array('level' => $level);
}
return;
}
$gpLayouts = $pages['gpLayouts'];
$gp_index = $pages['gp_index'];
$gp_titles = $pages['gp_titles'];
$gp_menu = $pages['gp_menu'];
if (!is_array($gp_menu)) {
common::stop();
}
//update for 3.5,
if (!isset($gp_titles['special_gpsearch'])) {
$gp_titles['special_gpsearch'] = array();
$gp_titles['special_gpsearch']['label'] = 'Search';
$gp_titles['special_gpsearch']['type'] = 'special';
$gp_index['Search'] = 'special_gpsearch';
//may overwrite special_search settings
}
//fix the gpmenu
if (version_compare(gpFiles::$last_version, '3.0b1', '<')) {
$gp_menu = gpOutput::FixMenu($gp_menu);
// fix gp_titles for gpEasy 3.0+
// just make sure any ampersands in the label are escaped
foreach ($gp_titles as $key => $value) {
if (isset($gp_titles[$key]['label'])) {
$gp_titles[$key]['label'] = common::GetLabelIndex($key, true);
}
}
}
//title related configuration settings
if (empty($config['homepath_key'])) {
$config['homepath_key'] = key($gp_menu);
}
$config['homepath'] = common::IndexToTitle($config['homepath_key']);
}
示例4: GetPagesPHP
/**
* Set global variables ( $gp_index, $gp_titles, $gp_menu and $gpLayouts ) from _site/pages.php
*
*/
function GetPagesPHP()
{
global $gp_index, $gp_titles, $gp_menu, $dataDir, $gpLayouts;
$gp_index = array();
$pages = array();
require $dataDir . '/data/_site/pages.php';
$GLOBALS['fileModTimes']['pages.php'] = $fileModTime;
$gpLayouts = $pages['gpLayouts'];
//update for < 2.0a3
if (isset($pages['gpmenu']) && isset($pages['gptitles'])) {
//1.7b2
if (!isset($pages['gptitles']['Special_Missing'])) {
$pages['gptitles']['Special_Missing']['type'] = 'special';
$pages['gptitles']['Special_Missing']['label'] = 'Missing';
}
foreach ($pages['gptitles'] as $title => $info) {
$index = common::NewFileIndex();
$gp_index[$title] = $index;
$gp_titles[$index] = $info;
}
foreach ($pages['gpmenu'] as $title => $level) {
$index = $gp_index[$title];
$gp_menu[$index] = array('level' => $level);
}
return;
}
$gp_index = $pages['gp_index'];
$gp_titles = $pages['gp_titles'];
$gp_menu = $pages['gp_menu'];
//fix the gpmenu
if (version_compare($fileVersion, '3.0b1', '<')) {
$gp_menu = gpOutput::FixMenu($gp_menu);
// fix gp_titles for gpEasy 3.0+
// just make sure any ampersands in the label are escaped
foreach ($gp_titles as $key => $value) {
if (isset($gp_titles[$key]['label'])) {
$gp_titles[$key]['label'] = common::GetLabelIndex($key, true);
}
}
}
}