Exemplo n.º 1
0
 /**
  * get edit menu
  */
 function getEditMenu()
 {
     if (!$this->record || $this->record->isOld()) {
         return null;
     }
     // edit menu
     $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-note');
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit note'), '#', 'menu-note-edit');
         $submenu->addOnclick('return edit_note(\'' . $this->record->getXref() . '\');');
         $menu->addSubmenu($submenu);
     }
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-note-del');
         $submenu->addOnclick("return delete_note('" . WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . "', '" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // add to favorites
     if (array_key_exists('user_favorites', WT_Module::getActiveModules())) {
         $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-note-addfav');
         $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})");
         $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;
 }
Exemplo n.º 2
0
 /**
  * get edit menu
  */
 function getEditMenu()
 {
     $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD');
     if (!$this->record || $this->record->isOld()) {
         return null;
     }
     // edit menu
     $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-obje');
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit media object'), '#', 'menu-obje-edit');
         $submenu->addOnclick("window.open('addmedia.php?action=editmedia&pid={$this->record->getXref()}', '_blank', edit_window_specs)");
         $menu->addSubmenu($submenu);
         // main link displayed on page
         if (array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) {
             $submenu = new WT_Menu(WT_I18N::translate('Manage links'), '#', 'menu-obje-link');
             $submenu->addOnclick("return ilinkitem('" . $this->record->getXref() . "','manage');");
         } else {
             $submenu = new WT_Menu(WT_I18N::translate('Set link'), '#', 'menu-obje-link');
             $ssubmenu = new WT_Menu(WT_I18N::translate('To individual'), '#', 'menu-obje-link-indi');
             $ssubmenu->addOnclick("return ilinkitem('" . $this->record->getXref() . "','person');");
             $submenu->addSubMenu($ssubmenu);
             $ssubmenu = new WT_Menu(WT_I18N::translate('To family'), '#', 'menu-obje-link-fam');
             $ssubmenu->addOnclick("return ilinkitem('" . $this->record->getXref() . "','family');");
             $submenu->addSubMenu($ssubmenu);
             $ssubmenu = new WT_Menu(WT_I18N::translate('To source'), '#', 'menu-obje-link-sour');
             $ssubmenu->addOnclick("return ilinkitem('" . $this->record->getXref() . "','source');");
             $submenu->addSubMenu($ssubmenu);
         }
         $menu->addSubmenu($submenu);
     }
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-obje-del');
         $submenu->addOnclick("return delete_media('" . WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . "', '" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // edit raw
     if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-obje-editraw');
         $submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // add to favorites
     if (array_key_exists('user_favorites', WT_Module::getActiveModules())) {
         $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-obje-addfav');
         $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})");
         $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;
 }
Exemplo n.º 3
0
 /**
  * get edit menu
  */
 function getEditMenu()
 {
     $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD');
     if (!$this->record || $this->record->isOld()) {
         return null;
     }
     // edit menu
     $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-repo');
     if (WT_USER_CAN_EDIT) {
         $fact = $this->record->getFirstFact('NAME');
         $submenu = new WT_Menu(WT_I18N::translate('Edit repository'), '#', 'menu-repo-edit');
         if ($fact) {
             // Edit existing name
             $submenu->addOnclick('return edit_record(\'' . $this->record->getXref() . '\', \'' . $fact->getFactId() . '\');');
         } else {
             // Add new name
             $submenu->addOnclick('return add_fact(\'' . $this->record->getXref() . '\', \'NAME\');');
         }
         $menu->addSubmenu($submenu);
     }
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-repo-del');
         $submenu->addOnclick("return delete_repository('" . WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . "', '" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // edit raw
     if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-repo-editraw');
         $submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // add to favorites
     if (array_key_exists('user_favorites', WT_Module::getActiveModules())) {
         $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-repo-addfav');
         $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})");
         $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;
 }
