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


PHP Menu::addSubmenu方法代码示例

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


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

示例1: Menu

 /**
  * get the other menu
  * @return Menu
  */
 function &getOtherMenu()
 {
     global $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $pgv_lang;
     global $SHOW_GEDCOM_RECORD, $ENABLE_CLIPPINGS_CART;
     if ($TEXT_DIRECTION == "rtl") {
         $ff = "_rtl";
     } else {
         $ff = "";
     }
     if (!$this->note->canDisplayDetails() || !$SHOW_GEDCOM_RECORD && $ENABLE_CLIPPINGS_CART < PGV_USER_ACCESS_LEVEL) {
         $tempvar = false;
         return $tempvar;
     }
     // other menu
     $menu = new Menu($pgv_lang['other']);
     $menu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}");
     if ($SHOW_GEDCOM_RECORD) {
         $menu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['gedcom']['small']}");
         if ($this->show_changes && $this->userCanEdit()) {
             $menu->addLink("javascript:show_gedcom_record('new');");
         } else {
             $menu->addLink("javascript:show_gedcom_record();");
         }
     } else {
         if (!empty($PGV_IMAGES["clippings"]["small"])) {
             $menu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['clippings']['small']}");
         }
         $menu->addLink(encode_url("clippings.php?action=add&id={$this->nid}&type=note"));
     }
     if ($SHOW_GEDCOM_RECORD) {
         // other / view_gedcom
         $submenu = new Menu($pgv_lang['view_gedcom']);
         if ($this->show_changes && $this->userCanEdit()) {
             $submenu->addLink("javascript:show_gedcom_record('new');");
         } else {
             $submenu->addLink("javascript:show_gedcom_record();");
         }
         $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['gedcom']['small']}");
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     if ($ENABLE_CLIPPINGS_CART >= PGV_USER_ACCESS_LEVEL) {
         // other / add_to_cart
         $submenu = new Menu($pgv_lang['add_to_cart'], encode_url("clippings.php?action=add&id={$this->nid}&type=note"));
         if (!empty($PGV_IMAGES["clippings"]["small"])) {
             $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['clippings']['small']}");
         }
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     if ($this->note->canDisplayDetails() && !empty($this->uname)) {
         // other / add_to_my_favorites
         $submenu = new Menu($pgv_lang['add_to_my_favorites'], encode_url("note.php?action=addfav&nid={$this->nid}&gid={$this->nid}"));
         $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['gedcom']['small']}");
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     return $menu;
 }
开发者ID:bitweaver,项目名称:phpgedview,代码行数:63,代码来源:note_ctrl.php

示例2: Menu

 /**
  * get the "other" menu
  * @return Menu
  */
 function &getOtherMenu()
 {
     global $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $THEME_DIR;
     global $SHOW_GEDCOM_RECORD, $ENABLE_CLIPPINGS_CART, $pgv_lang;
     if ($TEXT_DIRECTION == "rtl") {
         $ff = "_rtl";
     } else {
         $ff = "";
     }
     //-- main other menu item
     $menu = new Menu($pgv_lang["other"]);
     if ($SHOW_GEDCOM_RECORD) {
         if (!empty($PGV_IMAGES["gedcom"]["small"])) {
             $menu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["gedcom"]["small"]);
         }
         if ($this->show_changes && PGV_USER_CAN_EDIT) {
             $menu->addOnclick("return show_gedcom_record('new');");
         } else {
             $menu->addOnclick("return show_gedcom_record('');");
         }
     } else {
         if (!empty($PGV_IMAGES["clippings"]["small"])) {
             $menu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["clippings"]["small"]);
         }
         $menu->addLink(encode_url("clippings.php?action=add&id={$this->pid}&type=indi"));
     }
     $menu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}");
     if ($SHOW_GEDCOM_RECORD) {
         $submenu = new Menu($pgv_lang["view_gedcom"]);
         if (!empty($PGV_IMAGES["gedcom"]["small"])) {
             $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["gedcom"]["small"]);
         }
         if ($this->show_changes && PGV_USER_CAN_EDIT) {
             $submenu->addOnclick("return show_gedcom_record('new');");
         } else {
             $submenu->addOnclick("return show_gedcom_record();");
         }
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     if ($this->indi->canDisplayDetails() && $ENABLE_CLIPPINGS_CART >= PGV_USER_ACCESS_LEVEL) {
         $submenu = new Menu($pgv_lang["add_to_cart"], encode_url("clippings.php?action=add&id={$this->pid}&type=indi"));
         if (!empty($PGV_IMAGES["clippings"]["small"])) {
             $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["clippings"]["small"]);
         }
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     if ($this->indi->canDisplayDetails() && PGV_USER_NAME) {
         $submenu = new Menu($pgv_lang["add_to_my_favorites"], encode_url($this->indi->getLinkUrl() . "&action=addfav&gid={$this->pid}"));
         if (!empty($PGV_IMAGES["gedcom"]["small"])) {
             $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["gedcom"]["small"]);
         }
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     return $menu;
 }
开发者ID:bitweaver,项目名称:phpgedview,代码行数:62,代码来源:individual_ctrl.php

