示例#1
0
 /**
  * get edit menut
  * @return Menu
  */
 function &getEditMenu()
 {
     global $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $pgv_lang, $pgv_changes;
     global $SHOW_GEDCOM_RECORD;
     if ($TEXT_DIRECTION == "rtl") {
         $ff = "_rtl";
     } else {
         $ff = "";
     }
     if (!$this->userCanEdit()) {
         $tempvar = false;
         return $tempvar;
     }
     // edit shared note menu
     $menu = new Menu($pgv_lang['edit_shared_note']);
     if ($SHOW_GEDCOM_RECORD || PGV_USER_IS_ADMIN) {
         $menu->addOnclick('return edit_note(\'' . $this->nid . '\');');
     }
     if (!empty($PGV_IMAGES["notes"]["small"])) {
         $menu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['notes']['small']}");
     }
     $menu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}");
     // edit shared note / edit_raw
     if ($SHOW_GEDCOM_RECORD || PGV_USER_IS_ADMIN) {
         $submenu = new Menu($pgv_lang['edit_raw']);
         $submenu->addOnclick("return edit_raw('" . $this->nid . "');");
         if (!empty($PGV_IMAGES["notes"]["small"])) {
             $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['notes']['small']}");
         }
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     // edit shared note / delete_shared note
     $submenu = new Menu($pgv_lang['delete_shared_note']);
     $submenu->addOnclick("if (confirm('" . $pgv_lang["confirm_delete_shared_note"] . "')) return deletenote('" . $this->nid . "'); else return false;");
     if (!empty($PGV_IMAGES["notes"]["small"])) {
         $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['notes']['small']}");
     }
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
     $menu->addSubmenu($submenu);
     if (isset($pgv_changes[$this->nid . '_' . $GEDCOM])) {
         // edit_note / separator
         $submenu = new Menu();
         $submenu->isSeparator();
         $menu->addSubmenu($submenu);
         // edit_note / show/hide changes
         if (!$this->show_changes) {
             $submenu = new Menu($pgv_lang['show_changes'], encode_url("note.php?nid={$this->nid}&show_changes=yes"));
             if (!empty($PGV_IMAGES["notes"]["small"])) {
                 $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['notes']['small']}");
             }
             $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
             $menu->addSubmenu($submenu);
         } else {
             $submenu = new Menu($pgv_lang['hide_changes'], encode_url("note.php?nid={$this->nid}&show_changes=no"));
             if (!empty($PGV_IMAGES["notes"]["small"])) {
                 $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['notes']['small']}");
             }
             $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
             $menu->addSubmenu($submenu);
         }
         if (PGV_USER_CAN_ACCEPT) {
             // edit_shared note / accept_all
             $submenu = new Menu($pgv_lang["undo_all"], encode_url("note.php?nid={$this->nid}&action=undo"));
             $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
             if (!empty($PGV_IMAGES["notes"]["small"])) {
                 $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['notes']['small']}");
             }
             $menu->addSubmenu($submenu);
             $submenu = new Menu($pgv_lang['accept_all'], encode_url("note.php?nid={$this->nid}&action=accept"));
             if (!empty($PGV_IMAGES["notes"]["small"])) {
                 $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['notes']['small']}");
             }
             $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
             $menu->addSubmenu($submenu);
         }
     }
     return $menu;
 }