Exemplo n.º 4
0
 /**
  * get edit menu
  */
 function getEditMenu()
 {
     $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD');
     if (!$this->record || $this->record->isOld()) {
         return null;
     }
     // edit menu
     $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-note');
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit note'), '#', 'menu-note-edit');
         $submenu->addOnclick('return edit_note(\'' . $this->record->getXref() . '\');');
         $menu->addSubmenu($submenu);
     }
     // edit raw
     /* Does not currently work - NOTE records do not contain nice level 1 facts
     		if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
     			$submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-note-editraw');
     			$submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
     			$menu->addSubmenu($submenu);
     		}
     		 */
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-note-del');
         $submenu->addOnclick("return delete_note('" . WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . "', '" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // add to favorites
     if (array_key_exists('user_favorites', WT_Module::getActiveModules())) {
         $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-note-addfav');
         $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})");
         $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;
 }
Exemplo n.º 5
0
 /**
  * get edit menu
  */
 function getEditMenu()
 {
     $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD');
     if (!$this->record || $this->record->isOld()) {
         return null;
     }
     // edit menu
     $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-fam');
     $menu->addLabel($menu->label, 'down');
     if (WT_USER_CAN_EDIT) {
         // edit_fam / members
         $submenu = new WT_Menu(WT_I18N::translate('Change family members'), '#', 'menu-fam-change');
         $submenu->addOnclick("return change_family_members('" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
         // edit_fam / add child
         $submenu = new WT_Menu(WT_I18N::translate('Add a child to this family'), '#', 'menu-fam-addchil');
         $submenu->addOnclick("return add_child_to_family('" . $this->record->getXref() . "', 'U');");
         $menu->addSubmenu($submenu);
         // edit_fam / reorder_children
         if ($this->record->getNumberOfChildren() > 1) {
             $submenu = new WT_Menu(WT_I18N::translate('Re-order children'), '#', 'menu-fam-orderchil');
             $submenu->addOnclick("return reorder_children('" . $this->record->getXref() . "');");
             $menu->addSubmenu($submenu);
         }
     }
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-fam-del');
         $submenu->addOnclick("return delete_family('" . WT_I18N::translate('Deleting the family will unlink all of the individuals from each other but will leave the individuals in place.  Are you sure you want to delete this family?') . "', '" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // edit raw
     if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-fam-editraw');
         $submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // add to favorites
     if (array_key_exists('user_favorites', WT_Module::getActiveModules())) {
         $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-fam-addfav');
         $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})");
         $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;
 }
Exemplo n.º 6
0
 /**
  * get edit menu
  */
 function getEditMenu()
 {
     $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD');
     if (!$this->record || $this->record->isOld()) {
         return null;
     }
     // edit menu
     $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-indi');
     $menu->addLabel($menu->label, 'down');
     // What behaviour shall we give the main menu?  If we leave it blank, the framework
     // will copy the first submenu - which may be edit-raw or delete.
     // As a temporary solution, make it edit the name
     $menu->addOnclick("return false;");
     if (WT_USER_CAN_EDIT) {
         foreach ($this->record->getFacts() as $fact) {
             if ($fact->getTag() == 'NAME' && $fact->canEdit()) {
                 $menu->addOnclick("return edit_name('" . $this->record->getXref() . "', '" . $fact->getFactId() . "');");
             }
             break;
         }
         $submenu = new WT_Menu(WT_I18N::translate('Add a new name'), '#', 'menu-indi-addname');
         $submenu->addOnclick("return add_name('" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
         $has_sex_record = false;
         $submenu = new WT_Menu(WT_I18N::translate('Edit gender'), '#', 'menu-indi-editsex');
         foreach ($this->record->getFacts() as $fact) {
             if ($fact->getTag() == 'SEX' && $fact->canEdit()) {
                 $submenu->addOnclick("return edit_record('" . $this->record->getXref() . "', '" . $fact->getFactId() . "');");
                 $has_sex_record = true;
                 break;
             }
         }
         if (!$has_sex_record) {
             $submenu->addOnclick("return add_new_record('" . $this->record->getXref() . "', 'SEX');");
         }
         $menu->addSubmenu($submenu);
         if (count($this->record->getSpouseFamilies()) > 1) {
             $submenu = new WT_Menu(WT_I18N::translate('Re-order families'), '#', 'menu-indi-orderfam');
             $submenu->addOnclick("return reorder_families('" . $this->record->getXref() . "');");
             $menu->addSubmenu($submenu);
         }
     }
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-indi-del');
         $submenu->addOnclick("return delete_individual('" . WT_I18N::translate('Are you sure you want to delete “%s”?', WT_Filter::escapeJs(strip_tags($this->record->getFullName()))) . "', '" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // edit raw
     if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-indi-editraw');
         $submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // add to favorites
     if (array_key_exists('user_favorites', WT_Module::getActiveModules())) {
         $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-indi-addfav');
         $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})");
         $menu->addSubmenu($submenu);
     }
     return $menu;
 }
Exemplo n.º 7
0
 public function getMenu()
 {
     global $SEARCH_SPIDER, $controller;
     if ($SEARCH_SPIDER) {
         return null;
     }
     //-- main clippings menu item
     $menu = new WT_Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . WT_GEDURL, 'menu-clippings');
     if (isset($controller->record)) {
         $submenu = new WT_Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . WT_GEDURL, 'menu-clippingscart');
         $menu->addSubmenu($submenu);
     }
     if (!empty($controller->record) && $controller->record->canShow()) {
         $submenu = new WT_Menu(WT_I18N::translate('Add to clippings cart'), 'module.php?mod=clippings&mod_action=index&action=add&id=' . $controller->record->getXref(), 'menu-clippingsadd');
         $menu->addSubmenu($submenu);
     }
     return $menu;
 }
