當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Menu::addLink方法代碼示例

本文整理匯總了PHP中Menu::addLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP Menu::addLink方法的具體用法?PHP Menu::addLink怎麽用?PHP Menu::addLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Menu的用法示例。


在下文中一共展示了Menu::addLink方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: 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

示例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


注:本文中的Menu::addLink方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。