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


PHP Menu::addClass方法代码示例

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


在下文中一共展示了Menu::addClass方法的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

}
// Menu separator line
$menu->addSeparator();
// 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");
    $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
    $menu->addSubmenu($submenu);
}
// Fifth sub-menu (visible only Clippings Cart is enabled and not a Search robot)
if (empty($SEARCH_SPIDER) && $GLOBALS["ENABLE_CLIPPINGS_CART"]) {
    $submenu = new Menu("Custom Menu Item 5", "custom link #2");
    $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
    $menu->addSubmenu($submenu);
}
开发者ID:bitweaver,项目名称:phpgedview,代码行数:31,代码来源:sample_custom_welcome_menu.php

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

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

示例5: Menu

 static function &getFavoritesMenu()
 {
     global $REQUIRE_AUTHENTICATION, $pgv_lang, $GEDCOM, $QUERY_STRING, $SCRIPT_NAME, $PGV_IMAGE_DIR, $PGV_IMAGES, $TEXT_DIRECTION;
     global $SEARCH_SPIDER;
     global $controller;
     // Pages with a controller can be added to the favorites
     if (!empty($SEARCH_SPIDER)) {
         return false;
         // show no favorites, because they taint every page that is indexed.
     }
     if ($TEXT_DIRECTION == "rtl") {
         $ff = "_rtl";
     } else {
         $ff = "";
     }
     if (PGV_USER_ID || !$REQUIRE_AUTHENTICATION) {
         $menu = new Menu($pgv_lang['favorites'], '#', '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}", "icon_large_gedcom");
         //			$menu->print_menu = NULL;
         $userfavs = getUserFavorites(PGV_USER_ID);
         $gedfavs = getUserFavorites($GEDCOM);
         // User favorites
         if ($userfavs || PGV_USER_ID) {
             $submenu = new Menu('<strong>' . $pgv_lang['my_favorites'] . '</strong>');
             $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover');
             $menu->addSubMenu($submenu);
             while (PGV_USER_ID && isset($controller)) {
                 // Get the right $gid from each supported controller type
                 switch (get_class($controller)) {
                     case 'IndividualController':
                         $gid = $controller->pid;
                         break;
                     case 'FamilyController':
                         $gid = $controller->famid;
                         break;
                     case 'MediaController':
                         $gid = $controller->mid;
                         break;
                     case 'SourceController':
                         $gid = $controller->sid;
                         break;
                     case 'RepositoryController':
                         $gid = $controller->rid;
                         break;
                     default:
                         break 2;
                 }
                 $submenu = new Menu('<em>' . $pgv_lang['add_to_my_favorites'] . '</em>', $SCRIPT_NAME . normalize_query_string($QUERY_STRING . '&amp;action=addfav&amp;gid=' . $gid));
                 $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover');
                 $menu->addSubMenu($submenu);
                 break;
             }
             foreach ($userfavs as $fav) {
                 $OLD_GEDCOM = $GEDCOM;
                 $GEDCOM = $fav['file'];
                 switch ($fav['type']) {
                     case 'URL':
                         $submenu = new Menu(PrintReady($fav['title']), $fav['url']);
                         $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover');
                         $menu->addSubMenu($submenu);
                         break;
                     case 'INDI':
                     case 'FAM':
                     case 'SOUR':
                     case 'OBJE':
                         if (displayDetailsById($fav['gid'], $fav['type'])) {
                             $obj = GedcomRecord::getInstance($fav['gid']);
                             if ($obj) {
                                 $submenu = new Menu(PrintReady($obj->getFullName()), encode_url($obj->getLinkUrl()));
                                 $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover');
                                 $menu->addSubMenu($submenu);
                             }
                         }
                         break;
                 }
                 $GEDCOM = $OLD_GEDCOM;
             }
             if ($gedfavs) {
                 $menu->addSeparator();
             }
         }
         // Gedcom favorites
         if ($gedfavs) {
             $submenu = new Menu('<strong>' . $pgv_lang['gedcom_favorites'] . '</strong>');
             $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover');
             $menu->addSubMenu($submenu);
             foreach ($gedfavs as $fav) {
                 $OLD_GEDCOM = $GEDCOM;
                 $GEDCOM = $fav['file'];
                 switch ($fav['type']) {
                     case 'URL':
                         $submenu = new Menu(PrintReady($fav['title']), $fav['url']);
                         $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover');
                         $menu->addSubMenu($submenu);
                         break;
                     case 'INDI':
                     case 'FAM':
//.........这里部分代码省略.........
开发者ID:bitweaver,项目名称:phpgedview,代码行数:101,代码来源:class_menubar.php

示例6: PrintReady

            print "<a href=\"" . encode_url($people["wife"]->getLinkUrl() . "&amp;tab={$tabno}") . "\">";
            print PrintReady($people["wife"]->getFullName());
            print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>";
            print "</a>";
        }
        ?>
					</td>
				</tr>
				<?php 
    }
    $styleadd = "";
    if (isset($people["children"])) {
        foreach ($people["children"] as $key => $child) {
            $menu = new Menu("&nbsp;" . $child->getLabel() . "&nbsp;" . "\n");
            if ($TEXT_DIRECTION == "ltr") {
                $menu->addClass("", "", "submenu flyout");
            } else {
                $menu->addClass("", "", "submenu flyoutrtl");
            }
            $slabel = "</a>" . print_pedigree_person_nav($child->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++);
            $slabel .= PrintReady($spouselinks) . "<a>";
            $submenu = new Menu($slabel);
            $menu->addSubmenu($submenu);
            if (PrintReady($child->getDeathYear()) == 0) {
                $DeathYr = "";
            } else {
                $DeathYr = PrintReady($child->getDeathYear());
            }
            if (PrintReady($child->getBirthYear()) == 0) {
                $BirthYr = "";
            } else {
开发者ID:bitweaver,项目名称:phpgedview,代码行数:31,代码来源:family_nav.php


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