Exemplo n.º 8
0
        $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
        $givn = rtrim($nam[0]['givn'], '*');
        $surn = $nam[0]['surname'];
        $chfulmn = null;
        $chnam = $child->getAllNames();
        for ($i = 0; $i < count($nam); $i++) {
            if ($chnam[$i]['type'] == '_MARNM') {
                $chfulmn = rtrim($chnam[$i]['givn'], '*') . "&nbsp;" . $chnam[$i]['surname'];
            }
        }
        $label = get_close_relationship_name($person, $child);
        $menu = new WT_Menu($label);
        $slabel = print_pedigree_person_nav2($child->getXref(), $label, $censyear);
        $slabel .= $spouselinks;
        $submenu = new WT_Menu($slabel);
        $menu->addSubmenu($submenu);
        ?>
							<tr>
								<td align="left" class="linkcell optionbox">
									<?php 
        echo $menu->getMenu();
        ?>
								</td>
								<td align="left" class="facts_value">
									<?php 
        echo "<a href=\"edit_interface.php?action=addnewnote_assisted&amp;noteid=newnote&amp;xref=" . $child->getXref() . "&amp;gedcom=" . WT_GEDURL . "\">";
        echo $headImg2;
        echo "</a>";
        ?>
								</td>
								<td align="left" class="facts_value nowrap">
Exemplo n.º 9
0
 public static function getSearchMenu()
 {
     global $SEARCH_SPIDER;
     if ($SEARCH_SPIDER) {
         return null;
     }
     //-- main search menu item
     $menu = new WT_Menu(WT_I18N::translate('Search'), 'search.php?ged=' . WT_GEDURL, 'menu-search');
     //-- search_general sub menu
     $submenu = new WT_Menu(WT_I18N::translate('General search'), 'search.php?ged=' . WT_GEDURL, 'menu-search-general');
     $menu->addSubmenu($submenu);
     //-- search_soundex sub menu
     $submenu = new WT_Menu(WT_I18N::translate('Phonetic search'), 'search.php?ged=' . WT_GEDURL . '&amp;action=soundex', 'menu-search-soundex');
     $menu->addSubmenu($submenu);
     //-- advanced search
     $submenu = new WT_Menu(WT_I18N::translate('Advanced search'), 'search_advanced.php?ged=' . WT_GEDURL, 'menu-search-advanced');
     $menu->addSubmenu($submenu);
     //-- search_replace sub menu
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Search and replace'), 'search.php?ged=' . WT_GEDURL . '&amp;action=replace', 'menu-search-replace');
         $menu->addSubmenu($submenu);
     }
     return $menu;
 }