addItem() public method

Добавляет новый пункт меню в меню
public addItem ( $title, $href, $parentId, boolean $regularLink = false ) : boolean
$title string - Заголовок
$href string - Ссылка
$parentId int - Родитель
$regularLink boolean - Обычная ссылка
return boolean
示例#1
0
 function getMenu()
 {
     $menu = new Menu($this->getName());
     $menu->addItem(new Menu_Item("?modus=news_create", "create"));
     $menu->addItem(new Menu_Item("?modus=news_show", "show"));
     return $menu->getMenu();
 }
 function print_dirtydates_menu()
 {
     $plugin_folder = 'admidio-db-dates';
     global $gCurrentUser;
     $dirtydatesmenu = new Menu('dirtydatesmenu', 'Terminzuabsagen');
     //Falls Datenbank nicht vorhanden Install-Skript starten
     $dirtydatesmenu->addItem('dirtydates_show', '/adm_plugins/' . $plugin_folder . '/dirtydates_adm_plugin.php?dd_userid=overview', 'Terminübersicht', '/icons/lists.png');
     if ($gCurrentUser->getValue('usr_id') != 0) {
         $dirtydatesmenu->addItem('dirtydates_change', '/adm_plugins/' . $plugin_folder . '/dirtydates_adm_plugin.php?dd_userid=' . $gCurrentUser->getValue('usr_id') . '', 'Meine Anwesenheit ändern', '/icons/profile.png');
     }
     echo '<div id="plgDirtydates" class="admidio-plugin-content">';
     echo $dirtydatesmenu->show();
     echo '</div>';
 }
 /**
  * @see		View::createUserInterface()
  */
 protected function createUserInterface()
 {
     $resourceBundle = Application::getInstance()->getBundle();
     //Definição do título da página principal da aplicação
     $this->setTitle($resourceBundle->getString('MAIN_TITLE'));
     //Carregamento da folha de estilo principal da aplicação
     $this->addStyle('/css/application.css');
     //Painel principal
     $this->applicationPanel = $this->addChild(new Panel());
     $this->applicationPanel->setId('application');
     $topPanel = $this->applicationPanel->addChild(new Panel());
     $topPanel->setId('top');
     //Título da aplicação
     $topPanel->addChild(new Heading())->addChild(new Anchor('/'))->addChild(new Text($resourceBundle->getString('SHORT_TITLE')));
     //Criação do menu da aplicação
     $this->applicationMenu = $topPanel->addChild(new Menu());
     foreach ($resourceBundle->getResource('MENU') as $resourceItem) {
         $this->applicationMenu->addItem($resourceItem->getValue(), $resourceItem->getIterator()->current()->getValue());
     }
     //Painel de conteúdo
     $this->contentPanel = $this->applicationPanel->addChild(new Panel());
     $this->contentPanel->setId('content');
 }
示例#4
0
 function getMenu()
 {
     $menu = new Menu($this->getName());
     $menu->addItem(new Menu_Item("?modus=doyouknow_list", "list"));
     return $menu->getMenu();
 }
示例#5
0
$moduleMenu->addItem('lists', '/adm_program/modules/lists/lists.php', $gL10n->get('LST_LISTS'), '/icons/lists.png');
if ($gValidLogin) {
    $moduleMenu->addItem('mylist', '/adm_program/modules/lists/mylist.php', $gL10n->get('LST_MY_LIST'), '/icons/mylist.png');
}
if ($gPreferences['enable_dates_module'] == 1 || $gPreferences['enable_dates_module'] == 2 && $gValidLogin) {
    $moduleMenu->addItem('dates', '/adm_program/modules/dates/dates.php', $gL10n->get('DAT_DATES'), '/icons/dates.png');
}
if ($gPreferences['enable_weblinks_module'] == 1 || $gPreferences['enable_weblinks_module'] == 2 && $gValidLogin) {
    $moduleMenu->addItem('links', '/adm_program/modules/links/links.php', $gL10n->get('LNK_WEBLINKS'), '/icons/weblinks.png');
}
echo $moduleMenu->show();
// Administration Menu
if ($gCurrentUser->approveUsers() || $gCurrentUser->editUsers() || $gCurrentUser->manageRoles() || $gCurrentUser->isWebmaster()) {
    $adminMenu = new Menu('administration', $gL10n->get('SYS_ADMINISTRATION'));
    if ($gCurrentUser->approveUsers() && $gPreferences['registration_mode'] > 0) {
        $adminMenu->addItem('newreg', '/adm_program/modules/registration/registration.php', $gL10n->get('NWU_NEW_REGISTRATIONS'), '/icons/new_registrations.png');
    }
    if ($gCurrentUser->editUsers()) {
        $adminMenu->addItem('usrmgt', '/adm_program/modules/members/members.php', $gL10n->get('MEM_USER_MANAGEMENT'), '/icons/user_administration.png');
    }
    if ($gCurrentUser->manageRoles()) {
        $adminMenu->addItem('roladm', '/adm_program/modules/roles/roles.php', $gL10n->get('ROL_ROLE_ADMINISTRATION'), '/icons/roles.png');
    }
    if ($gCurrentUser->isWebmaster()) {
        $adminMenu->addItem('dbback', '/adm_program/modules/backup/backup.php', $gL10n->get('BAC_DATABASE_BACKUP'), '/icons/backup.png');
        $adminMenu->addItem('orgprop', '/adm_program/modules/preferences/preferences.php', $gL10n->get('SYS_SETTINGS'), '/icons/options.png');
    }
    echo $adminMenu->show();
}
?>
                </div><!-- closes "div#plugin_menu" -->