示例#2
0
 /**
  * get the family page edit menu
  */
 function &getEditMenu()
 {
     global $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $pgv_lang, $pgv_changes;
     global $SHOW_GEDCOM_RECORD;
     if ($TEXT_DIRECTION == "rtl") {
         $ff = "_rtl";
     } else {
         $ff = "";
     }
     // edit_fam menu
     $menu = new Menu($pgv_lang['edit_fam']);
     $menu->addOnclick("return edit_family('" . $this->getFamilyID() . "');");
     if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
         $menu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
     }
     $menu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}");
     // edit_fam / edit_fam
     $submenu = new Menu($pgv_lang['edit_fam']);
     $submenu->addOnclick("return edit_family('" . $this->getFamilyID() . "');");
     if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
         $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
     }
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
     $menu->addSubmenu($submenu);
     // edit_fam / members
     $submenu = new Menu($pgv_lang['change_family_members']);
     $submenu->addOnclick("return change_family_members('" . $this->getFamilyID() . "');");
     if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
         $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
     }
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
     $menu->addSubmenu($submenu);
     // edit_fam / add child
     $submenu = new Menu($pgv_lang['add_child_to_family']);
     $submenu->addOnclick("return addnewchild('" . $this->getFamilyID() . "');");
     if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
         $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
     }
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
     $menu->addSubmenu($submenu);
     // edit_fam / reorder_children
     if ($this->family->getNumberOfChildren() > 1) {
         $submenu = new Menu($pgv_lang['reorder_children']);
         $submenu->addOnclick("return reorder_children('" . $this->getFamilyID() . "');");
         if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
             $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
         }
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     if (isset($pgv_changes[$this->getFamilyID() . '_' . $GEDCOM])) {
         // edit_fam / separator
         $menu->addSeparator();
         // edit_fam / show/hide changes
         if (!$this->show_changes) {
             $submenu = new Menu($pgv_lang['show_changes'], encode_url('family.php?famid=' . $this->getFamilyID() . '&show_changes=yes'));
             if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
                 $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
             }
             $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
             $menu->addSubmenu($submenu);
         } else {
             $submenu = new Menu($pgv_lang['hide_changes'], encode_url('family.php?famid=' . $this->getFamilyID() . '&show_changes=no'));
             if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
                 $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
             }
             $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
             $menu->addSubmenu($submenu);
         }
         if (PGV_USER_CAN_ACCEPT) {
             // edit_fam / accept_all
             $submenu = new Menu($pgv_lang["undo_all"], encode_url("family.php?famid={$this->famid}&action=undo"));
             if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
                 $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
             }
             $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
             $menu->addSubmenu($submenu);
             $submenu = new Menu($pgv_lang["accept_all"], encode_url("family.php?famid={$this->famid}&action=accept"));
             if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
                 $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
             }
             $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
             $menu->addSubmenu($submenu);
         }
     }
     // edit_fam / separator
     $menu->addSeparator();
     // edit_fam / edit_raw
     if ($SHOW_GEDCOM_RECORD || PGV_USER_IS_ADMIN) {
         $submenu = new Menu($pgv_lang['edit_raw']);
         $submenu->addOnclick("return edit_raw('" . $this->getFamilyID() . "');");
         if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
             $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
         }
         $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
         $menu->addSubmenu($submenu);
     }
     // edit_fam / delete_family
     $submenu = new Menu($pgv_lang['delete_family']);
     $submenu->addOnclick("if (confirm('" . $pgv_lang["delete_family_confirm"] . "')) return delete_family('" . $this->getFamilyID() . "'); else return false;");
     if (!empty($PGV_IMAGES["edit_fam"]["small"])) {
         $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['edit_fam']['small']}");
     }
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}");
     $menu->addSubmenu($submenu);
     //-- get the link for the first submenu and set it as the link for the main menu
     if (isset($menu->submenus[0])) {
         $link = $menu->submenus[0]->onclick;
         $menu->addOnclick($link);
     }
     return $menu;
 }
示例#3
0
 /**
  * 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;
 }
示例#4
0
 /**
  * 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) . "&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) . "&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 . "&show_context_help=no"));
     } else {
         $submenu = new Menu($pgv_lang["show_context_help"], "{$SCRIPT_NAME}" . normalize_query_string($QUERY_STRING . "&show_context_help=yes"));
     }
     $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_menu_help");
     $menu->addSubmenu($submenu);
     return $menu;
 }