i18n::translate('GEDCOM Favorites'), 'type'=>'both', 'descr'=>i18n::translate('The GEDCOM Favorites block gives the administrator the ability to designate individuals from the database so that their information is easily accessible to all. This is a way to highlight people who are important in your family history.'), 'canconfig'=>false, 'config'=>array( 'cache'=>7 ) ); //-- print gedcom favorites function print_gedcom_favorites($block = true, $config="", $side, $index) { global $WT_IMAGE_DIR, $WT_IMAGES, $ctype, $TEXT_DIRECTION; global $show_full, $PEDIGREE_FULL_DETAILS, $BROWSERTYPE, $ENABLE_AUTOCOMPLETE; // Override GEDCOM configuration temporarily if (isset($show_full)) $saveShowFull = $show_full; $savePedigreeFullDetails = $PEDIGREE_FULL_DETAILS; $show_full = 1; $PEDIGREE_FULL_DETAILS = 1; $userfavs = getUserFavorites(WT_GEDCOM); if (!is_array($userfavs)) $userfavs = array(); $id = "gedcom_favorites"; $title = i18n::translate('This GEDCOM\'s Favorites').help_link('index_favorites'); if ($TEXT_DIRECTION=="rtl") $title .= getRLM(); $title .= "(".count($userfavs).")"; if ($TEXT_DIRECTION=="rtl") $title .= getRLM(); if (WT_USER_IS_ADMIN && $ENABLE_AUTOCOMPLETE) { $content = ' '; } else $content = ''; if ($block) { $style = 2; // 1 means "regular box", 2 means "wide box" $tableWidth = ($BROWSERTYPE=="msie") ? "95%" : "99%"; // IE needs to have room for vertical scroll bar inside the box $cellSpacing = "1px"; } else { $style = 2; $tableWidth = "99%"; $cellSpacing = "3px"; } if (count($userfavs)==0) { if (WT_USER_GEDCOM_ADMIN) { $content .= i18n::translate('You have not selected any favorites.

To add an individual, a family, or a source to your favorites, click on the Add a new favorite link to reveal some fields where you can enter or search for an ID number. Instead of an ID number, you can enter a URL and a title.'); } else { $content .= i18n::translate('At this moment there are no selected Favorites. The admin can add Favorites to display at startup.'); } } else { $content .= ""; foreach($userfavs as $key=>$favorite) { if (isset($favorite["id"])) $key=$favorite["id"]; $removeFavourite = "".i18n::translate('Remove')."
\n"; $content .= "\n"; } $content .= "
"; if ($favorite["type"]=="URL") { $content .= "
\n"; if ($ctype=="user" || WT_USER_GEDCOM_ADMIN) $content .= $removeFavourite; $content .= "".PrintReady($favorite["title"]).""; $content .= "
".PrintReady($favorite["note"]); $content .= "
\n"; } else { if (displayDetailsById($favorite["gid"], $favorite["type"])) { if ($favorite["type"]=="INDI") { $indirec = find_person_record($favorite["gid"], WT_GED_ID); $content .= "
\n"; if ($ctype=="user" || WT_USER_GEDCOM_ADMIN) $content .= $removeFavourite; ob_start(); print_pedigree_person($favorite["gid"], $style, 1, $key); $content .= ob_get_clean(); $content .= PrintReady($favorite["note"]); $content .= "
\n"; } else { $record=GedcomRecord::getInstance($favorite['gid']); $content .= "
"; if ($ctype=="user" || WT_USER_GEDCOM_ADMIN) $content .= $removeFavourite; if ($record) { $content.=$record->format_list('span'); } else { $content.=i18n::translate('No such ID exists in this GEDCOM file.'); } $content .= "
".PrintReady($favorite["note"]); $content .= "
"; } } } $content .= "
\n"; } if (WT_USER_GEDCOM_ADMIN) { $content .= '
'; $uniqueID = floor(microtime() * 1000000); $content .= "\"\" ".i18n::translate('Add a new favorite').""; $content .= help_link('index_add_favorites'); $content .= "
\n"; $content .= "
\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= ""; $content .= "
".i18n::translate('Enter a Person, Family, or Source ID')."
"; $content .= ""; $content .= print_findindi_link("gid{$uniqueID}",'',true)."\n"; $content .= print_findfamily_link("gid{$uniqueID}",'',true)."\n"; $content .= print_findsource_link("gid{$uniqueID}",'',true)."\n"; $content .= print_findrepository_link("gid{$uniqueID}",'',true)."\n"; $content .= print_findnote_link("gid{$uniqueID}",'',true)."\n"; $content .= print_findmedia_link("gid{$uniqueID}",'1','',true)."\n"; $content .= "\n
".i18n::translate('OR
Enter a URL and a title'); $content .= "\n"; $content .= "\n
".i18n::translate('URL')."
".i18n::translate('Title:')."
"; if ($block) $content .= "\n

"; else $content .= "\n
"; $content .= "\n".i18n::translate('Enter an optional note about this favorite'); $content .= "\n
"; $content .= "
\n"; $content .= "\n
"; $content .= "\n
\n"; } global $THEME_DIR; if ($block) { require $THEME_DIR.'templates/block_small_temp.php'; } else { require $THEME_DIR.'templates/block_main_temp.php'; } // Restore GEDCOM configuration unset($show_full); if (isset($saveShowFull)) $show_full = $saveShowFull; $PEDIGREE_FULL_DETAILS = $savePedigreeFullDetails; } ?>