示例#6
0
 function getMenu()
 {
     $menu = new Menu($this->getName());
     $menu->addItem(new Menu_Item("?modus=artefacts_list", "artefacts"));
     return $menu->getMenu();
 }
示例#7
0
 function getMenu()
 {
     $menu = new Menu($this->getName());
     $menu->addItem(new Menu_Item("?modus=player_search", "find"));
     return $menu->getMenu();
 }
示例#8
0
 function getMenu()
 {
     $menu = new Menu($this->getName());
     $menu->addItem(new Menu_Item("?modus=award_list", "list"));
     $menu->addItem(new Menu_Item("?modus=award_decorate_player", "decorate player"));
     $menu->addItem(new Menu_Item("?modus=award_decorate_tribe", "decorate tribe"));
     return $menu->getMenu();
 }
示例#9
0
 function getMenu()
 {
     $menu = new Menu($this->getName());
     $menu->addItem(new Menu_Item("?modus=mh_showlist", "gesperrte Spieler"));
     return $menu->getMenu();
 }
示例#10
0
	while ( $oRs->moveNext() )
	{
		$cdMenu = extractLanguage( $oRs->aFields['cdMenu'], $this->getLanguage()) ;
		$cUrl = substr($oRs->aFields['cUrl'], 0, 7) == 'http://' ? $oRs->aFields['cUrl'] : '?' . $oRs->aFields['cUrl'] . '&amp;ncMenu=' . $oRs->aFields['ncMenu'];
		$oMenuEntornos->addItem( extractLanguage( $oRs->aFields['cdMenu'], $this->getLanguage()) , $cUrl, 'body', $oRs->aFields['cDescripcion'], $oRs->aFields['bExpandido'], '', '', '', $oRs->aFields['ncMenu']  );
		$nIndex++;
	}
	$oMenuPpal = new Menu('body', 'menu_ppal', 'menu_ppal', true, 'mn');
	$oMenuPpal->setValue( '1.' .$aMenu[ncEntorno] .'.'. $aMenu[nSeccion] .'.' );
	$cSql = "SELECT ncMenu, cdMenu, cUrl, bExpandido, cDescripcion, cCamino FROM gtMenu WHERE ncEstadoPublicacion = 2 AND ncMenuPadre = " . $aMenu[ncEntorno];
	$oRs = $this->oDatabase->recordset($cSql);
	while ( $oRs->moveNext() )
	{
		$cdMenu = extractLanguage( $oRs->aFields['cdMenu'], $this->getLanguage()) ;
		$cUrl = substr($oRs->aFields['cUrl'], 0, 7) == 'http://' ? $oRs->aFields['cUrl'] : '?' . $oRs->aFields['cUrl'] . '&amp;pe=' . $aMenu[ncEntorno]. '.&amp;ncMenu=' . $oRs->aFields['ncMenu'];
		$oMenuPpal->addItem( $cdMenu, $cUrl, 'body', $oRs->aFields['cDescripcion'], $oRs->aFields['bExpandido'], '', '', '', $oRs->aFields['cCamino'] .  $oRs->aFields['ncMenu'] . '.'  );
	}
	//echo "<link  rel='stylesheet'  href='/bue/css/".strtolower(extractLanguage($cEntorno,'es')).".css' type='text/css' />";
	//$aModule[$cModule]->addStyleSheet( $cEntorno.".css" );

