/** {@inheritdoc} */
    public function getTabContent()
    {
        global $WT_TREE, $controller;
        ob_start();
        echo '<table class="facts_table">';
        ?>
		<tr>
			<td colspan="2" class="descriptionbox rela">
				<input id="checkbox_note2" type="checkbox" <?php 
        echo $WT_TREE->getPreference('SHOW_LEVEL2_NOTES') ? 'checked' : '';
        ?>
 onclick="jQuery('tr.row_note2').toggle();">
				<label for="checkbox_note2"><?php 
        echo I18N::translate('Show all notes');
        ?>
</label>
			</td>
		</tr>
		<?php 
        foreach ($this->getFactsWithNotes() as $fact) {
            if ($fact->getTag() == 'NOTE') {
                FunctionsPrintFacts::printMainNotes($fact, 1);
            } else {
                for ($i = 2; $i < 4; ++$i) {
                    FunctionsPrintFacts::printMainNotes($fact, $i);
                }
            }
        }
        if (!$this->getFactsWithNotes()) {
            echo '<tr><td id="no_tab4" colspan="2" class="facts_value">', I18N::translate('There are no notes for this individual.'), '</td></tr>';
        }
        // New note link
        if ($controller->record->canEdit()) {
            ?>
			<tr>
				<td class="facts_label">
					<?php 
            echo GedcomTag::getLabel('NOTE');
            ?>
				</td>
				<td class="facts_value">
					<a href="#" onclick="add_new_record('<?php 
            echo $controller->record->getXref();
            ?>
','NOTE'); return false;">
						<?php 
            echo I18N::translate('Add a new note');
            ?>
					</a>
				</td>
			</tr>
			<tr>
				<td class="facts_label">
					<?php 
            echo GedcomTag::getLabel('SHARED_NOTE');
            ?>
				</td>
				<td class="facts_value">
					<a href="#" onclick="add_new_record('<?php 
            echo $controller->record->getXref();
            ?>
','SHARED_NOTE'); return false;">
						<?php 
            echo I18N::translate('Add a new shared note');
            ?>
					</a>
				</td>
			</tr>
		<?php 
        }
        ?>
		</table>
		<?php 
        if (!$WT_TREE->getPreference('SHOW_LEVEL2_NOTES')) {
            echo '<script>jQuery("tr.row_note2").toggle();</script>';
        }
        return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>';
    }
Exemple #2
0
    /** {@inheritdoc} */
    public function getTabContent()
    {
        global $controller;
        ob_start();
        ?>
		<table class="facts_table">
			<colgroup>
				<col class="width20">
				<col class="width80">
			</colgroup>
			<tr class="noprint">
				<td colspan="2" class="descriptionbox rela">
					<label>
						<input id="show-level-2-notes" type="checkbox">
						<?php 
        echo I18N::translate('Show all notes');
        ?>
					</label>
				</td>
			</tr>

		<?php 
        foreach ($this->getFactsWithNotes() as $fact) {
            if ($fact->getTag() == 'NOTE') {
                FunctionsPrintFacts::printMainNotes($fact, 1);
            } else {
                for ($i = 2; $i < 4; ++$i) {
                    FunctionsPrintFacts::printMainNotes($fact, $i);
                }
            }
        }
        if (!$this->getFactsWithNotes()) {
            echo '<tr><td id="no_tab4" colspan="2" class="facts_value">', I18N::translate('There are no notes for this individual.'), '</td></tr>';
        }
        // New note link
        if ($controller->record->canEdit()) {
            ?>
			<tr class="noprint">
				<td class="facts_label">
					<?php 
            echo GedcomTag::getLabel('NOTE');
            ?>
				</td>
				<td class="facts_value">
					<a href="#" onclick="add_new_record('<?php 
            echo $controller->record->getXref();
            ?>
','NOTE'); return false;">
						<?php 
            echo I18N::translate('Add a note');
            ?>
					</a>
				</td>
			</tr>
			<tr class="noprint">
				<td class="facts_label">
					<?php 
            echo GedcomTag::getLabel('SHARED_NOTE');
            ?>
				</td>
				<td class="facts_value">
					<a href="#" onclick="add_new_record('<?php 
            echo $controller->record->getXref();
            ?>
','SHARED_NOTE'); return false;">
						<?php 
            echo I18N::translate('Add a shared note');
            ?>
					</a>
				</td>
			</tr>
		<?php 
        }
        ?>
		</table>
		<script>
			persistent_toggle("show-level-2-notes", ".row_note2");
		</script>
		<?php 
        return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>';
    }