本文整理汇总了PHP中OutputPage::GenerateMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputPage::GenerateMenu方法的具体用法?PHP OutputPage::GenerateMenu怎么用?PHP OutputPage::GenerateMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPage
的用法示例。
在下文中一共展示了OutputPage::GenerateMenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
// Set the path if it is not done now
if ($path == '') {
$path = "<a href=\"special.php?page={$page}\">{$title}</a>";
}
// Set replacements and variables for ComaLate
$output->Title = $config->Get('pagename', 'ComaCMS') . ' - ' . $title;
$output->SetReplacement('TEXT', $text);
$output->SetReplacement('PATH', $path);
$output->SetCondition('notathome', true);
// Get and generate the menus for the page
$sql = "SELECT menu_name, menu_id\r\n\t\tFROM " . DB_PREFIX . "menu";
$menus = $sqlConnection->SqlQuery($sql);
while ($menu = mysql_fetch_object($menus)) {
if (empty($menuArray)) {
if ($output->ReplacementExists('MENU_' . $menu->menu_name, true)) {
$output->SetReplacement('MENU_' . $menu->menu_name, $outputpage->GenerateMenu($menu->menu_id));
}
} else {
if ($menu->menu_name != 'DEFAULT') {
if ($output->ReplacementExists('MENU_' . $menu->menu_name, true)) {
$output->SetReplacement('MENU_' . $menu->menu_name, $outputpage->GenerateMenu($menu->menu_id));
}
} else {
$menu = array();
foreach ($menuArray as $part) {
if ($page == $part[1] || $subpage == $part[1]) {
$linkStyle = ' class="actual"';
} else {
$linkStyle = '';
}
if (strpos($part[1], 'url:') === 0) {
示例2: array
}
$menu = array();
foreach ($menuArray as $part) {
if ($page == $part[1]) {
$linkStyle = ' class="actual"';
} else {
$linkStyle = '';
}
$menu[] = array('LINK_TEXT' => $part[0], 'LINK' => 'admin.php?page=' . $part[1], 'CSS_ID' => '', 'LINK_STYLE' => $linkStyle);
}
// Replace all menus except of DEFAULT with data of database
$sql = "SELECT menu_name, menu_id\r\n\t\tFROM " . DB_PREFIX . "menu";
$menus = $sqlConnection->SqlQuery($sql);
while ($database_menu = mysql_fetch_object($menus)) {
if ($database_menu->menu_name != 'DEFAULT') {
$output->SetReplacement('MENU_' . $database_menu->menu_name, $outputpage->GenerateMenu($database_menu->menu_id));
}
}
// Replace DEFAULT menu by admin menuarray
$output->SetReplacement('MENU_DEFAULT', $menu);
// Replace outputtext
$output->SetReplacement('TEXT', $text);
// Replace Title
$output->Title = $translation->GetTranslation('administration') . ' - ' . $title;
$output->SetCondition('notathome', true);
$output->SetCondition('notinindex', true);
$output->SetCondition('notinadmin', false);
$path = '';
if ($page != 'admincontrol') {
$path = " -> <a href=\"admin.php?page={$page}\">{$title}</a>{$path_add}";
}