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 .= "
| ";
if ($favorite["type"]=="URL") {
$content .= " \n";
if ($ctype=="user" || WT_USER_GEDCOM_ADMIN) $content .= $removeFavourite;
$content .= "".PrintReady($favorite["title"])."";
$content .= " \n";
} else {
if (displayDetailsById($favorite["gid"], $favorite["type"])) {
if ($favorite["type"]=="INDI") {
$indirec = find_person_record($favorite["gid"], WT_GED_ID);
$content .= "".PrintReady($favorite["note"]); $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 .= " ";
}
}
}
$content .= "".PrintReady($favorite["note"]); $content .= " |