示例3: Menu

 /**
  * get the other menu
  * @return Menu
  */
 function &getOtherMenu()
 {
     global $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $pgv_lang;
     global $SHOW_GEDCOM_RECORD, $ENABLE_CLIPPINGS_CART;
     if ($TEXT_DIRECTION == "rtl") {
         $ff = "_rtl";
     } else {
         $ff = "";
     }
     // other menu
     $menu = new Menu($pgv_lang['other']);
     $menu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}");
     if ($SHOW_GEDCOM_RECORD) {
         $menu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['gedcom']['small']}");
         if ($this->show_changes && PGV_USER_CAN_EDIT) {
             $menu->addLink("javascript:show_gedcom_record('new');");
         } else {
             $menu->addLink("javascript:show_gedcom_record();");
         }
     } else {
         if (!empty($PGV_IMAGES["clippings"]["small"])) {
             $menu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['clippings']['small']}");
         }
         $menu->addLink(encode_url('clippings.php?action=add&id=' . $this->getFamilyID() . '&type=fam'));
     }
     if ($SHOW_GEDCOM_RECORD) {
         // other / view_gedcom
         $submenu = new Menu($pgv_lang['view_gedcom']);
         if ($this->show_changes && PGV_USER_CAN_EDIT) {
             $submenu->addLink("javascript:show_gedcom_record('new');");
         } else {
             $submenu->addLink("javascript:show_gedcom_record();");
         }
         $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['gedcom']['small']}");
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     if ($ENABLE_CLIPPINGS_CART >= PGV_USER_ACCESS_LEVEL) {
         // other / add_to_cart
         $submenu = new Menu($pgv_lang['add_to_cart'], encode_url('clippings.php?action=add&id=' . $this->getFamilyID() . '&type=fam'));
         if (!empty($PGV_IMAGES["clippings"]["small"])) {
             $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['clippings']['small']}");
         }
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     if ($this->display && PGV_USER_ID) {
         // other / add_to_my_favorites
         $submenu = new Menu($pgv_lang['add_to_my_favorites'], encode_url('family.php?action=addfav&famid=' . $this->getFamilyID() . '&gid=' . $this->getFamilyID()));
         $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['gedcom']['small']}");
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     return $menu;
 }
开发者ID:bitweaver,项目名称:phpgedview,代码行数:59,代码来源:family_ctrl.php

示例4: header

 *		with a backslash or enclose the entire URL in apostrophes instead of quotation marks.
 */
