当前位置: 首页>>代码示例>>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;未经允许,请勿转载。