setPageTitle(WT_I18N::translate('Link media')); $controller->pageHeader(); //-- page parameters and checking $linktoid = safe_GET_xref('linktoid'); $mediaid = safe_GET_xref('mediaid'); $linkto = safe_GET ('linkto', array('person', 'source', 'family', 'manage', 'repository', 'note')); $action = safe_GET ('action', WT_REGEX_ALPHA, 'choose'); // If GedFAct_assistant/_MEDIA/ installed ====================== if (WT_USER_IS_ADMIN && $linkto=='manage' && array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) { require WT_ROOT.WT_MODULES_DIR.'GEDFact_assistant/_MEDIA/media_0_inverselink.php'; } else { if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; //-- check for admin $paramok = WT_USER_CAN_EDIT; if (!empty($linktoid)) $paramok = WT_GedcomRecord::getInstance($linktoid)->canDisplayDetails(); if ($action == "choose" && $paramok) { ?> '; echo ''; if (!empty($mediaid)) { echo ''; } if (!empty($linktoid)) { echo ''; } echo ''; echo ''; echo '
| '; echo WT_I18N::translate('Link media'), help_link('add_media_linkid'); echo ' | |||||
| ', WT_I18N::translate('Media'), ' | '; echo ''; if (!empty($mediaid)) { //-- Get the title of this existing Media item $title= WT_DB::prepare("SELECT m_titl FROM `##media` where m_media=? AND m_gedfile=?") ->execute(array($mediaid, WT_GED_ID)) ->fetchOne(); if ($title) { echo '', PrintReady($title), ''; } else { echo '', $mediaid, ''; } } else { echo ''; print_findmedia_link("mediaid", "1media"); echo " | ||||
| '; if ($linkto == "person") { echo WT_I18N::translate('Individual'), " | "; echo ''; if ($linktoid=="") { echo ''; print_findindi_link("linktopid", ""); } else { $record=WT_Person::getInstance($linktoid); echo $record->format_list('span', false, $record->getFullName()); } } if ($linkto == "family") { echo WT_I18N::translate('Family'), ' | '; echo ''; if ($linktoid=="") { echo ''; print_findfamily_link("linktofamid"); } else { $record=WT_Family::getInstance($linktoid); echo $record->format_list('span', false, $record->getFullName()); } } if ($linkto == "source") { echo WT_I18N::translate('Source'), " | "; echo ''; if ($linktoid=="") { echo ''; print_findsource_link("linktosid"); } else { $record=WT_Source::getInstance($linktoid); echo $record->format_list('span', false, $record->getFullName()); } } if ($linkto == "repository") { echo WT_I18N::translate('Repository'), " | "; echo ''; if ($linktoid=="") { echo ''; } else { $record=WT_Repository::getInstance($linktoid); echo $record->format_list('span', false, $record->getFullName()); } } if ($linkto == "note") { echo WT_I18N::translate('Shared note'), " | "; echo ''; if ($linktoid=="") { echo ''; } else { $record=WT_Note::getInstance($linktoid); echo $record->format_list('span', false, $record->getFullName()); } } echo ' |