if (!defined('PGV_PHPGEDVIEW')) {
    header('HTTP/1.0 403 Forbidden');
    exit;
}
//-- main Optional menu item
$menu = new Menu("Optional Menu name", "custom link #1", "down");
if (!empty($PGV_IMAGES["gedcom"]["large"])) {
    $menu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["gedcom"]["large"]);
}
$menu->addClass("menuitem{$ff}", "menuitem_hover{$ff}", "submenu{$ff}");
// First sub-menu (visible even when Search robots are looking at the site)
$submenu = new Menu("Custom Menu Item 1", "custom link #1");
$submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
$menu->addSubmenu($submenu);
// Second sub-menu (invisible to Search robots)
if (empty($SEARCH_SPIDER)) {
    $submenu = new Menu("Custom Menu Item 2", "custom link #2");
    $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
    $menu->addSubmenu($submenu);
}
// Third sub-menu (visible only to users with site Admin rights)
if (PGV_USER_IS_ADMIN) {
    $submenu = new Menu("Custom Menu Item 3", "custom link #2");
    $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
    $menu->addSubmenu($submenu);
}
// Fourth sub-menu (visible only to users with GEDCOM Admin rights)
if (PGV_USER_GEDCOM_ADMIN) {
    $submenu = new Menu("Custom Menu Item 4", "custom link #2");
开发者ID:bitweaver,项目名称:phpgedview,代码行数:31,代码来源:sample_optional_menu.php

示例5: convertMenu

 /**
  * convert an old array style menu to an object
  * @static
  */
 static function convertMenu($menu)
 {
     $conv = array('label' => 'label', 'labelpos' => 'labelpos', 'icon' => 'icon', 'hovericon' => 'hovericon', 'link' => 'link', 'accesskey' => 'accesskey', 'class' => 'class', 'hoverclass' => 'hoverclass', 'flyout' => 'flyout', 'submenuclass' => 'submenuclass', 'onclick' => 'onclick');
     $obj = new Menu();
     if ($menu == 'separator') {
         $obj->isSeparator();
         $obj->printMenu();
         return;
     }
     $items = false;
     foreach ($menu as $k => $v) {
         if ($k == 'items' && is_array($v) && count($v) > 0) {
             $items = $v;
         } else {
             if (isset($conv[$k])) {
                 if ($v != '') {
                     $obj->{$conv}[$k] = $v;
                 }
             }
         }
     }
     if ($items !== false) {
         foreach ($items as $sub) {
             $sobj = new Menu();
             if ($sub == 'separator') {
                 $sobj->isSeparator();
                 $obj->addSubmenu($sobj);
                 continue;
             }
             foreach ($sub as $k2 => $v2) {
                 if (isset($conv[$k2])) {
                     if ($v2 != '') {
                         $sobj->{$conv}[$k2] = $v2;
                     }
                 }
             }
             $obj->addSubmenu($sobj);
         }
     }
     return $obj;
 }
开发者ID:bitweaver,项目名称:phpgedview,代码行数:45,代码来源:class_menu.php

示例6: Menu

 /**
  * get the help menu
  * @return Menu the menu item
  */
 static function &getHelpMenu()
 {
     global $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $pgv_lang, $SEARCH_SPIDER;
     global $SHOW_CONTEXT_HELP, $SCRIPT_NAME, $QUERY_STRING, $helpindex, $action;
     if ($TEXT_DIRECTION == "rtl") {
         $ff = "_rtl";
     } else {
         $ff = "";
     }
     if (!empty($SEARCH_SPIDER)) {
         $menu = new Menu("", "", "");
         //			$menu->print_menu = null;
         return $menu;
     }
     //-- main help menu item
     $menu = new Menu($pgv_lang["page_help"], "#", "down");
     if (!empty($PGV_IMAGES["help"]["large"])) {
         $menu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["help"]["large"]);
     }
     if (empty($helpindex)) {
         $menu->addOnclick("return helpPopup('help_" . basename($SCRIPT_NAME) . "&amp;action=" . $action . "');");
     } else {
         $menu->addOnclick("return helpPopup('" . $helpindex . "');");
     }
     $menu->addClass("menuitem{$ff}", "menuitem_hover{$ff}", "submenu{$ff}", "icon_large_help");
     //-- help_for_this_page sub menu
     $submenu = new Menu($pgv_lang["help_for_this_page"], "#");
     if (!empty($PGV_IMAGES["menu_help"]["small"])) {
         $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["menu_help"]["small"]);
     }
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_menu_help");
     if (empty($helpindex)) {
         $submenu->addOnclick("return helpPopup('help_" . basename($SCRIPT_NAME) . "&amp;action=" . $action . "');");
     } else {
         $submenu->addOnclick("return helpPopup('" . $helpindex . "');");
     }
     $menu->addSubmenu($submenu);
     //-- help_contents sub menu
     $submenu = new Menu($pgv_lang["help_contents"], "#");
     if (!empty($PGV_IMAGES["menu_help"]["small"])) {
         $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["menu_help"]["small"]);
     }
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_menu_help");
     $submenu->addOnclick("return helpPopup('help_contents_help');");
     $menu->addSubmenu($submenu);
     //-- faq sub menu
     if (file_exists("faq.php")) {
         $submenu = new Menu($pgv_lang["faq_list"], "faq.php");
         if (!empty($PGV_IMAGES["menu_help"]["small"])) {
             $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["menu_help"]["small"]);
         }
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_menu_help");
         $menu->addSubmenu($submenu);
     }
     //-- searchhelp sub menu
     if (file_exists("searchhelp.php")) {
         $submenu = new Menu($pgv_lang["hs_title"], "#");
         if (!empty($PGV_IMAGES["search"]["small"])) {
             $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["search"]["small"]);
         }
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_search");
         $submenu->addOnclick("window.open('searchhelp.php', '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1');");
         $menu->addSubmenu($submenu);
     }
     //-- add wiki links
     $menu->addSeparator();
     $submenu = new Menu($pgv_lang["wiki_main_page"], PGV_PHPGEDVIEW_WIKI . '/en/index.php?title=Main_Page" target="_blank');
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_wiki");
     $menu->addSubmenu($submenu);
     $submenu = new Menu($pgv_lang["wiki_users_guide"], PGV_PHPGEDVIEW_WIKI . '/en/index.php?title=Users_Guide" target="_blank');
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_wiki");
     $menu->addSubmenu($submenu);
     if (PGV_USER_GEDCOM_ADMIN) {
         $submenu = new Menu($pgv_lang["wiki_admin_guide"], PGV_PHPGEDVIEW_WIKI . '/en/index.php?title=Administrators_Guide" target="_blank');
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_wiki");
         $menu->addSubmenu($submenu);
     }
     //-- add contact links to help menu
     $menu->addSeparator();
     $menuitems = contact_menus();
     foreach ($menuitems as $menuitem) {
         $submenu = new Menu($menuitem["label"], $menuitem["link"]);
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_contact");
         if (!empty($menuitem["onclick"])) {
             $submenu->addOnclick($menuitem["onclick"]);
         }
         $menu->addSubmenu($submenu);
     }
     //-- add show/hide context_help
     $menu->addSeparator();
     if ($_SESSION["show_context_help"]) {
         $submenu = new Menu($pgv_lang["hide_context_help"], "{$SCRIPT_NAME}" . normalize_query_string($QUERY_STRING . "&amp;show_context_help=no"));
     } else {
         $submenu = new Menu($pgv_lang["show_context_help"], "{$SCRIPT_NAME}" . normalize_query_string($QUERY_STRING . "&amp;show_context_help=yes"));
     }
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_menu_help");
//.........这里部分代码省略.........
开发者ID:bitweaver,项目名称:phpgedview,代码行数:101,代码来源:class_menubar.php


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