/**
  * Load this sidebar synchronously.
  *
  * @return string
  */
 public function getSidebarContent()
 {
     global $controller;
     $indifacts = array();
     // The individual’s own facts
     foreach ($controller->record->getFacts() as $fact) {
         if (self::showFact($fact)) {
             $indifacts[] = $fact;
         }
     }
     ob_start();
     if (!$indifacts) {
         echo I18N::translate('There are no facts for this individual.');
     } else {
         foreach ($indifacts as $fact) {
             FunctionsPrintFacts::printFact($fact, $controller->record);
         }
     }
     return strip_tags(ob_get_clean(), '<a><div><span>');
 }
Exemple #2
0
        if ($controller->record->getTree()->getPreference('SHOW_MEDIA_DOWNLOAD')) {
            echo '<p><a href="' . $tmp->getHtmlUrlDirect('main', true) . '">' . I18N::translate('Download file') . '</a></p>';
        }
    } else {
        echo '<p class="ui-state-error">' . I18N::translate('The file “%s” does not exist.', $tmp->getFilename()) . '</p>';
    }
}
echo '</td>
				<td valign="top">
					<table width="100%">
						<tr>
							<td>
								<table class="facts_table">';
$facts = $controller->getFacts();
foreach ($facts as $f => $fact) {
    FunctionsPrintFacts::printFact($fact, $controller->record);
}
echo '</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</div>';
echo '<ul>';
if ($linked_indi) {
    echo '<li><a href="#indi-media"><span id="indimedia">', I18N::translate('Individuals'), '</span></a></li>';
}
if ($linked_fam) {
    echo '<li><a href="#fam-media"><span id="fammedia">', I18N::translate('Families'), '</span></a></li>';
 /**
  * Print the facts
  */
 public function printFamilyFacts()
 {
     global $linkToID;
     $linkToID = $this->record->getXref();
     // -- Tell addmedia.php what to link to
     $indifacts = $this->record->getFacts();
     if ($indifacts) {
         Functions::sortFacts($indifacts);
         foreach ($indifacts as $fact) {
             FunctionsPrintFacts::printFact($fact, $this->record);
         }
     } else {
         echo '<tr><td class="messagebox" colspan="2">', I18N::translate('No facts exist for this family.'), '</td></tr>';
     }
     if (Auth::isEditor($this->record->getTree())) {
         FunctionsPrint::printAddNewFact($this->record->getXref(), $indifacts, 'FAM');
         echo '<tr><td class="descriptionbox">';
         echo I18N::translate('Note');
         echo '</td><td class="optionbox">';
         echo "<a href=\"#\" onclick=\"return add_new_record('" . $this->record->getXref() . "','NOTE');\">", I18N::translate('Add a note'), '</a>';
         echo '</td></tr>';
         echo '<tr><td class="descriptionbox">';
         echo I18N::translate('Shared note');
         echo '</td><td class="optionbox">';
         echo "<a href=\"#\" onclick=\"return add_new_record('" . $this->record->getXref() . "','SHARED_NOTE');\">", I18N::translate('Add a shared note'), '</a>';
         echo '</td></tr>';
         if ($this->record->getTree()->getPreference('MEDIA_UPLOAD') >= Auth::accessLevel($this->record->getTree())) {
             echo '<tr><td class="descriptionbox">';
             echo I18N::translate('Media object');
             echo '</td><td class="optionbox">';
             echo "<a href=\"#\" onclick=\"window.open('addmedia.php?action=showmediaform&amp;linktoid=" . $this->record->getXref() . "', '_blank', edit_window_specs); return false;\">", I18N::translate('Add a media object'), '</a>';
             echo FunctionsPrint::helpLink('OBJE');
             echo '<br>';
             echo "<a href=\"#\" onclick=\"window.open('inverselink.php?linktoid=" . $this->record->getXref() . "&amp;linkto=family', '_blank', find_window_specs); return false;\">", I18N::translate('Link to an existing media object'), '</a>';
             echo '</td></tr>';
         }
         echo '<tr><td class="descriptionbox">';
         echo I18N::translate('Source');
         echo '</td><td class="optionbox">';
         echo "<a href=\"#\" onclick=\"return add_new_record('" . $this->record->getXref() . "','SOUR');\">", I18N::translate('Add a source citation'), '</a>';
         echo '</td></tr>';
     }
 }
 /** {@inheritdoc} */
 public function getTabContent()
 {
     global $controller;
     $EXPAND_HISTO_EVENTS = false;
     $indifacts = array();
     // The individual’s own facts
     foreach ($controller->record->getFacts() as $fact) {
         switch ($fact->getTag()) {
             case 'SEX':
             case 'NAME':
             case 'SOUR':
             case 'OBJE':
             case 'NOTE':
             case 'FAMC':
             case 'FAMS':
                 break;
             default:
                 if (!array_key_exists('extra_info', Module::getActiveSidebars($controller->record->getTree())) || !ExtraInformationModule::showFact($fact)) {
                     $indifacts[] = $fact;
                 }
                 break;
         }
     }
     // Add spouse-family facts
     foreach ($controller->record->getSpouseFamilies() as $family) {
         foreach ($family->getFacts() as $fact) {
             switch ($fact->getTag()) {
                 case 'SOUR':
                 case 'NOTE':
                 case 'OBJE':
                 case 'CHAN':
                 case '_UID':
                 case 'RIN':
                 case 'HUSB':
                 case 'WIFE':
                 case 'CHIL':
                     break;
                 default:
                     $indifacts[] = $fact;
                     break;
             }
         }
         $spouse = $family->getSpouse($controller->record);
         if ($spouse) {
             foreach (self::spouseFacts($controller->record, $spouse) as $fact) {
                 $indifacts[] = $fact;
             }
         }
         foreach (self::childFacts($controller->record, $family, '_CHIL', '') as $fact) {
             $indifacts[] = $fact;
         }
     }
     foreach (self::parentFacts($controller->record, 1) as $fact) {
         $indifacts[] = $fact;
     }
     foreach (self::historicalFacts($controller->record) as $fact) {
         $indifacts[] = $fact;
     }
     foreach (self::associateFacts($controller->record) as $fact) {
         $indifacts[] = $fact;
     }
     Functions::sortFacts($indifacts);
     ob_start();
     echo '<table class="facts_table">';
     echo '<tbody>';
     if (!$indifacts) {
         echo '<tr><td colspan="2" class="facts_value">', I18N::translate('There are no facts for this individual.'), '</td></tr>';
     }
     echo '<tr><td colspan="2" class="descriptionbox rela"><form action="?"><input id="checkbox_rela_facts" type="checkbox" ';
     echo $controller->record->getTree()->getPreference('EXPAND_RELATIVES_EVENTS') ? 'checked' : '';
     echo ' onclick="jQuery(\'tr.rela\').toggle();"><label for="checkbox_rela_facts">', I18N::translate('Events of close relatives'), '</label>';
     if (file_exists(Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) {
         echo ' <input id="checkbox_histo" type="checkbox" ';
         echo $EXPAND_HISTO_EVENTS ? 'checked' : '';
         echo ' onclick="jQuery(\'tr.histo\').toggle();"><label for="checkbox_histo">', I18N::translate('Historical facts'), '</label>';
     }
     echo '</form></td></tr>';
     foreach ($indifacts as $fact) {
         FunctionsPrintFacts::printFact($fact, $controller->record);
     }
     //-- new fact link
     if ($controller->record->canEdit()) {
         FunctionsPrint::printAddNewFact($controller->record->getXref(), $indifacts, 'INDI');
     }
     echo '</tbody>';
     echo '</table>';
     if (!$controller->record->getTree()->getPreference('EXPAND_RELATIVES_EVENTS')) {
         echo '<script>jQuery("tr.rela").toggle();</script>';
     }
     if (!$EXPAND_HISTO_EVENTS) {
         echo '<script>jQuery("tr.histo").toggle();</script>';
     }
     return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>';
 }