i18n::translate('User Favorites'),
'type'=>'user',
'descr'=>i18n::translate('The User Favorites block shows the user a list of his favorite people in the database so that he can easily link to them.'),
'canconfig'=>false,
'config'=>array(
'cache'=>0
)
);
//-- print user favorites
function print_user_favorites($block=true, $config="", $side, $index) {
global $WT_IMAGE_DIR, $WT_IMAGES, $GEDCOM, $TEXT_DIRECTION, $INDEX_DIRECTORY, $MEDIA_DIRECTORY, $MULTI_MEDIA, $MEDIA_DIRECTORY_LEVELS, $ctype;
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_USER_NAME);
if (!is_array($userfavs)) $userfavs = array();
$id="user_favorites";
$title = i18n::translate('My Favorites');
$title .= help_link('mygedview_favorites');
if ($TEXT_DIRECTION=="rtl") $title .= getRLM();
$title .= "(".count($userfavs).")";
if ($TEXT_DIRECTION=="rtl") $title .= getRLM();
if ($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) {
$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 {
$mygedcom = $GEDCOM;
$current_gedcom = $GEDCOM;
$content .= "
| ";
if ($favorite["type"]=="URL") {
$content .= " ";
if ($ctype=="user" || WT_USER_IS_ADMIN) $content .= $removeFavourite;
$content .= "".PrintReady($favorite["title"])."";
$content .= " ".PrintReady($favorite["note"]); } else { require $INDEX_DIRECTORY.$GEDCOM.'_conf.php'; $indirec = find_gedcom_record($favorite["gid"], WT_GED_ID); if ($favorite["type"]=="INDI") { $content .= " ";
if ($ctype=="user" || WT_USER_IS_ADMIN) $content .= $removeFavourite;
ob_start();
print_pedigree_person($favorite["gid"], $style, 1, $key);
$content .= ob_get_clean();
$content .= PrintReady($favorite["note"]);
} else {
$record=GedcomRecord::getInstance($favorite['gid']);
$content .= " ";
if ($ctype=="user" || WT_USER_IS_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 .= " |