?>

<div id="head">
	<div class="barra_entorno">
		<div style="margin-top:20px"><a href="http://www.buenosaires.gob.ar"><img src="imagenes/logoBA_<?php 
echo $aMenu[ncEntorno];
?>
.gif" width="202" height="43" style="border:none" alt="Gobierno de Buenos Aires" /></a></div>
	</div>
	<div class="subcontainer">
		<!-- ingreso y buscador -->
示例#11
0
// create new TestTheme object
$theme = new TestTheme();
$theme->addHeadContent("<style type=text/css>body {font-size:18px}</style>");
// create the two layouts for navigation
$topMenuLayout = new TopMenuLayout();
$leftMenuLayout = new LeftMenuLayout();
// create two menus
$topMenu = new Menu();
$leftMenu = new Menu();
// add links to the top menu
$topMenu->addItem(new HeaderMenuItem("Top Menu:"));
$topMenu->addItem(new LinkMenuItem("Link1", "http://www.middlebury.edu"));
$topMenu->addItem(new LinkMenuItem("New window", "http://google.com", false, "_blank"));
$topMenu->addItem(new LinkMenuItem("JavaScript Alert", "#", false, null, "onclick='alert(\"testing\")'", "style='text-decoration:none' "));
// add links to the left menu
$leftMenu->addItem(new HeaderMenuItem("Left Menu"));
$leftMenu->addItem(new LinkMenuItem("Link1", "http://www.middlebury.edu"));
$leftMenu->addItem(new LinkMenuItem("New window", "http://google.com", false, "_blank"));
$leftMenu->addItem(new LinkMenuItem("JavaScript Alert", "#", false, null, "onclick='alert(\"testing\")'", "style='text-decoration:none' "));
// add the menus to their respective layouts
$topMenuLayout->setComponent(0, $topMenu);
$leftMenuLayout->setComponent(0, $leftMenu);
// create a new SingleContentLayout to fill the space in the LefMenuLayout
$contentLayout = new SingleContentLayout();
//$contentLayout->setComponent(0,new Content("This theme is called: ".$theme->getName().", description: ".$theme->getDescription()));
$content = "<b>The contents of this file:</b><br/>";
$content .= highlight_string(implode("", file(__FILE__)), true);
$content .= "<br/><br/>";
$content .= "<b>The contens of TestTheme's template file (is uses a template):</b><br/>";
$content .= highlight_string(implode("", file(HARMONI . "themeHandler/TestTheme.tpl")), true);
$contentLayout->setComponent(0, new Content($content));
示例#12
0
 function getMenu()
 {
     $menu = new Menu($this->getName());
     $menu->addItem(new Menu_Item("?modus=tribe_history", "history"));
     return $menu->getMenu();
 }
示例#13
0
 function getMenu()
 {
     $menu = new Menu($this->getName());
     $menu->addItem(new Menu_Item("?modus=statistics_show", "show"));
     return $menu->getMenu();
 }
示例#14
0
<?php

$menu = new Menu();
$myDB = new DBFactory();
$sql = $myDB->getMysqlConnexionWithPDO();
$query = $sql->prepare("SELECT * FROM admin_menu WHERE lang = :lang ORDER BY id ASC");
$query->execute(array(':lang' => 'FR'));
$results = $query->fetchAll();
foreach ($results as $result) {
    if ($result['parent'] > 0) {
        $nav[$result['id']] = $nav[$result['parent']]->addItem($result['caption'], $result['link'], $result['title'], "", "");
        if ($nav[$result['parent']]->getLevel() > 1) {
            $nav[$result['parent']]->setClass("parent");
        }
    } else {
        $nav[$result['id']] = $menu->addItem($result['caption'], $result['link'], $result['title'], "", "");
    }
}
$template = $menu->getHtml();
示例#15
0
 function getMenu()
 {
     $menu = new Menu($this->getName());
     $menu->addItem(new Menu_Item("?modus=questionnaire_create", "create"));
     $menu->addItem(new Menu_Item("?modus=questionnaire_report", "report"));
     $menu->addItem(new Menu_Item("?modus=questionnaire_snails", "snails"));
     return $menu->getMenu();
 }