Exemplo n.º 1
0
 /**
  * Create a branches list controller
  */
 public function __construct()
 {
     global $WT_TREE;
     parent::__construct();
     $this->surname = Filter::get('surname');
     $this->soundex_std = Filter::getBool('soundex_std');
     $this->soundex_dm = Filter::getBool('soundex_dm');
     if ($this->surname) {
         $this->setPageTitle(I18N::translate('Branches of the %s family', Filter::escapeHtml($this->surname)));
         $this->loadIndividuals();
         $self = Individual::getInstance($WT_TREE->getUserPreference(Auth::user(), 'gedcomid'), $WT_TREE);
         if ($self) {
             $this->loadAncestors($self, 1);
         }
     } else {
         $this->setPageTitle(I18N::translate('Branches'));
     }
 }
Exemplo n.º 2
0
 /**
  * Print SOUR structure
  *  This function prints the input array of SOUR sub-records built by the
  *  getSourceStructure() function.
  *
  * @param string[] $textSOUR
  *
  * @return string
  */
 public static function printSourceStructure($textSOUR)
 {
     global $WT_TREE;
     $html = '';
     if ($textSOUR['PAGE']) {
         $html .= GedcomTag::getLabelValue('PAGE', Filter::expandUrls($textSOUR['PAGE']));
     }
     if ($textSOUR['EVEN']) {
         $html .= GedcomTag::getLabelValue('EVEN', Filter::escapeHtml($textSOUR['EVEN']));
         if ($textSOUR['ROLE']) {
             $html .= GedcomTag::getLabelValue('ROLE', Filter::escapeHtml($textSOUR['ROLE']));
         }
     }
     if ($textSOUR['DATE'] || count($textSOUR['TEXT'])) {
         if ($textSOUR['DATE']) {
             $date = new Date($textSOUR['DATE']);
             $html .= GedcomTag::getLabelValue('DATA:DATE', $date->display());
         }
         foreach ($textSOUR['TEXT'] as $text) {
             $html .= GedcomTag::getLabelValue('TEXT', Filter::formatText($text, $WT_TREE));
         }
     }
     if ($textSOUR['QUAY'] != '') {
         $html .= GedcomTag::getLabelValue('QUAY', GedcomCodeQuay::getValue($textSOUR['QUAY']));
     }
     return '<div class="indent">' . $html . '</div>';
 }
			<!-- GEDCOM_MEDIA_PATH -->
			<?php 
if ($WT_TREE->getPreference('GEDCOM_MEDIA_PATH')) {
    ?>
			<label>
				<input type="checkbox" name="conv_path" value="<?php 
    echo Filter::escapeHtml($WT_TREE->getPreference('GEDCOM_MEDIA_PATH'));
    ?>
">
				<?php 
    echo I18N::translate('Add the GEDCOM media path to filenames');
    ?>
			</label>
			<p>
				<?php 
    echo I18N::translate('Media filenames will be prefixed by %s.', '<code dir="ltr">' . Filter::escapeHtml($WT_TREE->getPreference('GEDCOM_MEDIA_PATH')) . '</code>');
    ?>
			</p>
			<?php 
}
?>
		</div>
	</fieldset>

	<!-- PRIVACY OPTIONS -->
	<fieldset class="form-group">
		<legend class="control-label col-sm-3">
			<?php 
echo I18N::translate('Apply privacy settings');
?>
		</legend>
Exemplo n.º 4
0
 /**
  * Render this menu as an HTML list
  *
  * @return string
  */
 public function getMenuAsList()
 {
     $attrs = '';
     foreach ($this->attrs as $key => $value) {
         $attrs .= ' ' . $key . '="' . Filter::escapeHtml($value) . '"';
     }
     if ($this->link) {
         $link = ' href="' . $this->link . '"';
     } else {
         $link = '';
     }
     $html = '<a' . $link . $attrs . '>' . $this->label . '</a>';
     if ($this->submenus) {
         $html .= '<ul>';
         foreach ($this->submenus as $submenu) {
             $html .= $submenu->getMenuAsList();
         }
         $html .= '</ul>';
     }
     return '<li class="' . $this->class . '">' . $html . '</li>';
 }
Exemplo n.º 5
0
 /**
  * Generate the HTML content of this block.
  *
  * @param int      $block_id
  * @param bool     $template
  * @param string[] $cfg
  *
  * @return string
  */
 public function getBlock($block_id, $template = true, $cfg = array())
 {
     global $ctype, $WT_TREE;
     switch (Filter::get('action')) {
         case 'deletenews':
             $news_id = Filter::getInteger('news_id');
             if ($news_id) {
                 Database::prepare("DELETE FROM `##news` WHERE news_id = ?")->execute(array($news_id));
             }
             break;
     }
     $articles = Database::prepare("SELECT SQL_CACHE news_id, user_id, gedcom_id, UNIX_TIMESTAMP(updated) + :offset AS updated, subject, body FROM `##news` WHERE user_id = :user_id ORDER BY updated DESC")->execute(array('offset' => WT_TIMESTAMP_OFFSET, 'user_id' => Auth::id()))->fetchAll();
     $id = $this->getName() . $block_id;
     $class = $this->getName() . '_block';
     $title = $this->getTitle();
     $content = '';
     if (empty($articles)) {
         $content .= '<p>' . I18N::translate('You have not created any journal items.') . '</p>';
     }
     foreach ($articles as $article) {
         $content .= '<div class="journal_box">';
         $content .= '<div class="news_title">' . Filter::escapeHtml($article->subject) . '</div>';
         $content .= '<div class="news_date">' . FunctionsDate::formatTimestamp($article->updated) . '</div>';
         if ($article->body == strip_tags($article->body)) {
             $article->body = nl2br($article->body, false);
         }
         $content .= $article->body;
         $content .= '<a href="#" onclick="window.open(\'editnews.php?news_id=\'+' . $article->news_id . ', \'_blank\', indx_window_specs); return false;">' . I18N::translate('Edit') . '</a>';
         $content .= ' | ';
         $content .= '<a href="index.php?action=deletenews&amp;news_id=' . $article->news_id . '&amp;ctype=' . $ctype . '&amp;ged=' . $WT_TREE->getNameHtml() . '" onclick="return confirm(\'' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeHtml($article->subject)) . "');\">" . I18N::translate('Delete') . '</a><br>';
         $content .= '</div><br>';
     }
     $content .= '<p><a href="#" onclick="window.open(\'editnews.php?user_id=' . Auth::id() . '\', \'_blank\', indx_window_specs); return false;">' . I18N::translate('Add a journal entry') . '</a></p>';
     if ($template) {
         return Theme::theme()->formatBlock($id, $title, $class, $content);
     } else {
         return $content;
     }
 }
Exemplo n.º 6
0
     }
     echo '</div>';
 }
 // Output Media
 if ($type === 'media') {
     $medialist = QueryMedia::mediaList('', 'include', 'title', $filter, '');
     echo '<div id="find-output">';
     if ($medialist) {
         foreach ($medialist as $media) {
             echo '<div class="find-media-media">';
             echo '<div class="find-media-thumb">', $media->displayImage(), '</div>';
             echo '<div class="find-media-details">', $media->getFullName(), '</div>';
             if (!$embed) {
                 echo '<p><a href="#" dir="auto" onclick="pasteid(\'', $media->getXref(), '\');">', $media->getFilename(), '</a></p>';
             } else {
                 echo '<p><a href="#" dir="auto" onclick="pasteid(\'', $media->getXref(), '\', \'', '\', \'', Filter::escapeJs($media->getFilename()), '\');">', Filter::escapeHtml($media->getFilename()), '</a></p> ';
             }
             if ($media->fileExists()) {
                 $imgsize = $media->getImageAttributes();
                 echo GedcomTag::getLabelValue('__IMAGE_SIZE__', $imgsize['WxH']);
             }
             echo '<ul>';
             $found = false;
             foreach ($media->linkedIndividuals('OBJE') as $indindividual) {
                 echo '<li>', $indindividual->getFullName(), '</li>';
                 $found = true;
             }
             foreach ($media->linkedFamilies('OBJE') as $family) {
                 echo '<li>', $family->getFullName(), '</li>';
                 $found = true;
             }
 /**
  * Get the initial letters of surnames.
  *
  * @param Tree   $tree
  * @param string $alpha
  *
  * @return string
  */
 private function getAlphaSurnames(Tree $tree, $alpha)
 {
     $surnames = QueryName::surnames($tree, '', $alpha, true, false);
     $out = '<ul>';
     foreach (array_keys($surnames) as $surname) {
         $out .= '<li class="sb_indi_surname_li"><a href="#" data-surname="' . Filter::escapeHtml($surname) . '" data-alpha="' . Filter::escapeHtml($alpha) . '" class="sb_indi_surname">' . Filter::escapeHtml($surname) . '</a>';
         $out .= '<div class="name_tree_div"></div>';
         $out .= '</li>';
     }
     $out .= '</ul>';
     return $out;
 }
Exemplo n.º 8
0
			<?php 
            echo I18N::translate('Nothing found to cleanup');
            ?>
			<?php 
        }
        ?>
		</p>
	</form>
	<?php 
        break;
    case 'cleanup2':
        foreach (User::all() as $user) {
            if (Filter::post('del_' . $user->getUserId()) == '1') {
                Log::addAuthenticationLog('Deleted user: '******'The user %s has been deleted.', Filter::escapeHtml($user->getUserName()));
            }
        }
        header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
        break;
    default:
        $controller->setPageTitle(I18N::translate('User administration'))->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)->addInlineJavascript('
			jQuery(".table-user-list").dataTable({
				' . I18N::datatablesI18N() . ',
				stateSave: true,
				stateDuration: 300,
				processing: true,
				serverSide: true,
				ajax: {
					"url": "' . WT_SCRIPT_NAME . '?action=load_json",
					"type": "POST"
Exemplo n.º 9
0
 /**
  * Print a fact for an individual.
  *
  * @param Fact $event
  */
 public function printTimeFact(Fact $event)
 {
     global $basexoffset, $baseyoffset, $factcount, $placements;
     $desc = $event->getValue();
     // check if this is a family fact
     $gdate = $event->getDate();
     $date = $gdate->minimumDate();
     $date = $date->convertToCalendar('gregorian');
     $year = $date->y;
     $month = max(1, $date->m);
     $day = max(1, $date->d);
     $xoffset = $basexoffset + 22;
     $yoffset = $baseyoffset + ($year - $this->baseyear) * $this->scale - $this->scale;
     $yoffset = $yoffset + $month / 12 * $this->scale;
     $yoffset = $yoffset + $day / 30 * ($this->scale / 12);
     $yoffset = (int) $yoffset;
     $place = (int) ($yoffset / $this->bheight);
     $i = 1;
     $j = 0;
     $tyoffset = 0;
     while (isset($placements[$place])) {
         if ($i === $j) {
             $tyoffset = $this->bheight * $i;
             $i++;
         } else {
             $tyoffset = -1 * $this->bheight * $j;
             $j++;
         }
         $place = (int) (($yoffset + $tyoffset) / $this->bheight);
     }
     $yoffset += $tyoffset;
     $xoffset += abs($tyoffset);
     $placements[$place] = $yoffset;
     echo "<div id=\"fact{$factcount}\" style=\"position:absolute; " . (I18N::direction() === 'ltr' ? 'left: ' . $xoffset : 'right: ' . $xoffset) . 'px; top:' . $yoffset . "px; font-size: 8pt; height: " . $this->bheight . "px;\" onmousedown=\"factMouseDown(this, '" . $factcount . "', " . ($yoffset - $tyoffset) . ");\">";
     echo '<table cellspacing="0" cellpadding="0" border="0" style="cursor: hand;"><tr><td>';
     echo '<img src="' . Theme::theme()->parameter('image-hline') . '" name="boxline' . $factcount . '" id="boxline' . $factcount . '" height="3" width="10" style="padding-';
     if (I18N::direction() === 'ltr') {
         echo 'left: 3px;">';
     } else {
         echo 'right: 3px;">';
     }
     $col = array_search($event->getParent(), $this->people);
     if ($col === false) {
         // Marriage event - use the color of the husband
         $col = array_search($event->getParent()->getHusband(), $this->people);
     }
     if ($col === false) {
         // Marriage event - use the color of the wife
         $col = array_search($event->getParent()->getWife(), $this->people);
     }
     $col = $col % 6;
     echo '</td><td class="person' . $col . '">';
     if (count($this->people) > 6) {
         // We only have six colours, so show naes if more than this number
         echo $event->getParent()->getFullName() . ' — ';
     }
     $record = $event->getParent();
     echo $event->getLabel();
     echo ' — ';
     if ($record instanceof Individual) {
         echo FunctionsPrint::formatFactDate($event, $record, false, false);
     } elseif ($record instanceof Family) {
         echo $gdate->display();
         if ($record->getHusband() && $record->getHusband()->getBirthDate()->isOK()) {
             $ageh = FunctionsDate::getAgeAtEvent(Date::getAgeGedcom($record->getHusband()->getBirthDate(), $gdate));
         } else {
             $ageh = null;
         }
         if ($record->getWife() && $record->getWife()->getBirthDate()->isOK()) {
             $agew = FunctionsDate::getAgeAtEvent(Date::getAgeGedcom($record->getWife()->getBirthDate(), $gdate));
         } else {
             $agew = null;
         }
         if ($ageh && $agew) {
             echo '<span class="age"> ', I18N::translate('Husband’s age'), ' ', $ageh, ' ', I18N::translate('Wife’s age'), ' ', $agew, '</span>';
         } elseif ($ageh) {
             echo '<span class="age"> ', I18N::translate('Age'), ' ', $ageh, '</span>';
         } elseif ($agew) {
             echo '<span class="age"> ', I18N::translate('Age'), ' ', $ageh, '</span>';
         }
     }
     echo ' ' . Filter::escapeHtml($desc);
     if (!$event->getPlace()->isEmpty()) {
         echo ' — ' . $event->getPlace()->getShortName();
     }
     // Print spouses names for family events
     if ($event->getParent() instanceof Family) {
         echo ' — <a href="', $event->getParent()->getHtmlUrl(), '">', $event->getParent()->getFullName(), '</a>';
     }
     echo '</td></tr></table>';
     echo '</div>';
     if (I18N::direction() === 'ltr') {
         $img = 'image-dline2';
         $ypos = '0%';
     } else {
         $img = 'image-dline';
         $ypos = '100%';
     }
     $dyoffset = $yoffset - $tyoffset + $this->bheight / 3;
     if ($tyoffset < 0) {
         $dyoffset = $yoffset + $this->bheight / 3;
         if (I18N::direction() === 'ltr') {
             $img = 'image-dline';
             $ypos = '100%';
         } else {
             $img = 'image-dline2';
             $ypos = '0%';
         }
     }
     // Print the diagonal line
     echo '<div id="dbox' . $factcount . '" style="position:absolute; ' . (I18N::direction() === 'ltr' ? 'left: ' . ($basexoffset + 25) : 'right: ' . ($basexoffset + 25)) . 'px; top:' . $dyoffset . 'px; font-size: 8pt; height: ' . abs($tyoffset) . 'px; width: ' . abs($tyoffset) . 'px;';
     echo ' background-image: url(\'' . Theme::theme()->parameter($img) . '\');';
     echo ' background-position: 0% ' . $ypos . ';">';
     echo '</div>';
 }
Exemplo n.º 10
0
 /**
  * Get the list of initial letters
  * 
  * @return string[]
  */
 private function getInitialLettersList()
 {
     $list = array();
     /** @var \Fisharebest\Webtrees\Tree $tree */
     $tree = $this->data->get('tree');
     $script_base_url = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage';
     foreach (QueryName::surnameAlpha($tree, false, false) as $letter => $count) {
         switch ($letter) {
             case '@':
                 $html = I18N::translateContext('Unknown surname', '…');
                 break;
             case ',':
                 $html = I18N::translate('None');
                 break;
             default:
                 $html = Filter::escapeHtml($letter);
                 break;
         }
         if ($count) {
             if ($letter == $this->data->get('alpha')) {
                 $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&amp;ged=' . $tree->getNameUrl() . '" class="warning" title="' . I18N::number($count) . '">' . $html . '</a>';
             } else {
                 $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&amp;ged=' . $tree->getNameUrl() . '" title="' . I18N::number($count) . '">' . $html . '</a>';
             }
         } else {
             $list[] = $html;
         }
     }
     // Search spiders don't get the "show all" option as the other links give them everything.
     if (!Auth::isSearchEngine()) {
         if ($this->data->get('show_all') === 'yes') {
             $list[] = '<span class="warning">' . I18N::translate('All') . '</span>';
         } else {
             $list[] = '<a href="' . $script_base_url . '&show_all=yes' . '&amp;ged=' . $tree->getNameUrl() . '">' . I18N::translate('All') . '</a>';
         }
     }
     return $list;
 }
Exemplo n.º 11
0
 /**
  * Display an image-thumbnail or a media-icon, and add markup for image viewers such as colorbox.
  *
  * @return string
  */
 public function displayImage()
 {
     if ($this->isExternal() || !file_exists($this->getServerFilename('thumb'))) {
         // Use an icon
         $mime_type = str_replace('/', '-', $this->mimeType());
         $image = '<i' . ' dir="' . 'auto' . '"' . ' class="' . 'icon-mime-' . $mime_type . '"' . ' title="' . strip_tags($this->getFullName()) . '"' . '></i>';
     } else {
         $imgsize = getimagesize($this->getServerFilename('thumb'));
         // Use a thumbnail image
         $image = '<img' . ' dir="' . 'auto' . '"' . ' src="' . $this->getHtmlUrlDirect('thumb') . '"' . ' alt="' . strip_tags($this->getFullName()) . '"' . ' title="' . strip_tags($this->getFullName()) . '"' . ' ' . $imgsize[3] . '>';
     }
     return '<a' . ' class="' . 'gallery' . '"' . ' href="' . $this->getHtmlUrlDirect('main') . '"' . ' type="' . $this->mimeType() . '"' . ' data-obje-url="' . $this->getHtmlUrl() . '"' . ' data-obje-note="' . Filter::escapeHtml($this->getNote()) . '"' . ' data-title="' . Filter::escapeHtml($this->getFullName()) . '"' . '>' . $image . '</a>';
 }
Exemplo n.º 12
0
    echo Filter::escapeHtml(Site::getPreference('STATCOUNTER_PROJECT_ID'));
    ?>
" maxlength="255" pattern="[0-9]+">
			</div>
		</div>

		<!-- STATCOUNTER_SECURITY_ID -->
		<div class="form-group">
			<label for="STATCOUNTER_SECURITY_ID" class="col-sm-3 control-label">
				<?php 
    echo I18N::translate('Security code');
    ?>
			</label>
			<div class="col-sm-9">
				<input type="text" class="form-control" id="STATCOUNTER_SECURITY_ID" name="STATCOUNTER_SECURITY_ID" value="<?php 
    echo Filter::escapeHtml(Site::getPreference('STATCOUNTER_SECURITY_ID'));
    ?>
" maxlength="255" pattern="[0-9a-zA-Z]+">
				<p class="small text-muted">
					<?php 
    echo I18N::translate('Tracking and analytics are not added to the control panel.');
    ?>
				</p>
			</div>
		</div>

	<?php 
} elseif (Filter::get('action') === 'languages') {
    ?>
		<input type="hidden" name="action" value="languages">
Exemplo n.º 13
0
    /**
     * {@inhericDoc}
     * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
     */
    protected function renderContent()
    {
        if ($this->data->get('has_sosa', false)) {
            $table_id = $this->data->get('table_id');
            ?>
   
        
        <div id="sosa-indi-list" class="sosa-list">
        	<table id="<?php 
            echo $table_id;
            ?>
">
				<thead>
    				<tr>
    					<th colspan="22">
    						<div class="btn-toolbar">
    							<div class="btn-group">
    								<button
    									class="ui-state-default"
    									data-filter-column="18"
    									data-filter-value="M"
    									title="<?php 
            echo I18N::translate('Show only males.');
            ?>
"
    									type="button"
    								><?php 
            echo Individual::sexImage('M', 'large');
            ?>
    								</button>
    								<button
    									class="ui-state-default"
    									data-filter-column="18"
    									data-filter-value="F"
    									title="<?php 
            echo I18N::translate('Show only females.');
            ?>
"
    									type="button"
    								>
    									<?php 
            echo Individual::sexImage('F', 'large');
            ?>
    								</button>
    								<button
    									class="ui-state-default"
    									data-filter-column="18"
    									data-filter-value="U"
    									title="<?php 
            echo I18N::translate('Show only individuals for whom the gender is not known.');
            ?>
"
    									type="button"
    								>
    									<?php 
            echo Individual::sexImage('U', 'large');
            ?>
    								</button>
    							</div>
    							<div class="btn-group">
    								<button
    									class="ui-state-default"
    									data-filter-column="20"
    									data-filter-value="N"
    									title="<?php 
            echo I18N::translate('Show individuals who are alive or couples where both partners are alive.');
            ?>
"
    									type="button"
    								>
    									<?php 
            echo I18N::translate('Alive');
            ?>
    								</button>
    								<button
    									class="ui-state-default"
    									data-filter-column="20"
    									data-filter-value="Y"
    									title="<?php 
            echo I18N::translate('Show individuals who are dead or couples where both partners are deceased.');
            ?>
"
    									type="button"
    								>
    									<?php 
            echo I18N::translate('Dead');
            ?>
    								</button>
    								<button
    									class="ui-state-default"
    									data-filter-column="20"
    									data-filter-value="YES"
    									title="<?php 
            echo I18N::translate('Show individuals who died more than 100 years ago.');
            ?>
"
    									type="button"
    								><?php 
            echo GedcomTag::getLabel('DEAT');
            ?>
&gt;100
    								</button>
    								<button
    									class="ui-state-default"
    									data-filter-column="20"
    									data-filter-value="Y100"
    									title="<?php 
            echo I18N::translate('Show individuals who died within the last 100 years.');
            ?>
"
    									type="button"
    								><?php 
            echo GedcomTag::getLabel('DEAT');
            ?>
&lt;=100
    								</button>
    							</div>
    							<div class="btn-group">
    								<button
    									class="ui-state-default"
    									data-filter-column="19"
    									data-filter-value="YES"
    									title="<?php 
            echo I18N::translate('Show individuals born more than 100 years ago.');
            ?>
"
    									type="button"
    								><?php 
            echo GedcomTag::getLabel('BIRT');
            ?>
&gt;100
    								</button>
    								<button
    									class="ui-state-default"
    									data-filter-column="19"
    									data-filter-value="Y100"
    									title="<?php 
            echo I18N::translate('Show individuals born within the last 100 years.');
            ?>
"
    									type="button"
    								><?php 
            echo GedcomTag::getLabel('BIRT');
            ?>
&lt;=100
    								</button>
    							</div>
    							<div class="btn-group">
    								<button
    									class="ui-state-default"
    									data-filter-column="21"
    									data-filter-value="R"
    									title="<?php 
            echo I18N::translate('Show “roots” couples or individuals.  These individuals may also be called “patriarchs”.  They are individuals who have no parents recorded in the database.');
            ?>
"
    									type="button"
    								>
    									<?php 
            echo I18N::translate('Roots');
            ?>
    								</button>
    								<button
    									class="ui-state-default"
    									data-filter-column="21"
    									data-filter-value="L"
    									title="<?php 
            echo I18N::translate('Show “leaves” couples or individuals.  These are individuals who are alive but have no children recorded in the database.');
            ?>
"
    									type="button"
    								>
    									<?php 
            echo I18N::translate('Leaves');
            ?>
    								</button>
    							</div>
    						</div>
    					</th>
    				</tr>
					<tr>
						<th><?php 
            echo I18N::translate('Sosa');
            ?>
</th>
						<th><?php 
            echo GedcomTag::getLabel('INDI');
            ?>
</th>
						<th><?php 
            echo GedcomTag::getLabel('GIVN');
            ?>
</th>
						<th><?php 
            echo GedcomTag::getLabel('SURN');
            ?>
</th>
						<th>GIVN</th>
						<th>SURN</th>
						<th><?php 
            echo GedcomTag::getLabel('BIRT');
            ?>
</th>
						<th>SORT_BIRT</th>
						<th><?php 
            echo GedcomTag::getLabel('PLAC');
            ?>
</th>
						<?php 
            if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
                ?>
						<th><i class="icon-source" title="<?php 
                echo I18N::translate('Sourced birth');
                ?>
" border="0"></i></th>
						<th>SORT_BIRTSC</th>
						<?php 
            } else {
                ?>
						<th></th>
						<th></th>
						<?php 
            }
            ?>
						<th><?php 
            echo GedcomTag::getLabel('DEAT');
            ?>
</th>
						<th>SORT_DEAT</th>
						<th><?php 
            echo GedcomTag::getLabel('AGE');
            ?>
</th>
						<th>AGE</th>
						<th><?php 
            echo GedcomTag::getLabel('PLAC');
            ?>
</th>
						<?php 
            if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
                ?>
						<th><i class="icon-source" title="<?php 
                echo I18N::translate('Sourced death');
                ?>
" border="0"></i></th>
						<th>SORT_DEATSC</th>
						<?php 
            } else {
                ?>
						<th></th>
						<th></th>
						<?php 
            }
            ?>
						<th>SEX</th>
						<th>BIRT</th>
						<th>DEAT</th>
						<th>TREE</th>
					</tr>
				</thead>
			<tbody>
			
			<?php 
            foreach ($this->data->get('sosa_list') as $sosa => $person) {
                /** @var \Fisharebest\Webtrees\Individual $person */
                if ($person->isPendingAddtion()) {
                    $class = ' class="new"';
                } elseif ($person->isPendingDeletion()) {
                    $class = ' class="old"';
                } else {
                    $class = '';
                }
                $dperson = new \MyArtJaub\Webtrees\Individual($person);
                ?>
			
        		<tr <?php 
                echo $class;
                ?>
>
        			<td class="transparent"><?php 
                echo $sosa;
                ?>
</td>
        			<td class="transparent"><?php 
                echo $person->getXref();
                ?>
</td>
        			<td colspan="2">
        			<?php 
                foreach ($person->getAllNames() as $num => $name) {
                    if ($name['type'] == 'NAME') {
                        $title = '';
                    } else {
                        $title = 'title="' . strip_tags(GedcomTag::getLabel($name['type'], $person)) . '"';
                    }
                    if ($num == $person->getPrimaryName()) {
                        $class = ' class="name2"';
                        $sex_image = $person->getSexImage();
                        list($surn, $givn) = explode(',', $name['sort']);
                    } else {
                        $class = '';
                        $sex_image = '';
                    }
                    ?>
        				<a <?php 
                    echo $title . ' ' . $class;
                    ?>
 href="<?php 
                    echo $person->getHtmlUrl();
                    ?>
">
        					<?php 
                    echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']);
                    ?>
        				</a>
        				<?php 
                    echo $sex_image . FunctionsPrint::formatSosaNumbers($dperson->getSosaNumbers(), 1, 'smaller');
                    ?>
        				<br/>
            		<?php 
                }
                echo $person->getPrimaryParentsNames('parents details1', 'none');
                ?>
            		</td>
            		<td style="display:none;"></td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn));
                ?>
            		</td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn));
                ?>
            		</td>
            		<td>
            		<?php 
                if ($birth_dates = $person->getAllBirthDates()) {
                    foreach ($birth_dates as $num => $birth_date) {
                        if ($num) {
                            ?>
<br/><?php 
                        }
                        ?>
    						<?php 
                        echo $birth_date->display(true);
                    }
                } else {
                    $birth_date = new Date('');
                    if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) {
                        $birth_date = $person->getEstimatedBirthDate();
                        echo $birth_date->display(true);
                    } else {
                        echo '&nbsp;';
                    }
                    $birth_dates[0] = new Date('');
                }
                ?>
            		</td>
            		<td><?php 
                echo $birth_date->julianDay();
                ?>
</td>
        			<td>
        			<?php 
                foreach ($person->getAllBirthPlaces() as $n => $birth_place) {
                    $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree());
                    if ($n) {
                        ?>
<br><?php 
                    }
                    ?>
        				<a href="'<?php 
                    echo $tmp->getURL();
                    ?>
" title="<?php 
                    echo strip_tags($tmp->getFullName());
                    ?>
">
        					<?php 
                    echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName());
                    ?>
        				</a>
        			<?php 
                }
                ?>
        			</td>
        			<?php 
                if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
                    $isBSourced = $dperson->isBirthSourced();
                    ?>
				   	<td><?php 
                    echo FunctionsPrint::formatIsSourcedIcon('E', $isBSourced, 'BIRT', 1, 'medium');
                    ?>
</td>
					<td><?php 
                    echo $isBSourced;
                    ?>
</td>
					<?php 
                } else {
                    ?>
					<td>&nbsp;</td>
					<td></td>
					<?php 
                }
                ?>
					<td>
					<?php 
                if ($death_dates = $person->getAllDeathDates()) {
                    foreach ($death_dates as $num => $death_date) {
                        if ($num) {
                            ?>
<br/><?php 
                        }
                        ?>
					 		<?php 
                        echo $death_date->display(true);
                    }
                } else {
                    $death_date = $person->getEstimatedDeathDate();
                    if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES') && $death_date->minimumJulianDay() < WT_CLIENT_JD) {
                        echo $death_date->display(true);
                    } elseif ($person->isDead()) {
                        echo I18N::translate('yes');
                        $death_date = new Date('');
                    } else {
                        echo '&nbsp;';
                        $death_date = new Date('');
                    }
                    $death_dates[0] = new Date('');
                }
                ?>
			         </td>
			         <td><?php 
                echo $death_date->julianDay();
                ?>
</td>
			         <td><?php 
                echo Date::getAge($birth_dates[0], $death_dates[0], 2);
                ?>
</td>
			         <td><?php 
                echo Date::getAge($birth_dates[0], $death_dates[0], 1);
                ?>
</td>
			         <td>
        			 <?php 
                foreach ($person->getAllDeathPlaces() as $n => $death_place) {
                    $tmp = new Place($death_place, $person->getTree());
                    if ($n) {
                        ?>
<br><?php 
                    }
                    ?>
        				<a href="'<?php 
                    echo $tmp->getURL();
                    ?>
" title="<?php 
                    echo strip_tags($tmp->getFullName());
                    ?>
">
        					<?php 
                    echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName());
                    ?>
        				</a>
        			<?php 
                }
                ?>
        			</td>
        			<?php 
                if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
                    $isDSourced = $dperson->isDeathSourced();
                    ?>
				   	<td><?php 
                    echo FunctionsPrint::formatIsSourcedIcon('E', $isDSourced, 'DEAT', 1, 'medium');
                    ?>
</td>
					<td><?php 
                    echo $isDSourced;
                    ?>
</td>
					<?php 
                } else {
                    ?>
					<td>&nbsp;</td>
					<td></td>
					<?php 
                }
                ?>
					<td><?php 
                echo $person->getSex();
                ?>
</td>
					<td>
					<?php 
                if (!$person->canShow() || Date::compare($birth_date, new Date(date('Y') - 100)) > 0) {
                    echo 'Y100';
                } else {
                    echo 'YES';
                }
                ?>
        			</td>
        			<td>
        			<?php 
                if (Date::compare($death_dates[0], new Date(date('Y') - 100)) > 0) {
                    echo 'Y100';
                } elseif ($death_dates[0]->minimumJulianDay() || $person->isDead()) {
                    echo 'YES';
                } else {
                    echo 'N';
                }
                ?>
			         </td>
			         <td>
					<?php 
                if (!$person->getChildFamilies()) {
                    echo 'R';
                } elseif (!$person->isDead() && $person->getNumberOfChildren() < 1) {
                    echo 'L';
                } else {
                    echo '&nbsp;';
                }
                ?>
					</td>
				</tr>
        	<?php 
            }
            ?>
        	</tbody>
        	<tfoot>
				<tr>
					<th class="ui-state-default" colspan="22">
						<div class="center">
							<?php 
            echo I18N::translate('Number of Sosa ancestors: %1$s known / %2$s theoretical (%3$s)', I18N::number($this->data->get('sosa_count')), I18N::number($this->data->get('sosa_theo')), I18N::percentage($this->data->get('sosa_ratio'), 2));
            ?>
							<?php 
            if ($this->data->get('sosa_hidden') > 0) {
                echo '[' . I18N::translate('%s hidden', I18N::number($this->data->get('sosa_hidden'))) . ']';
            }
            ?>
						</div>
					</th>
				</tr>
				<tr>
					<th colspan="22">
						<div class="btn-toolbar">
							<div class="btn-group">
								<button type="button" class="ui-state-default btn-toggle-parents">
									<?php 
            echo I18N::translate('Show parents');
            ?>
								</button>
								<button id="btn-toggle-statistics-<?php 
            echo $table_id;
            ?>
" type="button" class="ui-state-default btn-toggle-statistics">
									<?php 
            echo I18N::translate('Show statistics charts');
            ?>
								</button>
							</div>
						</div>
					</th>
				</tr>
			</tfoot>
        	</table>
				<div id="indi_list_table-charts_<?php 
            echo $table_id;
            ?>
" style="display:none">
					<table class="list-charts">
						<tr>
							<td><?php 
            echo $this->data->get('chart_births');
            ?>
</td>
							<td><?php 
            echo $this->data->get('chart_deaths');
            ?>
</td>
						</tr>
						<tr>
							<td colspan="2"><?php 
            echo $this->data->get('chart_ages');
            ?>
</td>
						</tr>
					</table>
				</div>
			</div>
		<?php 
        }
    }
Exemplo n.º 14
0
        ?>
				</p>
				<label for="GEDCOM_MEDIA_PATH">
					<?php 
        echo I18N::translate('Remove the GEDCOM media path from filenames');
        ?>
				</label>
				<input
					class="form-control"
					dir="ltr"
					id="GEDCOM_MEDIA_PATH"
					maxlength="255"
					name="GEDCOM_MEDIA_PATH"
					type="text"
					value="<?php 
        echo Filter::escapeHtml($WT_TREE->getPreference('GEDCOM_MEDIA_PATH'));
        ?>
"
					>
				<p class="small text-muted">
					<?php 
        echo I18N::translate('Some genealogy software creates GEDCOM files that contain media filenames with full paths.  These paths will not exist on the web-server.  To allow webtrees to find the file, the first part of the path must be removed.');
        ?>
					<?php 
        echo I18N::translate('For example, if the GEDCOM file contains %1$s and webtrees expects to find %2$s in the media folder, then you would need to remove %3$s.', '<code>C:\\Documents\\family\\photo.jpeg</code>', '<code>family\\photo.jpeg</code>', '<code>C:\\Documents\\</code>');
        ?>
				</p>
			</div>
		</fieldset>

		<div class="form-group">
Exemplo n.º 15
0
 /**
  * Print places
  * 
  * @param Place $place
  * @param type $tree
  * @return string
  */
 private function printPlace($place, $tree)
 {
     if ($this->options('show_places') == true) {
         $place = new Place($place, $tree);
         $html = ' ' . I18N::translateContext('before placesnames', 'in ');
         if ($this->options('use_gedcom_places') == true) {
             $html .= $place->getShortName();
         } else {
             $country = $this->options('country');
             $new_place = array_reverse(explode(", ", $place->getGedcomName()));
             if (!empty($country) && $new_place[0] == $country) {
                 unset($new_place[0]);
                 $html .= '<span dir="auto">' . Filter::escapeHtml(implode(', ', array_reverse($new_place))) . '</span>';
             } else {
                 $html .= $place->getFullName();
             }
         }
         return $html;
     }
 }
 /**
  * Generate a form to ask the user for options.
  *
  * @return string
  */
 public function getOptionsForm()
 {
     $descriptions = array('exact' => I18N::translate('Match the exact text, even if it occurs in the middle of a word.'), 'words' => I18N::translate('Match the exact text, unless it occurs in the middle of a word.'), 'wildcards' => I18N::translate('Use a “?” to match a single character, use “*” to match zero or more characters.'), 'regex' => I18N::translate('Regular expressions are an advanced pattern matching technique.') . '<br>' . I18N::translate('See %s for more information.', '<a href="http://php.net/manual/regexp.reference.php" target="_blank">php.net/manual/regexp.reference.php</a>'));
     return '<tr><th>' . I18N::translate('Search text/pattern') . '</th>' . '<td>' . '<input name="search" size="40" value="' . Filter::escapeHtml($this->search) . '" onchange="this.form.submit();"></td></tr>' . '<tr><th>' . I18N::translate('Replacement text') . '</th>' . '<td>' . '<input name="replace" size="40" value="' . Filter::escapeHtml($this->replace) . '" onchange="this.form.submit();"></td></tr>' . '<tr><th>' . I18N::translate('Search method') . '</th>' . '<td><select name="method" onchange="this.form.submit();">' . '<option value="exact" ' . ($this->method == 'exact' ? 'selected' : '') . '>' . I18N::translate('Exact text') . '</option>' . '<option value="words" ' . ($this->method == 'words' ? 'selected' : '') . '>' . I18N::translate('Whole words only') . '</option>' . '<option value="wildcards" ' . ($this->method == 'wildcards' ? 'selected' : '') . '>' . I18N::translate('Wildcards') . '</option>' . '<option value="regex" ' . ($this->method == 'regex' ? 'selected' : '') . '>' . I18N::translate('Regular expression') . '</option>' . '</select><br><em>' . $descriptions[$this->method] . '</em>' . $this->error . '</td></tr>' . '<tr><th>' . I18N::translate('Case insensitive') . '</th>' . '<td>' . '<input type="checkbox" name="case" value="i" ' . ($this->case == 'i' ? 'checked' : '') . '" onchange="this.form.submit();">' . '<br><em>' . I18N::translate('Tick this box to match both upper and lower case letters.') . '</em></td></tr>' . parent::getOptionsForm();
 }
Exemplo n.º 17
0
/**
 * Show an option to preserve the existing CHAN record when editing.
 *
 * @param GedcomRecord $record
 *
 * @return string
 */
function keep_chan(GedcomRecord $record = null)
{
    global $WT_TREE;
    if (Auth::isAdmin()) {
        if ($record) {
            $details = GedcomTag::getLabelValue('DATE', $record->lastChangeTimestamp()) . GedcomTag::getLabelValue('_WT_USER', Filter::escapeHtml($record->lastChangeUser()));
        } else {
            $details = '';
        }
        return '<tr><td class="descriptionbox wrap width25">' . GedcomTag::getLabel('CHAN') . '</td><td class="optionbox wrap">' . '<input type="checkbox" name="keep_chan" value="1" ' . ($WT_TREE->getPreference('NO_UPDATE_CHAN') ? 'checked' : '') . '>' . I18N::translate('Keep the existing “last change” information') . $details . '</td></tr>';
    } else {
        return '';
    }
}
Exemplo n.º 18
0
// session.php won’t run until a configuration file and database connection exist...
// This next block of code is a minimal version of session.php
define('WT_WEBTREES', 'webtrees');
define('WT_BASE_URL', '');
define('WT_ROOT', '');
define('WT_DATA_DIR', realpath('data') . DIRECTORY_SEPARATOR);
define('WT_MODULES_DIR', 'modules_v3/');
require 'vendor/autoload.php';
Session::start();
define('WT_LOCALE', I18N::init());
http_response_code(503);
header('Content-Type: text/html; charset=UTF-8');
// The page which redirected here may have provided an error message.
$messages = '';
foreach (FlashMessages::getMessages() as $message) {
    $messages .= '<blockquote>' . Filter::escapeHtml($message->text) . '</blockquote>';
}
// If we can't connect to the database at all, give the reason why
$config_ini_php = file_exists('data/config.ini.php') && parse_ini_file('data/config.ini.php');
if (is_array($config_ini_php) && array_key_exists('dbhost', $config_ini_php) && array_key_exists('dbport', $config_ini_php) && array_key_exists('dbuser', $config_ini_php) && array_key_exists('dbpass', $config_ini_php) && array_key_exists('dbname', $config_ini_php)) {
    try {
        new PDO('mysql:host=' . $config_ini_php['dbhost'] . ';port=' . $config_ini_php['dbport'] . ';dbname=' . $config_ini_php['dbname'], $config_ini_php['dbuser'], $config_ini_php['dbpass'], array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_CASE => PDO::CASE_LOWER, PDO::ATTR_AUTOCOMMIT => true));
    } catch (PDOException $ex) {
        $messages .= '<p>' . I18N::translate('The database reported the following error message:') . '</p>';
        $messages .= '<blockquote>' . $ex->getMessage() . '</blockquote>';
    }
}
?>
<!DOCTYPE html>
<html <?php 
echo I18N::htmlAttributes();
Exemplo n.º 19
0
 /**
  * Print a new fact box on details pages
  *
  * @param string $id the id of the person, family, source etc the fact will be added to
  * @param array $usedfacts an array of facts already used in this record
  * @param string $type the type of record INDI, FAM, SOUR etc
  */
 public static function printAddNewFact($id, $usedfacts, $type)
 {
     global $WT_TREE;
     // -- Add from clipboard
     if (is_array(Session::get('clipboard'))) {
         $newRow = true;
         foreach (array_reverse(Session::get('clipboard'), true) as $fact_id => $fact) {
             if ($fact["type"] == $type || $fact["type"] == 'all') {
                 if ($newRow) {
                     $newRow = false;
                     echo '<tr><td class="descriptionbox">';
                     echo I18N::translate('Add from clipboard'), '</td>';
                     echo '<td class="optionbox wrap"><form method="get" name="newFromClipboard" action="?" onsubmit="return false;">';
                     echo '<select id="newClipboardFact">';
                 }
                 echo '<option value="', Filter::escapeHtml($fact_id), '">', GedcomTag::getLabel($fact['fact']);
                 // TODO use the event class to store/parse the clipboard events
                 if (preg_match('/^2 DATE (.+)/m', $fact['factrec'], $match)) {
                     $tmp = new Date($match[1]);
                     echo '; ', $tmp->minimumDate()->format('%Y');
                 }
                 if (preg_match('/^2 PLAC ([^,\\n]+)/m', $fact['factrec'], $match)) {
                     echo '; ', $match[1];
                 }
                 echo '</option>';
             }
         }
         if (!$newRow) {
             echo '</select>';
             echo '&nbsp;&nbsp;<input type="button" value="', I18N::translate('Add'), "\" onclick=\"return paste_fact('{$id}', '#newClipboardFact');\"> ";
             echo '</form></td></tr>', "\n";
         }
     }
     // -- Add from pick list
     switch ($type) {
         case "INDI":
             $addfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
             $uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
             $quickfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
             break;
         case "FAM":
             $addfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
             $uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
             $quickfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
             break;
         case "SOUR":
             $addfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
             $uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
             $quickfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
             break;
         case "NOTE":
             $addfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
             $uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
             $quickfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
             break;
         case "REPO":
             $addfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
             $uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
             $quickfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
             break;
         default:
             return;
     }
     $addfacts = array_merge(self::checkFactUnique($uniquefacts, $usedfacts, $type), $addfacts);
     $quickfacts = array_intersect($quickfacts, $addfacts);
     $translated_addfacts = array();
     foreach ($addfacts as $addfact) {
         $translated_addfacts[$addfact] = GedcomTag::getLabel($addfact);
     }
     uasort($translated_addfacts, function ($x, $y) {
         return I18N::strcasecmp(I18N::translate($x), I18N::translate($y));
     });
     echo '<tr><td class="descriptionbox">';
     echo I18N::translate('Fact or event');
     echo '</td>';
     echo '<td class="optionbox wrap">';
     echo '<form method="get" name="newfactform" action="?" onsubmit="return false;">';
     echo '<select id="newfact" name="newfact">';
     echo '<option value="" disabled selected>' . I18N::translate('&lt;select&gt;') . '</option>';
     foreach ($translated_addfacts as $fact => $fact_name) {
         echo '<option value="', $fact, '">', $fact_name, '</option>';
     }
     if ($type == 'INDI' || $type == 'FAM') {
         echo '<option value="FACT">', I18N::translate('Custom fact'), '</option>';
         echo '<option value="EVEN">', I18N::translate('Custom event'), '</option>';
     }
     echo '</select>';
     echo '<input type="button" value="', I18N::translate('Add'), '" onclick="add_record(\'' . $id . '\', \'newfact\');">';
     echo '<span class="quickfacts">';
     foreach ($quickfacts as $fact) {
         echo '<a href="#" onclick="add_new_record(\'' . $id . '\', \'' . $fact . '\');return false;">', GedcomTag::getLabel($fact), '</a>';
     }
     echo '</span></form>';
     echo '</td></tr>';
 }
Exemplo n.º 20
0
?>
			</label>
			<input class="form-control" type="text" id="oldged" name="oldged" value="<?php 
echo Filter::escapeHtml($oldged);
?>
">
		</div>

		<div class="form-group col-xs-6 col-md-3">
			<label for="text">
				<?php 
echo I18N::translate('New data');
?>
			</label>
			<input class="form-control" type="text" id="newged" name="newged" value="<?php 
echo Filter::escapeHtml($newged);
?>
">
		</div>

		<div class="form-group col-xs-6 col-md-3">
			<label for="user">
				<?php 
echo I18N::translate('User');
?>
			</label>
			<?php 
echo FunctionsEdit::selectEditControl('user', $users_array, '', $user, 'class="form-control"');
?>
		</div>
Exemplo n.º 21
0
    /**
     * {@inhericDoc}
     * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
     */
    protected function renderContent()
    {
        if ($this->data->get('has_sosa', false)) {
            $table_id = $this->data->get('table_id');
            ?>
   
        
		<div id="sosa-fam-list" class="sosa-list">
			<table id="<?php 
            echo $table_id;
            ?>
">
				<thead>
					<tr>
						<th colspan="24">
							<div class="btn-toolbar">
								<div class="btn-group">
									<button
										type="button"
										data-filter-column="22"
										data-filter-value="N"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show individuals who are alive or couples where both partners are alive.');
            ?>
"
									>
									<?php 
            echo I18N::translate('Both alive');
            ?>
									</button>
									<button
										type="button"
										data-filter-column="22"
										data-filter-value="W"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show couples where only the female partner is deceased.');
            ?>
"
									>
									<?php 
            echo I18N::translate('Widower');
            ?>
									</button>
									<button
										type="button"
										data-filter-column="22"
										data-filter-value="H"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show couples where only the male partner is deceased.');
            ?>
"
									>
									<?php 
            echo I18N::translate('Widow');
            ?>
									</button>
									<button
										type="button"
										data-filter-column="22"
										data-filter-value="Y"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show individuals who are dead or couples where both partners are deceased.');
            ?>
"
									>
									<?php 
            echo I18N::translate('Both dead');
            ?>
									</button>
								</div>
								<div class="btn-group">
									<button
										type="button"
										data-filter-column="23"
										data-filter-value="R"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show “roots” couples or individuals.  These individuals may also be called “patriarchs”.  They are individuals who have no parents recorded in the database.');
            ?>
"
									>
									<?php 
            echo I18N::translate('Roots');
            ?>
									</button>
									<button
										type="button"
										data-filter-column="23"
										data-filter-value="L"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show “leaves” couples or individuals.  These are individuals who are alive but have no children recorded in the database.');
            ?>
"
									>
									<?php 
            echo I18N::translate('Leaves');
            ?>
									</button>
								</div>
								<div class="btn-group">
									<button
										type="button"
										data-filter-column="21"
										data-filter-value="U"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show couples with an unknown marriage date.');
            ?>
"
									>
									<?php 
            echo GedcomTag::getLabel('MARR');
            ?>
									</button>
									<button
										type="button"
										data-filter-column="21"
										data-filter-value="YES"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show couples who married more than 100 years ago.');
            ?>
"
									>
									<?php 
            echo GedcomTag::getLabel('MARR');
            ?>
&gt;100
									</button>
									<button
										type="button"
										data-filter-column="21"
										data-filter-value="Y100"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show couples who married within the last 100 years.');
            ?>
"
									>
									<?php 
            echo GedcomTag::getLabel('MARR');
            ?>
&lt;=100
									</button>
									<button
										type="button"
										data-filter-column="21"
										data-filter-value="D"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show divorced couples.');
            ?>
"
									>
									<?php 
            echo GedcomTag::getLabel('DIV');
            ?>
									</button>
									<button
										type="button"
										data-filter-column="21"
										data-filter-value="M"
										class="ui-state-default"
										title="<?php 
            echo I18N::translate('Show couples where either partner married more than once.');
            ?>
"
									>
									<?php 
            echo I18N::translate('Multiple marriages');
            ?>
									</button>
								</div>
							</div>
						</th>
					</tr>
					<tr>
						<th><?php 
            echo I18N::translate('Sosa');
            ?>
</th>
						<th>SOSA</th>
						<th><?php 
            echo GedcomTag::getLabel('GIVN');
            ?>
</th>
						<th><?php 
            echo GedcomTag::getLabel('SURN');
            ?>
</th>
						<th>HUSB:GIVN_SURN</th>
						<th>HUSB:SURN_GIVN</th>
						<th><?php 
            echo GedcomTag::getLabel('AGE');
            ?>
</th>
						<th>AGE</th>
						<th><?php 
            echo GedcomTag::getLabel('GIVN');
            ?>
</th>
						<th><?php 
            echo GedcomTag::getLabel('SURN');
            ?>
</th>
						<th>WIFE:GIVN_SURN</th>
						<th>WIFE:SURN_GIVN</th>
						<th><?php 
            echo GedcomTag::getLabel('AGE');
            ?>
</th>
						<th>AGE</th>
						<th><?php 
            echo GedcomTag::getLabel('MARR');
            ?>
</th>
						<th>MARR:DATE</th>
						<th><?php 
            echo GedcomTag::getLabel('PLAC');
            ?>
</th>';
						<?php 
            if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
                ?>
						<th><i class="icon-source" title="<?php 
                echo I18N::translate('Sourced marriage');
                ?>
" border="0"></i></th>
						<th>SORT_MARRSC</th>
						<?php 
            } else {
                ?>
						<th>&nbsp;</th>
						<th></th>
						<?php 
            }
            ?>
						<th><i class="icon-children" title="<?php 
            echo I18N::translate('Children');
            ?>
"></i></th>
						<th>NCHI</th>
						<th>MARR</th>
						<th>DEAT</th>
						<th>TREE</th>
					</tr>
				</thead>
				<tbody>
			
			<?php 
            foreach ($this->data->get('sosa_list') as $sosa => $family) {
                /** @var \Fisharebest\Webtrees\Family $person */
                //PERSO Create decorator for Family
                $dfamily = new Family($family);
                $husb = $family->getHusband();
                if (is_null($husb)) {
                    $husb = new Individual('H', '0 @H@ INDI', null, $family->getTree());
                }
                $dhusb = new \MyArtJaub\Webtrees\Individual($husb);
                $wife = $family->getWife();
                if (is_null($wife)) {
                    $wife = new Individual('W', '0 @W@ INDI', null, $family->getTree());
                }
                $dwife = new \MyArtJaub\Webtrees\Individual($wife);
                $mdate = $family->getMarriageDate();
                if ($family->isPendingAddtion()) {
                    $class = ' class="new"';
                } elseif ($family->isPendingDeletion()) {
                    $class = ' class="old"';
                } else {
                    $class = '';
                }
                ?>
			
        		<tr <?php 
                echo $class;
                ?>
>
        			<td class="transparent"><?php 
                echo I18N::translate('%1$d/%2$d', $sosa, ($sosa + 1) % 10);
                ?>
</td>
        			<td class="transparent"><?php 
                echo $sosa;
                ?>
</td>
        			<!--  HUSBAND -->
        			<td colspan="2">
        			<?php 
                foreach ($husb->getAllNames() as $num => $name) {
                    if ($name['type'] == 'NAME') {
                        $title = '';
                    } else {
                        $title = 'title="' . strip_tags(GedcomTag::getLabel($name['type'], $husb)) . '"';
                    }
                    if ($num == $husb->getPrimaryName()) {
                        $class = ' class="name2"';
                        $sex_image = $husb->getSexImage();
                        list($surn, $givn) = explode(',', $name['sort']);
                    } else {
                        $class = '';
                        $sex_image = '';
                    }
                    ?>
        				<a <?php 
                    echo $title . ' ' . $class;
                    ?>
 href="<?php 
                    echo $husb->getHtmlUrl();
                    ?>
">
        					<?php 
                    echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']);
                    ?>
        				</a>
        				<?php 
                    echo $sex_image . FunctionsPrint::formatSosaNumbers($dhusb->getSosaNumbers(), 1, 'smaller');
                    ?>
        				<br/>
            		<?php 
                }
                echo $husb->getPrimaryParentsNames('parents details1', 'none');
                ?>
            		</td>
            		<!-- Dummy column to match colspan in header -->
            		<td style="display:none;"></td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn));
                ?>
            		</td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn));
                ?>
            		</td>
            		<?php 
                $hdate = $husb->getBirthDate();
                ?>
            		<td><?php 
                Date::getAge($hdate, $mdate, 2);
                ?>
</td>
            		<td><?php 
                Date::getAge($hdate, $mdate, 1);
                ?>
</td>
            		<!--  WIFE -->
        			<td colspan="2">
        			<?php 
                foreach ($wife->getAllNames() as $num => $name) {
                    if ($name['type'] == 'NAME') {
                        $title = '';
                    } else {
                        $title = 'title="' . strip_tags(GedcomTag::getLabel($name['type'], $wife)) . '"';
                    }
                    if ($num == $wife->getPrimaryName()) {
                        $class = ' class="name2"';
                        $sex_image = $wife->getSexImage();
                        list($surn, $givn) = explode(',', $name['sort']);
                    } else {
                        $class = '';
                        $sex_image = '';
                    }
                    ?>
        				<a <?php 
                    echo $title . ' ' . $class;
                    ?>
 href="<?php 
                    echo $wife->getHtmlUrl();
                    ?>
">
        					<?php 
                    echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']);
                    ?>
        				</a>
        				<?php 
                    echo $sex_image . FunctionsPrint::formatSosaNumbers($dwife->getSosaNumbers(), 1, 'smaller');
                    ?>
        				<br/>
            		<?php 
                }
                echo $wife->getPrimaryParentsNames('parents details1', 'none');
                ?>
            		</td>
            		<!-- Dummy column to match colspan in header -->
            		<td style="display:none;"></td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn));
                ?>
            		</td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn));
                ?>
            		</td>
            		<?php 
                $wdate = $wife->getBirthDate();
                ?>
            		<td><?php 
                Date::getAge($wdate, $mdate, 2);
                ?>
</td>
            		<td><?php 
                Date::getAge($wdate, $mdate, 1);
                ?>
</td>
            		<td><?php 
                if ($marriage_dates = $family->getAllMarriageDates()) {
                    foreach ($marriage_dates as $n => $marriage_date) {
                        if ($n) {
                            echo '<br>';
                        }
                        ?>
        					<div><?php 
                        echo $marriage_date->display(true);
                        ?>
</div>
        				<?php 
                    }
                } elseif ($family->getFacts('_NMR')) {
                    echo I18N::translate('no');
                } elseif ($family->getFacts('MARR')) {
                    echo I18N::translate('yes');
                } else {
                    echo '&nbsp;';
                }
                ?>
            		</td>
            		<td><?php 
                echo $marriage_dates ? $marriage_date->julianDay() : 0;
                ?>
</td>
            		<td><?php 
                foreach ($family->getAllMarriagePlaces() as $n => $marriage_place) {
                    $tmp = new Place($marriage_place, $family->getTree());
                    if ($n) {
                        ?>
<br><?php 
                    }
                    ?>
        				<a href="'<?php 
                    echo $tmp->getURL();
                    ?>
" title="<?php 
                    echo strip_tags($tmp->getFullName());
                    ?>
">
        					<?php 
                    echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName());
                    ?>
        				</a>
        			<?php 
                }
                ?>
        			</td>
        			<?php 
                if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
                    $isMSourced = $dfamily->isMarriageSourced();
                    ?>
				   	<td><?php 
                    echo FunctionsPrint::formatIsSourcedIcon('E', $isMSourced, 'MARR', 1, 'medium');
                    ?>
</td>
					<td><?php 
                    echo $isMSourced;
                    ?>
</td>
					<?php 
                } else {
                    ?>
					<td>&nbsp;</td>
					<td></td>
					<?php 
                }
                ?>
					<?php 
                $nchi = $family->getNumberOfChildren();
                ?>
					<td><?php 
                echo I18N::number($nchi);
                ?>
</td>
					<td><?php 
                echo $nchi;
                ?>
</td>
					<td><?php 
                if (!$mdate->isOK()) {
                    echo 'U';
                } else {
                    if (Date::compare($mdate, new Date(date('Y') - 100)) > 0) {
                        echo 'Y100';
                    } else {
                        echo 'YES';
                    }
                }
                if ($family->getFacts(WT_EVENTS_DIV)) {
                    echo 'D';
                }
                if (count($husb->getSpouseFamilies()) > 1 || count($wife->getSpouseFamilies()) > 1) {
                    echo 'M';
                }
                ?>
					</td>
					<td><?php 
                if ($husb->isDead() && $wife->isDead()) {
                    echo 'Y';
                }
                if ($husb->isDead() && !$wife->isDead()) {
                    if ($wife->getSex() == 'F') {
                        echo 'H';
                    }
                    if ($wife->getSex() == 'M') {
                        echo 'W';
                    }
                    // male partners
                }
                if (!$husb->isDead() && $wife->isDead()) {
                    if ($husb->getSex() == 'M') {
                        echo 'W';
                    }
                    if ($husb->getSex() == 'F') {
                        echo 'H';
                    }
                    // female partners
                }
                if (!$husb->isDead() && !$wife->isDead()) {
                    echo 'N';
                }
                ?>
        			</td>
        			<td><?php 
                if (!$husb->getChildFamilies() && !$wife->getChildFamilies()) {
                    echo 'R';
                } elseif (!$husb->isDead() && !$wife->isDead() && $family->getNumberOfChildren() < 1) {
                    echo 'L';
                } else {
                    echo '&nbsp;';
                }
                ?>
			         </td>
				</tr>
        	<?php 
            }
            ?>
        	</tbody>
        	<tfoot>
				<tr>
					<th colspan="24">
						<div class="btn-toolbar">
							<div class="btn-group">
								<button type="button" class="ui-state-default btn-toggle-parents">
									<?php 
            echo I18N::translate('Show parents');
            ?>
								</button>
								<button id="btn-toggle-statistics-<?php 
            echo $table_id;
            ?>
" type="button" class="ui-state-default btn-toggle-statistics">
									<?php 
            echo I18N::translate('Show statistics charts');
            ?>
								</button>
							</div>
						</div>
					</th>
				</tr>
			</tfoot>
        	</table>
				<div id="fam_list_table-charts_<?php 
            echo $table_id;
            ?>
" style="display:none">
					<table class="list-charts">
						<tr>
							<td><?php 
            echo $this->data->get('chart_births');
            ?>
</td>
							<td><?php 
            echo $this->data->get('chart_marriages');
            ?>
</td>
						</tr>
						<tr>
							<td colspan="2"><?php 
            echo $this->data->get('chart_ages');
            ?>
</td>
						</tr>
					</table>
				</div>
			</div>
		<?php 
        } else {
            ?>
        <p class="warning"><?php 
            echo I18N::translate('No family has been found for generation %d', $this->data->get('generation'));
            ?>
</p>
        <?php 
        }
    }
Exemplo n.º 22
0
    /**
     * Places administration.
     */
    private function adminPlaces()
    {
        global $WT_TREE;
        $action = Filter::get('action');
        $parent = Filter::get('parent');
        $inactive = Filter::getBool('inactive');
        $deleteRecord = Filter::get('deleteRecord');
        if (!isset($parent)) {
            $parent = 0;
        }
        $controller = new PageController();
        $controller->restrictAccess(Auth::isAdmin());
        if ($action == 'ExportFile' && Auth::isAdmin()) {
            $tmp = $this->placeIdToHierarchy($parent);
            $maxLevel = $this->getHighestLevel();
            if ($maxLevel > 8) {
                $maxLevel = 8;
            }
            $tmp[0] = 'places';
            $outputFileName = preg_replace('/[:;\\/\\\\(\\)\\{\\}\\[\\] $]/', '_', implode('-', $tmp)) . '.csv';
            header('Content-Type: application/octet-stream');
            header('Content-Disposition: attachment; filename="' . $outputFileName . '"');
            echo '"', I18N::translate('Level'), '";"', I18N::translate('Country'), '";';
            if ($maxLevel > 0) {
                echo '"', I18N::translate('State'), '";';
            }
            if ($maxLevel > 1) {
                echo '"', I18N::translate('County'), '";';
            }
            if ($maxLevel > 2) {
                echo '"', I18N::translate('City'), '";';
            }
            if ($maxLevel > 3) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 4) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 5) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 6) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 7) {
                echo '"', I18N::translate('Place'), '";';
            }
            echo '"', I18N::translate('Longitude'), '";"', I18N::translate('Latitude'), '";';
            echo '"', I18N::translate('Zoom level'), '";"', I18N::translate('Icon'), '";', WT_EOL;
            $this->outputLevel($parent);
            exit;
        }
        $controller->setPageTitle(I18N::translate('Google Maps™'))->pageHeader();
        ?>
		<ol class="breadcrumb small">
			<li><a href="admin.php"><?php 
        echo I18N::translate('Control panel');
        ?>
</a></li>
			<li><a href="admin_modules.php"><?php 
        echo I18N::translate('Module administration');
        ?>
</a></li>
			<li class="active"><?php 
        echo $controller->getPageTitle();
        ?>
</li>
		</ol>

		<ul class="nav nav-tabs nav-justified" role="tablist">
			<li role="presentation">
				<a href="?mod=googlemap&amp;mod_action=admin_config" role="tab">
					<?php 
        echo I18N::translate('Google Maps™ preferences');
        ?>
				</a>
			</li>
			<li role="presentation" class="active">
				<a href="#">
					<?php 
        echo I18N::translate('Geographic data');
        ?>
				</a>
			</li>
			<li role="presentation">
				<a href="?mod=googlemap&amp;mod_action=admin_placecheck">
					<?php 
        echo I18N::translate('Place check');
        ?>
				</a>
			</li>
		</ul>

		<h2><?php 
        echo I18N::translate('Geographic data');
        ?>
</h2>
		<?php 
        if ($action == 'ImportGedcom') {
            $placelist = array();
            $j = 0;
            $gedcom_records = Database::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_file=? UNION ALL SELECT f_gedcom FROM `##families` WHERE f_file=?")->execute(array($WT_TREE->getTreeId(), $WT_TREE->getTreeId()))->fetchOneColumn();
            foreach ($gedcom_records as $gedrec) {
                $i = 1;
                $placerec = Functions::getSubRecord(2, '2 PLAC', $gedrec, $i);
                while (!empty($placerec)) {
                    if (preg_match("/2 PLAC (.+)/", $placerec, $match)) {
                        $placelist[$j] = array();
                        $placelist[$j]['place'] = trim($match[1]);
                        if (preg_match("/4 LATI (.*)/", $placerec, $match)) {
                            $placelist[$j]['lati'] = trim($match[1]);
                            if ($placelist[$j]['lati'][0] != 'N' && $placelist[$j]['lati'][0] != 'S') {
                                if ($placelist[$j]['lati'] < 0) {
                                    $placelist[$j]['lati'][0] = 'S';
                                } else {
                                    $placelist[$j]['lati'] = 'N' . $placelist[$j]['lati'];
                                }
                            }
                        } else {
                            $placelist[$j]['lati'] = null;
                        }
                        if (preg_match("/4 LONG (.*)/", $placerec, $match)) {
                            $placelist[$j]['long'] = trim($match[1]);
                            if ($placelist[$j]['long'][0] != 'E' && $placelist[$j]['long'][0] != 'W') {
                                if ($placelist[$j]['long'] < 0) {
                                    $placelist[$j]['long'][0] = 'W';
                                } else {
                                    $placelist[$j]['long'] = 'E' . $placelist[$j]['long'];
                                }
                            }
                        } else {
                            $placelist[$j]['long'] = null;
                        }
                        $j = $j + 1;
                    }
                    $i = $i + 1;
                    $placerec = Functions::getSubRecord(2, '2 PLAC', $gedrec, $i);
                }
            }
            asort($placelist);
            $prevPlace = '';
            $prevLati = '';
            $prevLong = '';
            $placelistUniq = array();
            $j = 0;
            foreach ($placelist as $k => $place) {
                if ($place['place'] != $prevPlace) {
                    $placelistUniq[$j] = array();
                    $placelistUniq[$j]['place'] = $place['place'];
                    $placelistUniq[$j]['lati'] = $place['lati'];
                    $placelistUniq[$j]['long'] = $place['long'];
                    $j = $j + 1;
                } elseif ($place['place'] == $prevPlace && ($place['lati'] != $prevLati || $place['long'] != $prevLong)) {
                    if ($placelistUniq[$j - 1]['lati'] == 0 || $placelistUniq[$j - 1]['long'] == 0) {
                        $placelistUniq[$j - 1]['lati'] = $place['lati'];
                        $placelistUniq[$j - 1]['long'] = $place['long'];
                    } elseif ($place['lati'] != '0' || $place['long'] != '0') {
                        echo 'Difference: previous value = ', $prevPlace, ', ', $prevLati, ', ', $prevLong, ' current = ', $place['place'], ', ', $place['lati'], ', ', $place['long'], '<br>';
                    }
                }
                $prevPlace = $place['place'];
                $prevLati = $place['lati'];
                $prevLong = $place['long'];
            }
            $highestIndex = $this->getHighestIndex();
            $default_zoom_level = array(4, 7, 10, 12);
            foreach ($placelistUniq as $k => $place) {
                $parent = preg_split('/ *, */', $place['place']);
                $parent = array_reverse($parent);
                $parent_id = 0;
                for ($i = 0; $i < count($parent); $i++) {
                    if (!isset($default_zoom_level[$i])) {
                        $default_zoom_level[$i] = $default_zoom_level[$i - 1];
                    }
                    $escparent = $parent[$i];
                    if ($escparent == '') {
                        $escparent = 'Unknown';
                    }
                    $row = Database::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ?")->execute(array($i, $parent_id, $escparent))->fetchOneRow();
                    if ($i < count($parent) - 1) {
                        // Create higher-level places, if necessary
                        if (empty($row)) {
                            $highestIndex++;
                            Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom) VALUES (?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $default_zoom_level[$i]));
                            echo Filter::escapeHtml($escparent), '<br>';
                            $parent_id = $highestIndex;
                        } else {
                            $parent_id = $row->pl_id;
                        }
                    } else {
                        // Create lowest-level place, if necessary
                        if (empty($row->pl_id)) {
                            $highestIndex++;
                            Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom) VALUES (?, ?, ?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $default_zoom_level[$i]));
                            echo Filter::escapeHtml($escparent), '<br>';
                        } else {
                            if (empty($row->pl_long) && empty($row->pl_lati) && $place['lati'] != '0' && $place['long'] != '0') {
                                Database::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=? WHERE pl_id=?")->execute(array($place['lati'], $place['long'], $row->pl_id));
                                echo Filter::escapeHtml($escparent), '<br>';
                            }
                        }
                    }
                }
            }
            $parent = 0;
        }
        if ($action === 'ImportFile') {
            $placefiles = $this->findFiles(WT_MODULES_DIR . 'googlemap/extra');
            sort($placefiles);
            ?>
		<form class="form-horizontal" method="post" enctype="multipart/form-data" id="importfile" name="importfile" action="module.php?mod=googlemap&amp;mod_action=admin_places&amp;action=ImportFile2">

			<!-- PLACES FILE -->
			<div class="form-group">
				<label class="control-label col-sm-4" for="placesfile">
					<?php 
            echo I18N::translate('File containing places (CSV)');
            ?>
				</label>
				<div class="col-sm-8">
					<div class="btn btn-default">
					<input id="placesfile" type="file" name="placesfile">
					</div>
				</div>
			</div>

			<!-- LOCAL FILE -->
			<?php 
            if (count($placefiles) > 0) {
                ?>
			<div class="form-group">
				<label class="control-label col-sm-4" for="localfile">
					<?php 
                echo I18N::translate('Server file containing places (CSV)');
                ?>
				</label>
				<div class="col-sm-8">
					<div class="input-group">
						<span class="input-group-addon">
							<?php 
                echo WT_MODULES_DIR . 'googlemap/extra/';
                ?>
						</span>
						<?php 
                foreach ($placefiles as $p => $placefile) {
                    unset($placefiles[$p]);
                    $p = Filter::escapeHtml($placefile);
                    if (substr($placefile, 0, 1) == "/") {
                        $placefiles[$p] = substr($placefile, 1);
                    } else {
                        $placefiles[$p] = $placefile;
                    }
                }
                echo FunctionsEdit::selectEditControl('localfile', $placefiles, '', '', 'class="form-control"');
                ?>
					</div>
				</div>
			</div>
			<?php 
            }
            ?>

			<!-- CLEAR DATABASE -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-4">
					<?php 
            echo I18N::translate('Delete all existing geographic data before importing the file.');
            ?>
				</legend>
				<div class="col-sm-8">
					<?php 
            echo FunctionsEdit::editFieldYesNo('cleardatabase', 0, 'class="radio-inline"');
            ?>
				</div>
			</fieldset>

			<!-- UPDATE ONLY -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-4">
					<?php 
            echo I18N::translate('Do not create new locations, just import coordinates for existing locations.');
            ?>
				</legend>
				<div class="col-sm-8">
					<?php 
            echo FunctionsEdit::editFieldYesNo('updateonly', 0, 'class="radio-inline"');
            ?>
				</div>
			</fieldset>

			<!-- OVERWRITE DATA -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-4">
					<?php 
            echo I18N::translate('Overwrite existing coordinates.');
            ?>
				</legend>
				<div class="col-sm-8">
					<?php 
            echo FunctionsEdit::editFieldYesNo('overwritedata', 0, 'class="radio-inline"');
            ?>
				</div>
			</fieldset>

			<!-- SAVE BUTTON -->
			<div class="form-group">
				<div class="col-sm-offset-4 col-sm-8">
					<button type="submit" class="btn btn-primary">
						<i class="fa fa-check"></i>
						<?php 
            echo I18N::translate('Continue adding');
            ?>
					</button>
				</div>
			</div>
		</form>
		<?php 
            exit;
        }
        if ($action === 'ImportFile2') {
            $country_names = array();
            $stats = new Stats($WT_TREE);
            foreach ($stats->iso3166() as $key => $value) {
                $country_names[$key] = I18N::translate($key);
            }
            if (Filter::postBool('cleardatabase')) {
                Database::exec("DELETE FROM `##placelocation` WHERE 1=1");
            }
            if (!empty($_FILES['placesfile']['tmp_name'])) {
                $lines = file($_FILES['placesfile']['tmp_name']);
            } elseif (!empty($_REQUEST['localfile'])) {
                $lines = file(WT_MODULES_DIR . 'googlemap/extra' . $_REQUEST['localfile']);
            }
            // Strip BYTE-ORDER-MARK, if present
            if (!empty($lines[0]) && substr($lines[0], 0, 3) === WT_UTF8_BOM) {
                $lines[0] = substr($lines[0], 3);
            }
            asort($lines);
            $highestIndex = $this->getHighestIndex();
            $placelist = array();
            $j = 0;
            $maxLevel = 0;
            foreach ($lines as $p => $placerec) {
                $fieldrec = explode(';', $placerec);
                if ($fieldrec[0] > $maxLevel) {
                    $maxLevel = $fieldrec[0];
                }
            }
            $fields = count($fieldrec);
            $set_icon = true;
            if (!is_dir(WT_MODULES_DIR . 'googlemap/places/flags/')) {
                $set_icon = false;
            }
            foreach ($lines as $p => $placerec) {
                $fieldrec = explode(';', $placerec);
                if (is_numeric($fieldrec[0]) && $fieldrec[0] <= $maxLevel) {
                    $placelist[$j] = array();
                    $placelist[$j]['place'] = '';
                    for ($ii = $fields - 4; $ii > 1; $ii--) {
                        if ($fieldrec[0] > $ii - 2) {
                            $placelist[$j]['place'] .= $fieldrec[$ii] . ',';
                        }
                    }
                    foreach ($country_names as $countrycode => $countryname) {
                        if ($countrycode == strtoupper($fieldrec[1])) {
                            $fieldrec[1] = $countryname;
                            break;
                        }
                    }
                    $placelist[$j]['place'] .= $fieldrec[1];
                    $placelist[$j]['long'] = $fieldrec[$fields - 4];
                    $placelist[$j]['lati'] = $fieldrec[$fields - 3];
                    $placelist[$j]['zoom'] = $fieldrec[$fields - 2];
                    if ($set_icon) {
                        $placelist[$j]['icon'] = trim($fieldrec[$fields - 1]);
                    } else {
                        $placelist[$j]['icon'] = '';
                    }
                    $j = $j + 1;
                }
            }
            $prevPlace = '';
            $prevLati = '';
            $prevLong = '';
            $placelistUniq = array();
            $j = 0;
            foreach ($placelist as $k => $place) {
                if ($place['place'] != $prevPlace) {
                    $placelistUniq[$j] = array();
                    $placelistUniq[$j]['place'] = $place['place'];
                    $placelistUniq[$j]['lati'] = $place['lati'];
                    $placelistUniq[$j]['long'] = $place['long'];
                    $placelistUniq[$j]['zoom'] = $place['zoom'];
                    $placelistUniq[$j]['icon'] = $place['icon'];
                    $j = $j + 1;
                } elseif ($place['place'] == $prevPlace && ($place['lati'] != $prevLati || $place['long'] != $prevLong)) {
                    if ($placelistUniq[$j - 1]['lati'] == 0 || $placelistUniq[$j - 1]['long'] == 0) {
                        $placelistUniq[$j - 1]['lati'] = $place['lati'];
                        $placelistUniq[$j - 1]['long'] = $place['long'];
                        $placelistUniq[$j - 1]['zoom'] = $place['zoom'];
                        $placelistUniq[$j - 1]['icon'] = $place['icon'];
                    } elseif ($place['lati'] != '0' || $place['long'] != '0') {
                        echo 'Difference: previous value = ', $prevPlace, ', ', $prevLati, ', ', $prevLong, ' current = ', $place['place'], ', ', $place['lati'], ', ', $place['long'], '<br>';
                    }
                }
                $prevPlace = $place['place'];
                $prevLati = $place['lati'];
                $prevLong = $place['long'];
            }
            $default_zoom_level = array();
            $default_zoom_level[0] = 4;
            $default_zoom_level[1] = 7;
            $default_zoom_level[2] = 10;
            $default_zoom_level[3] = 12;
            foreach ($placelistUniq as $k => $place) {
                $parent = explode(',', $place['place']);
                $parent = array_reverse($parent);
                $parent_id = 0;
                for ($i = 0; $i < count($parent); $i++) {
                    $escparent = $parent[$i];
                    if ($escparent == '') {
                        $escparent = 'Unknown';
                    }
                    $row = Database::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom, pl_icon FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place")->execute(array($i, $parent_id, $escparent))->fetchOneRow();
                    if (empty($row)) {
                        // this name does not yet exist: create entry
                        if (!Filter::postBool('updateonly')) {
                            $highestIndex = $highestIndex + 1;
                            if ($i + 1 == count($parent)) {
                                $zoomlevel = $place['zoom'];
                            } elseif (isset($default_zoom_level[$i])) {
                                $zoomlevel = $default_zoom_level[$i];
                            } else {
                                $zoomlevel = $this->getSetting('GM_MAX_ZOOM');
                            }
                            if ($place['lati'] == '0' || $place['long'] == '0' || $i + 1 < count($parent)) {
                                Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $zoomlevel, $place['icon']));
                            } else {
                                //delete leading zero
                                $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $place['lati']);
                                $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $place['long']);
                                if ($pl_lati >= 0) {
                                    $place['lati'] = 'N' . abs($pl_lati);
                                } elseif ($pl_lati < 0) {
                                    $place['lati'] = 'S' . abs($pl_lati);
                                }
                                if ($pl_long >= 0) {
                                    $place['long'] = 'E' . abs($pl_long);
                                } elseif ($pl_long < 0) {
                                    $place['long'] = 'W' . abs($pl_long);
                                }
                                Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $zoomlevel, $place['icon']));
                            }
                            $parent_id = $highestIndex;
                        }
                    } else {
                        $parent_id = $row->pl_id;
                        if (Filter::postBool('overwritedata') && $i + 1 == count($parent)) {
                            Database::prepare("UPDATE `##placelocation` SET pl_lati = ?, pl_long = ?, pl_zoom = ?, pl_icon = ? WHERE pl_id = ?")->execute(array($place['lati'], $place['long'], $place['zoom'], $place['icon'], $parent_id));
                        } else {
                            // Update only if existing data is missing
                            if (!$row->pl_long && !$row->pl_lati) {
                                Database::prepare("UPDATE `##placelocation` SET pl_lati = ?, pl_long = ? WHERE pl_id = ?")->execute(array($place['lati'], $place['long'], $parent_id));
                            }
                            if (!$row->pl_icon && $place['icon']) {
                                Database::prepare("UPDATE `##placelocation` SET pl_icon = ? WHERE pl_id = ?")->execute(array($place['icon'], $parent_id));
                            }
                        }
                    }
                }
            }
            $parent = 0;
        }
        if ($action == 'DeleteRecord') {
            $exists = Database::prepare("SELECT 1 FROM `##placelocation` WHERE pl_parent_id=?")->execute(array($deleteRecord))->fetchOne();
            if (!$exists) {
                Database::prepare("DELETE FROM `##placelocation` WHERE pl_id=?")->execute(array($deleteRecord));
            } else {
                echo '<table class="facts_table"><tr><td>', I18N::translate('Location not removed: this location contains sub-locations'), '</td></tr></table>';
            }
        }
        ?>
		<script>
		function updateList(inactive) {
			window.location.href='<?php 
        if (strstr($_SERVER['REQUEST_URI'], '&inactive', true)) {
            $uri = strstr($_SERVER['REQUEST_URI'], '&inactive', true);
        } else {
            $uri = $_SERVER['REQUEST_URI'];
        }
        echo $uri, '&inactive=';
        ?>
'+inactive;
		}

		function edit_place_location(placeid) {
			window.open('module.php?mod=googlemap&mod_action=places_edit&action=update&placeid='+placeid, '_blank', gmap_window_specs);
			return false;
		}

		function add_place_location(placeid) {
			window.open('module.php?mod=googlemap&mod_action=places_edit&action=add&placeid='+placeid, '_blank', gmap_window_specs);
			return false;
		}

		function delete_place(placeid) {
			var answer=confirm('<?php 
        echo I18N::translate('Remove this location?');
        ?>
');
			if (answer == true) {
				window.location = '<?php 
        echo Functions::getQueryUrl(array('action' => 'DeleteRecord'));
        ?>
&action=DeleteRecord&deleteRecord=' + placeid;
			}
		}
		</script>
		<p id="gm_breadcrumb">
			<?php 
        $where_am_i = $this->placeIdToHierarchy($parent);
        foreach (array_reverse($where_am_i, true) as $id => $place) {
            if ($id == $parent) {
                if ($place != 'Unknown') {
                    echo Filter::escapeHtml($place);
                } else {
                    echo I18N::translate('unknown');
                }
            } else {
                echo '<a href="module.php?mod=googlemap&mod_action=admin_places&parent=', $id, '&inactive=', $inactive, '">';
                if ($place != 'Unknown') {
                    echo Filter::escapeHtml($place), '</a>';
                } else {
                    echo I18N::translate('unknown'), '</a>';
                }
            }
            echo ' - ';
        }
        ?>
			<a href="module.php?mod=googlemap&mod_action=admin_places&parent=0&inactive=', $inactive, '"><?php 
        echo I18N::translate('Top level');
        ?>
</a>
		</p>

		<form class="form-inline" name="active" method="post" action="module.php?mod=googlemap&mod_action=admin_places&parent=', $parent, '&inactive=', $inactive, '">
			<div class="checkbox">
				<label for="inactive">
				   <?php 
        echo FunctionsEdit::checkbox('inactive', $inactive, 'onclick="updateList(this.checked)"');
        ?>
				   <?php 
        echo I18N::translate('Show inactive places');
        ?>
				</label>
			</div>
			<p class="small text-muted">
				<?php 
        echo I18N::translate('By default, the list shows only those places which can be found in your family trees.  You may have details for other places, such as those imported in bulk from an external file.  Selecting this option will show all places, including ones that are not currently used.');
        ?>
				<?php 
        echo I18N::translate('If you have a large number of inactive places, it can be slow to generate the list.');
        ?>
			</p>
		</form>

		<?php 
        $placelist = $this->getPlaceListLocation($parent, $inactive);
        echo '<div class="gm_plac_edit">';
        echo '<table class="table table-bordered table-condensed table-hover"><tr>';
        echo '<th>', GedcomTag::getLabel('PLAC'), '</th>';
        echo '<th>', GedcomTag::getLabel('LATI'), '</th>';
        echo '<th>', GedcomTag::getLabel('LONG'), '</th>';
        echo '<th>', I18N::translate('Zoom level'), '</th>';
        echo '<th>', I18N::translate('Icon'), '</th>';
        echo '<th>';
        echo I18N::translate('Edit'), '</th><th>', I18N::translate('Delete'), '</th></tr>';
        if (count($placelist) == 0) {
            echo '<tr><td colspan="7">', I18N::translate('No places found'), '</td></tr>';
        }
        foreach ($placelist as $place) {
            echo '<tr><td><a href="module.php?mod=googlemap&mod_action=admin_places&parent=', $place['place_id'], '&inactive=', $inactive, '">';
            if ($place['place'] != 'Unknown') {
                echo Filter::escapeHtml($place['place']), '</a></td>';
            } else {
                echo I18N::translate('unknown'), '</a></td>';
            }
            echo '<td>', $place['lati'], '</td>';
            echo '<td>', $place['long'], '</td>';
            echo '<td>', $place['zoom'], '</td>';
            echo '<td>';
            if ($place['icon']) {
                echo '<img src="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/', $place['icon'], '" width="25" height="15">';
            } else {
                if ($place['lati'] || $place['long']) {
                    echo '<img src="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/mm_20_red.png">';
                } else {
                    echo '<img src="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/mm_20_yellow.png">';
                }
            }
            echo '</td>';
            echo '<td class="narrow"><a href="#" onclick="edit_place_location(', $place['place_id'], ');return false;" class="icon-edit" title="', I18N::translate('Edit'), '"></a></td>';
            $noRows = Database::prepare("SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id=?")->execute(array($place['place_id']))->fetchOne();
            if ($noRows == 0) {
                ?>
				<td><a href="#" onclick="delete_place(<?php 
                echo $place['place_id'];
                ?>
);return false;" class="icon-delete" title="<?php 
                echo I18N::translate('Remove');
                ?>
"></a></td>
		<?php 
            } else {
                ?>
				<td><i class="icon-delete-grey"></i></td>
		<?php 
            }
            ?>
			</tr>
			<?php 
        }
        ?>
		</table>
		</div>

		<hr>
		<form class="form-horizontal" action="?" onsubmit="add_place_location(this.parent_id.options[this.parent_id.selectedIndex].value); return false;">
			<div class="form-group">
				<label class="form-control-static col-sm-4" for="parent_id">
					<?php 
        echo I18N::translate('Add a new geographic location');
        ?>
				</label>
				<div class="col-sm-8">
					<div class="col-sm-6">
						<?php 
        echo FunctionsEdit::selectEditControl('parent_id', $where_am_i, I18N::translate('Top level'), $parent, 'class="form-control"');
        ?>
					</div>
					<button type="submit" class="btn btn-default">
						<i class="fa fa-plus"></i>
						<?php 
        echo I18N::translate('Add');
        ?>
					</button>
				</div>
			</div>
		</form>

		<form class="form-horizontal" action="module.php" method="get">
			<input type="hidden" name="mod" value="googlemap">
			<input type="hidden" name="mod_action" value="admin_places">
			<input type="hidden" name="action" value="ImportGedcom">
			<div class="form-group">
				<label class="form-control-static col-sm-4" for="ged">
					<?php 
        echo I18N::translate('Import all places from a family tree');
        ?>
				</label>
				<div class="col-sm-8">
					<div class="col-sm-6">
						<?php 
        echo FunctionsEdit::selectEditControl('ged', Tree::getNameList(), null, $WT_TREE->getName(), 'class="form-control"');
        ?>
					</div>
					<button type="submit" class="btn btn-default">
						<i class="fa fa-upload"></i>
						<?php 
        echo I18N::translate('Import');
        ?>
					</button>
				</div>
			</div>
		</form>

		<form class="form-horizontal" action="module.php" method="get">
			<input type="hidden" name="mod" value="googlemap">
			<input type="hidden" name="mod_action" value="admin_places">
			<input type="hidden" name="action" value="ImportFile">
			<div class="form-group">
				<label class="form-control-static col-sm-4">
					<?php 
        echo I18N::translate('Upload geographic data');
        ?>
				</label>
				<div class="col-sm-8">
					<div class="col-sm-6">
						<button type="submit" class="btn btn-default">
							<i class="fa fa-upload"></i>
							<?php 
        echo I18N::translate('Upload');
        ?>
						</button>
					</div>
				</div>
			</div>
		</form>

		<form class="form-horizontal" action="module.php" method="get">
			<input type="hidden" name="mod" value="googlemap">
			<input type="hidden" name="mod_action" value="admin_places">
			<input type="hidden" name="action" value="ExportFile">
			<div class="form-group">
				<label class="form-control-static col-sm-4">
					<?php 
        echo I18N::translate('Download geographic data');
        ?>
				</label>
				<div class="col-sm-8">
					<div class="col-sm-6">
						<?php 
        echo FunctionsEdit::selectEditControl('parent', $where_am_i, I18N::translate('All'), $WT_TREE->getTreeId(), 'class="form-control"');
        ?>
					</div>
					<button type="submit" class="btn btn-default">
						<i class="fa fa-download"></i>
						<?php 
        echo I18N::translate('Download');
        ?>
					</button>
				</div>
			</div>
		</form>
		<?php 
    }
Exemplo n.º 23
0
    private function config()
    {
        global $WT_TREE;
        $controller = new webtrees\Controller\PageController();
        $controller->restrictAccess(webtrees\Auth::isManager($WT_TREE))->setPageTitle($this->getTitle())->pageHeader();
        $args = array();
        $args['module_name'] = $this->getName();
        $args['tree_id'] = $WT_TREE->getTreeId();
        $items = webtrees\Database::prepare("SELECT block_id, block_order, gedcom_id, bs1.setting_value AS menu_title, bs2.setting_value AS menu_address" . " FROM `##block` b" . " JOIN `##block_setting` bs1 USING (block_id)" . " JOIN `##block_setting` bs2 USING (block_id)" . " WHERE module_name = :module_name" . " AND bs1.setting_name = 'menu_title'" . " AND bs2.setting_name = 'menu_address'" . " AND IFNULL(gedcom_id, :tree_id) = :tree_id" . " ORDER BY block_order")->execute($args)->fetchAll();
        unset($args['tree_id']);
        $min_block_order = webtrees\Database::prepare("SELECT MIN(block_order) FROM `##block` WHERE module_name = :module_name")->execute($args)->fetchOne();
        $max_block_order = webtrees\Database::prepare("SELECT MAX(block_order) FROM `##block` WHERE module_name = :module_name")->execute($args)->fetchOne();
        ?>
		
		<style>
			.text-left-not-xs, .text-left-not-sm, .text-left-not-md, .text-left-not-lg {
				text-align: left;
			}
			.text-center-not-xs, .text-center-not-sm, .text-center-not-md, .text-center-not-lg {
				text-align: center;
			}
			.text-right-not-xs, .text-right-not-sm, .text-right-not-md, .text-right-not-lg {
				text-align: right;
			}
			.text-justify-not-xs, .text-justify-not-sm, .text-justify-not-md, .text-justify-not-lg {
				text-align: justify;
			}

			@media (max-width: 767px) {
				.text-left-not-xs, .text-center-not-xs, .text-right-not-xs, .text-justify-not-xs {
					text-align: inherit;
				}
				.text-left-xs {
					text-align: left;
				}
				.text-center-xs {
					text-align: center;
				}
				.text-right-xs {
					text-align: right;
				}
				.text-justify-xs {
					text-align: justify;
				}
			}
			@media (min-width: 768px) and (max-width: 991px) {
				.text-left-not-sm, .text-center-not-sm, .text-right-not-sm, .text-justify-not-sm {
					text-align: inherit;
				}
				.text-left-sm {
					text-align: left;
				}
				.text-center-sm {
					text-align: center;
				}
				.text-right-sm {
					text-align: right;
				}
				.text-justify-sm {
					text-align: justify;
				}
			}
			@media (min-width: 992px) and (max-width: 1199px) {
				.text-left-not-md, .text-center-not-md, .text-right-not-md, .text-justify-not-md {
					text-align: inherit;
				}
				.text-left-md {
					text-align: left;
				}
				.text-center-md {
					text-align: center;
				}
				.text-right-md {
					text-align: right;
				}
				.text-justify-md {
					text-align: justify;
				}
			}
			@media (min-width: 1200px) {
				.text-left-not-lg, .text-center-not-lg, .text-right-not-lg, .text-justify-not-lg {
					text-align: inherit;
				}
				.text-left-lg {
					text-align: left;
				}
				.text-center-lg {
					text-align: center;
				}
				.text-right-lg {
					text-align: right;
				}
				.text-justify-lg {
					text-align: justify;
				}
			}
		</style>
		
		<ol class="breadcrumb small">
			<li><a href="admin.php"><?php 
        echo webtrees\I18N::translate('Control panel');
        ?>
</a></li>
			<li><a href="admin_modules.php"><?php 
        echo webtrees\I18N::translate('Module administration');
        ?>
</a></li>
			<li class="active"><?php 
        echo $controller->getPageTitle();
        ?>
</li>
		</ol>
		
		<div class="row">
			<div class="col-sm-4 col-xs-12">
				<form class="form">
					<label for="ged" class="sr-only">
						<?php 
        echo webtrees\I18N::translate('Family tree');
        ?>
					</label>
					<input type="hidden" name="mod" value="<?php 
        echo $this->getName();
        ?>
">
					<input type="hidden" name="mod_action" value="admin_config">
					<div class="col-sm-9 col-xs-9" style="padding:0;">
						<?php 
        echo webtrees\Functions\FunctionsEdit::selectEditControl('ged', webtrees\Tree::getNameList(), null, $WT_TREE->getName(), 'class="form-control"');
        ?>
					</div>
					<div class="col-sm-3" style="padding:0;">
						<input type="submit" class="btn btn-primary" value="<?php 
        echo webtrees\I18N::translate('show');
        ?>
">
					</div>
				</form>
			</div>
			<span class="visible-xs hidden-sm hidden-md hidden-lg" style="display:block;"></br></br></span>
			<div class="col-sm-4 text-center text-left-xs col-xs-12">
				<p>
					<a href="module.php?mod=<?php 
        echo $this->getName();
        ?>
&amp;mod_action=admin_edit" class="btn btn-primary">
						<i class="fa fa-plus"></i>
						<?php 
        echo webtrees\I18N::translate('Add Menu');
        ?>
					</a>
				</p>
			</div>
			<div class="col-sm-4 text-right text-left-xs col-xs-12">		
				<?php 
        // TODO: Move to internal item/page
        if (file_exists(WT_MODULES_DIR . $this->getName() . '/readme.html')) {
            ?>
					<a href="<?php 
            echo WT_MODULES_DIR . $this->getName();
            ?>
/readme.html" class="btn btn-info">
						<i class="fa fa-newspaper-o"></i>
						<?php 
            echo webtrees\I18N::translate('ReadMe');
            ?>
					</a>
				<?php 
        }
        ?>
			</div>
		</div>
		
		<table class="table table-bordered table-condensed">
			<thead>
				<tr>
					<th class="col-sm-2"><?php 
        echo webtrees\I18N::translate('Position');
        ?>
</th>
					<th class="col-sm-4"><?php 
        echo webtrees\I18N::translate('Menu title');
        ?>
</th>
					<th class="col-sm-4"><?php 
        echo webtrees\I18N::translate('Menu address');
        ?>
</th>
					<th class="col-sm-2" colspan=4><?php 
        echo webtrees\I18N::translate('Controls');
        ?>
</th>
				</tr>
			</thead>
			<tbody>
				<?php 
        foreach ($items as $item) {
            ?>
				<tr>
					<td>
						<?php 
            echo $item->block_order, ', ';
            if ($item->gedcom_id == null) {
                echo webtrees\I18N::translate('All');
            } else {
                echo webtrees\Tree::findById($item->gedcom_id)->getTitleHtml();
            }
            ?>
					</td>
					<td>
						<?php 
            echo webtrees\Filter::escapeHtml(webtrees\I18N::translate($item->menu_title));
            ?>
					</td>
					<td>
						<?php 
            echo webtrees\Filter::escapeHtml(substr(webtrees\I18N::translate($item->menu_address), 0, 1) == '<' ? webtrees\I18N::translate($item->menu_address) : nl2br(webtrees\I18N::translate($item->menu_address)));
            ?>
					</td>
					<td class="text-center">
						<a href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_edit&amp;block_id=<?php 
            echo $item->block_id;
            ?>
">
							<div class="icon-edit">&nbsp;</div>
						</a>
					</td>
					<td class="text-center">
						<a href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_moveup&amp;block_id=<?php 
            echo $item->block_id;
            ?>
">
							<?php 
            if ($item->block_order == $min_block_order) {
                echo '&nbsp;';
            } else {
                echo '<div class="icon-uarrow">&nbsp;</div>';
            }
            ?>
						</a>
					</td>
					<td class="text-center">
						<a href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_movedown&amp;block_id=<?php 
            echo $item->block_id;
            ?>
">
							<?php 
            if ($item->block_order == $max_block_order) {
                echo '&nbsp;';
            } else {
                echo '<div class="icon-darrow">&nbsp;</div>';
            }
            ?>
						</a>
					</td>
					<td class="text-center">
						<a href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_delete&amp;block_id=<?php 
            echo $item->block_id;
            ?>
"
							onclick="return confirm('<?php 
            echo webtrees\I18N::translate('Are you sure you want to delete this menu?');
            ?>
');">
							<div class="icon-delete">&nbsp;</div>
						</a>
					</td>
				</tr>
				<?php 
        }
        ?>
			</tbody>
		</table>
<?php 
    }
Exemplo n.º 24
0
    ?>
" class="list_value">
			<?php 
    $currentFieldSearch = $controller->getField($i);
    // Get this field’s name and the search criterion
    $currentField = substr($currentFieldSearch, 0, strrpos($currentFieldSearch, ':'));
    // Get the actual field name
    ?>
				<input type="text" id="value<?php 
    echo $i;
    ?>
" name="values[<?php 
    echo $i;
    ?>
]" value="<?php 
    echo Filter::escapeHtml($controller->getValue($i));
    ?>
"<?php 
    echo substr($controller->getField($i), -4) == 'PLAC' ? 'data-autocomplete-type="PLAC"' : '';
    ?>
>
			<?php 
    if (preg_match("/^NAME:/", $currentFieldSearch) > 0) {
        ?>
				<select name="fields[<?php 
        echo $i;
        ?>
]">
					<option value="<?php 
        echo $currentField;
        ?>
Exemplo n.º 25
0
 /**
  * Translate a tag, for an (optional) record
  *
  * @param string               $tag
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getLabel($tag, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($tag) {
         case 'ABBR':
             return I18N::translate('Abbreviation');
         case 'ADDR':
             return I18N::translate('Address');
         case 'ADR1':
             return I18N::translate('Address line 1');
         case 'ADR2':
             return I18N::translate('Address line 2');
         case 'ADOP':
             return I18N::translate('Adoption');
         case 'ADOP:DATE':
             return I18N::translate('Date of adoption');
         case 'ADOP:PLAC':
             return I18N::translate('Place of adoption');
         case 'AFN':
             return I18N::translate('Ancestral file number');
         case 'AGE':
             return I18N::translate('Age');
         case 'AGNC':
             return I18N::translate('Agency');
         case 'ALIA':
             return I18N::translate('Alias');
         case 'ANCE':
             return I18N::translate('Generations of ancestors');
         case 'ANCI':
             return I18N::translate('Ancestors interest');
         case 'ANUL':
             return I18N::translate('Annulment');
         case 'ASSO':
             return I18N::translate('Associate');
             /* see also _ASSO */
         /* see also _ASSO */
         case 'AUTH':
             return I18N::translate('Author');
         case 'BAPL':
             return I18N::translate('LDS baptism');
         case 'BAPL:DATE':
             return I18N::translate('Date of LDS baptism');
         case 'BAPL:PLAC':
             return I18N::translate('Place of LDS baptism');
         case 'BAPM':
             return I18N::translate('Baptism');
         case 'BAPM:DATE':
             return I18N::translate('Date of baptism');
         case 'BAPM:PLAC':
             return I18N::translate('Place of baptism');
         case 'BARM':
             return I18N::translate('Bar mitzvah');
         case 'BARM:DATE':
             return I18N::translate('Date of bar mitzvah');
         case 'BARM:PLAC':
             return I18N::translate('Place of bar mitzvah');
         case 'BASM':
             return I18N::translate('Bat mitzvah');
         case 'BASM:DATE':
             return I18N::translate('Date of bat mitzvah');
         case 'BASM:PLAC':
             return I18N::translate('Place of bat mitzvah');
         case 'BIRT':
             return I18N::translate('Birth');
         case 'BIRT:DATE':
             return I18N::translate('Date of birth');
         case 'BIRT:PLAC':
             return I18N::translate('Place of birth');
         case 'BLES':
             return I18N::translate('Blessing');
         case 'BLES:DATE':
             return I18N::translate('Date of blessing');
         case 'BLES:PLAC':
             return I18N::translate('Place of blessing');
         case 'BLOB':
             return I18N::translate('Binary data object');
         case 'BURI':
             return I18N::translate('Burial');
         case 'BURI:DATE':
             return I18N::translate('Date of burial');
         case 'BURI:PLAC':
             return I18N::translate('Place of burial');
         case 'CALN':
             return I18N::translate('Call number');
         case 'CAST':
             return I18N::translate('Caste');
         case 'CAUS':
             return I18N::translate('Cause');
         case 'CEME':
             return I18N::translate('Cemetery');
         case 'CENS':
             return I18N::translate('Census');
         case 'CENS:DATE':
             return I18N::translate('Census date');
         case 'CENS:PLAC':
             return I18N::translate('Census place');
         case 'CHAN':
             return I18N::translate('Last change');
         case 'CHAN:DATE':
             return I18N::translate('Date of last change');
         case 'CHAN:_WT_USER':
             return I18N::translate('Author of last change');
         case 'CHAR':
             return I18N::translate('Character set');
         case 'CHIL':
             return I18N::translate('Child');
         case 'CHR':
             return I18N::translate('Christening');
         case 'CHR:DATE':
             return I18N::translate('Date of christening');
         case 'CHR:PLAC':
             return I18N::translate('Place of christening');
         case 'CHRA':
             return I18N::translate('Adult christening');
         case 'CITN':
             return I18N::translate('Citizenship');
         case 'CITY':
             return I18N::translate('City');
         case 'COMM':
             return I18N::translate('Comment');
         case 'CONC':
             return I18N::translate('Concatenation');
         case 'CONT':
             return I18N::translate('Continued');
         case 'CONF':
             return I18N::translate('Confirmation');
         case 'CONF:DATE':
             return I18N::translate('Date of confirmation');
         case 'CONF:PLAC':
             return I18N::translate('Place of confirmation');
         case 'CONL':
             return I18N::translate('LDS confirmation');
         case 'COPR':
             return I18N::translate('Copyright');
         case 'CORP':
             return I18N::translate('Corporation');
         case 'CREM':
             return I18N::translate('Cremation');
         case 'CREM:DATE':
             return I18N::translate('Date of cremation');
         case 'CREM:PLAC':
             return I18N::translate('Place of cremation');
         case 'CTRY':
             return I18N::translate('Country');
         case 'DATA':
             return I18N::translate('Data');
         case 'DATA:DATE':
             return I18N::translate('Date of entry in original source');
         case 'DATE':
             return I18N::translate('Date');
         case 'DEAT':
             return I18N::translate('Death');
         case 'DEAT:CAUS':
             return I18N::translate('Cause of death');
         case 'DEAT:DATE':
             return I18N::translate('Date of death');
         case 'DEAT:PLAC':
             return I18N::translate('Place of death');
         case 'DESC':
             return I18N::translate('Descendants');
         case 'DESI':
             return I18N::translate('Descendants interest');
         case 'DEST':
             return I18N::translate('Destination');
         case 'DIV':
             return I18N::translate('Divorce');
         case 'DIVF':
             return I18N::translate('Divorce filed');
         case 'DSCR':
             return I18N::translate('Description');
         case 'EDUC':
             return I18N::translate('Education');
         case 'EDUC:AGNC':
             return I18N::translate('School or college');
         case 'EMAI':
             return I18N::translate('Email address');
         case 'EMAIL':
             return I18N::translate('Email address');
         case 'EMAL':
             return I18N::translate('Email address');
         case 'EMIG':
             return I18N::translate('Emigration');
         case 'EMIG:DATE':
             return I18N::translate('Date of emigration');
         case 'EMIG:PLAC':
             return I18N::translate('Place of emigration');
         case 'ENDL':
             return I18N::translate('LDS endowment');
         case 'ENDL:DATE':
             return I18N::translate('Date of LDS endowment');
         case 'ENDL:PLAC':
             return I18N::translate('Place of LDS endowment');
         case 'ENGA':
             return I18N::translate('Engagement');
         case 'ENGA:DATE':
             return I18N::translate('Date of engagement');
         case 'ENGA:PLAC':
             return I18N::translate('Place of engagement');
         case 'EVEN':
             return I18N::translate('Event');
         case 'EVEN:DATE':
             return I18N::translate('Date of event');
         case 'EVEN:PLAC':
             return I18N::translate('Place of event');
         case 'FACT':
             return I18N::translate('Fact');
         case 'FAM':
             return I18N::translate('Family');
         case 'FAMC':
             return I18N::translate('Family as a child');
         case 'FAMF':
             return I18N::translate('Family file');
         case 'FAMS':
             return I18N::translate('Family as a spouse');
         case 'FAMS:CENS:DATE':
             return I18N::translate('Spouse census date');
         case 'FAMS:CENS:PLAC':
             return I18N::translate('Spouse census place');
         case 'FAMS:DIV:DATE':
             return I18N::translate('Date of divorce');
         case 'FAMS:MARR:DATE':
             return I18N::translate('Date of marriage');
         case 'FAMS:MARR:PLAC':
             return I18N::translate('Place of marriage');
         case 'FAMS:NOTE':
             return I18N::translate('Spouse note');
         case 'FAMS:SLGS:DATE':
             return I18N::translate('Date of LDS spouse sealing');
         case 'FAMS:SLGS:PLAC':
             return I18N::translate('Place of LDS spouse sealing');
         case 'FAX':
             return I18N::translate('Fax');
         case 'FCOM':
             return I18N::translate('First communion');
         case 'FCOM:DATE':
             return I18N::translate('Date of first communion');
         case 'FCOM:PLAC':
             return I18N::translate('Place of first communion');
         case 'FILE':
             return I18N::translate('Filename');
         case 'FONE':
             return I18N::translate('Phonetic');
         case 'FORM':
             return I18N::translate('Format');
         case 'GEDC':
             return I18N::translate('GEDCOM file');
         case 'GIVN':
             return I18N::translate('Given names');
         case 'GRAD':
             return I18N::translate('Graduation');
         case 'HEAD':
             return I18N::translate('Header');
         case 'HUSB':
             return I18N::translate('Husband');
         case 'IDNO':
             return I18N::translate('Identification number');
         case 'IMMI':
             return I18N::translate('Immigration');
         case 'IMMI:DATE':
             return I18N::translate('Date of immigration');
         case 'IMMI:PLAC':
             return I18N::translate('Place of immigration');
         case 'INDI':
             return I18N::translate('Individual');
         case 'INFL':
             return I18N::translate('Infant');
         case 'LANG':
             return I18N::translate('Language');
         case 'LATI':
             return I18N::translate('Latitude');
         case 'LEGA':
             return I18N::translate('Legatee');
         case 'LONG':
             return I18N::translate('Longitude');
         case 'MAP':
             return I18N::translate('Map');
         case 'MARB':
             return I18N::translate('Marriage banns');
         case 'MARB:DATE':
             return I18N::translate('Date of marriage banns');
         case 'MARB:PLAC':
             return I18N::translate('Place of marriage banns');
         case 'MARC':
             return I18N::translate('Marriage contract');
         case 'MARL':
             return I18N::translate('Marriage license');
         case 'MARR':
             return I18N::translate('Marriage');
         case 'MARR:DATE':
             return I18N::translate('Date of marriage');
         case 'MARR:PLAC':
             return I18N::translate('Place of marriage');
         case 'MARR_CIVIL':
             return I18N::translate('Civil marriage');
         case 'MARR_PARTNERS':
             return I18N::translate('Registered partnership');
         case 'MARR_RELIGIOUS':
             return I18N::translate('Religious marriage');
         case 'MARR_UNKNOWN':
             return I18N::translate('Marriage type unknown');
         case 'MARS':
             return I18N::translate('Marriage settlement');
         case 'MEDI':
             return I18N::translate('Media type');
         case 'NAME':
             if ($record instanceof Repository) {
                 return I18N::translateContext('Repository', 'Name');
             } else {
                 return I18N::translate('Name');
             }
         case 'NAME:FONE':
             return I18N::translate('Phonetic name');
         case 'NAME:_HEB':
             return I18N::translate('Name in Hebrew');
         case 'NATI':
             return I18N::translate('Nationality');
         case 'NATU':
             return I18N::translate('Naturalization');
         case 'NATU:DATE':
             return I18N::translate('Date of naturalization');
         case 'NATU:PLAC':
             return I18N::translate('Place of naturalization');
         case 'NCHI':
             return I18N::translate('Number of children');
         case 'NICK':
             return I18N::translate('Nickname');
         case 'NMR':
             return I18N::translate('Number of marriages');
         case 'NOTE':
             return I18N::translate('Note');
         case 'NPFX':
             return I18N::translate('Name prefix');
         case 'NSFX':
             return I18N::translate('Name suffix');
         case 'OBJE':
             return I18N::translate('Media object');
         case 'OCCU':
             return I18N::translate('Occupation');
         case 'OCCU:AGNC':
             return I18N::translate('Employer');
         case 'ORDI':
             return I18N::translate('Ordinance');
         case 'ORDN':
             return I18N::translate('Ordination');
         case 'ORDN:AGNC':
             return I18N::translate('Religious institution');
         case 'ORDN:DATE':
             return I18N::translate('Date of ordination');
         case 'ORDN:PLAC':
             return I18N::translate('Place of ordination');
         case 'PAGE':
             return I18N::translate('Citation details');
         case 'PEDI':
             return I18N::translate('Relationship to parents');
         case 'PHON':
             return I18N::translate('Phone');
         case 'PLAC':
             return I18N::translate('Place');
         case 'PLAC:FONE':
             return I18N::translate('Phonetic place');
         case 'PLAC:ROMN':
             return I18N::translate('Romanized place');
         case 'PLAC:_HEB':
             return I18N::translate('Place in Hebrew');
         case 'POST':
             return I18N::translate('Postal code');
         case 'PROB':
             return I18N::translate('Probate');
         case 'PROP':
             return I18N::translate('Property');
         case 'PUBL':
             return I18N::translate('Publication');
         case 'QUAY':
             return I18N::translate('Quality of data');
         case 'REFN':
             return I18N::translate('Reference number');
         case 'RELA':
             return I18N::translate('Relationship');
         case 'RELI':
             return I18N::translate('Religion');
         case 'REPO':
             return I18N::translate('Repository');
         case 'RESI':
             return I18N::translate('Residence');
         case 'RESI:DATE':
             return I18N::translate('Date of residence');
         case 'RESI:PLAC':
             return I18N::translate('Place of residence');
         case 'RESN':
             return I18N::translate('Restriction');
         case 'RETI':
             return I18N::translate('Retirement');
         case 'RETI:AGNC':
             return I18N::translate('Employer');
         case 'RFN':
             return I18N::translate('Record file number');
         case 'RIN':
             return I18N::translate('Record ID number');
         case 'ROLE':
             return I18N::translate('Role');
         case 'ROMN':
             return I18N::translate('Romanized');
         case 'SERV':
             return I18N::translate('Remote server');
         case 'SEX':
             return I18N::translate('Gender');
         case 'SHARED_NOTE':
             return I18N::translate('Shared note');
         case 'SLGC':
             return I18N::translate('LDS child sealing');
         case 'SLGC:DATE':
             return I18N::translate('Date of LDS child sealing');
         case 'SLGC:PLAC':
             return I18N::translate('Place of LDS child sealing');
         case 'SLGS':
             return I18N::translate('LDS spouse sealing');
         case 'SOUR':
             return I18N::translate('Source');
         case 'SPFX':
             return I18N::translate('Surname prefix');
         case 'SSN':
             return I18N::translate('Social security number');
         case 'STAE':
             return I18N::translate('State');
         case 'STAT':
             return I18N::translate('Status');
         case 'STAT:DATE':
             return I18N::translate('Status change date');
         case 'SUBM':
             return I18N::translate('Submitter');
         case 'SUBN':
             return I18N::translate('Submission');
         case 'SURN':
             return I18N::translate('Surname');
         case 'TEMP':
             return I18N::translate('Temple');
         case 'TEXT':
             return I18N::translate('Text');
         case 'TIME':
             return I18N::translate('Time');
         case 'TITL':
             return I18N::translate('Title');
         case 'TITL:FONE':
             return I18N::translate('Phonetic title');
         case 'TITL:ROMN':
             return I18N::translate('Romanized title');
         case 'TITL:_HEB':
             return I18N::translate('Title in Hebrew');
         case 'TRLR':
             return I18N::translate('Trailer');
         case 'TYPE':
             return I18N::translate('Type');
         case 'URL':
             return I18N::translate('URL');
         case 'VERS':
             return I18N::translate('Version');
         case 'WIFE':
             return I18N::translate('Wife');
         case 'WILL':
             return I18N::translate('Will');
         case 'WWW':
             return I18N::translate('URL');
         case '_ADOP_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a son');
                 case 'F':
                     return I18N::translate('Adoption of a daughter');
                 default:
                     return I18N::translate('Adoption of a child');
             }
         case '_ADOP_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a grandson');
                 case 'F':
                     return I18N::translate('Adoption of a granddaughter');
                 default:
                     return I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Adoption of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Adoption of a granddaughter');
                 default:
                     return I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Adoption of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Adoption of a granddaughter');
                 default:
                     return I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a half-brother');
                 case 'F':
                     return I18N::translate('Adoption of a half-sister');
                 default:
                     return I18N::translate('Adoption of a half-sibling');
             }
         case '_ADOP_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a brother');
                 case 'F':
                     return I18N::translate('Adoption of a sister');
                 default:
                     return I18N::translate('Adoption of a sibling');
             }
         case '_ADPF':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by father');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by father');
                 default:
                     return I18N::translate('Adopted by father');
             }
         case '_ADPM':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by mother');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by mother');
                 default:
                     return I18N::translate('Adopted by mother');
             }
         case '_AKA':
         case '_AKAN':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Also known as');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Also known as');
                 default:
                     return I18N::translate('Also known as');
             }
         case '_ASSO':
             return I18N::translate('Associate');
             /* see also ASSO */
         /* see also ASSO */
         case '_BAPM_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a son');
                 case 'F':
                     return I18N::translate('Baptism of a daughter');
                 default:
                     return I18N::translate('Baptism of a child');
             }
         case '_BAPM_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a grandson');
                 case 'F':
                     return I18N::translate('Baptism of a granddaughter');
                 default:
                     return I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Baptism of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Baptism of a granddaughter');
                 default:
                     return I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Baptism of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Baptism of a granddaughter');
                 default:
                     return I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a half-brother');
                 case 'F':
                     return I18N::translate('Baptism of a half-sister');
                 default:
                     return I18N::translate('Baptism of a half-sibling');
             }
         case '_BAPM_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a brother');
                 case 'F':
                     return I18N::translate('Baptism of a sister');
                 default:
                     return I18N::translate('Baptism of a sibling');
             }
         case '_BIBL':
             return I18N::translate('Bibliography');
         case '_BIRT_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a son');
                 case 'F':
                     return I18N::translate('Birth of a daughter');
                 default:
                     return I18N::translate('Birth of a child');
             }
         case '_BIRT_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a grandson');
                 case 'F':
                     return I18N::translate('Birth of a granddaughter');
                 default:
                     return I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Birth of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Birth of a granddaughter');
                 default:
                     return I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Birth of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Birth of a granddaughter');
                 default:
                     return I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a half-brother');
                 case 'F':
                     return I18N::translate('Birth of a half-sister');
                 default:
                     return I18N::translate('Birth of a half-sibling');
             }
         case '_BIRT_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a brother');
                 case 'F':
                     return I18N::translate('Birth of a sister');
                 default:
                     return I18N::translate('Birth of a sibling');
             }
         case '_BRTM':
             return I18N::translate('Brit milah');
         case '_BRTM:DATE':
             return I18N::translate('Date of brit milah');
         case '_BRTM:PLAC':
             return I18N::translate('Place of brit milah');
         case '_BURI_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a son');
                 case 'F':
                     return I18N::translate('Burial of a daughter');
                 default:
                     return I18N::translate('Burial of a child');
             }
         case '_BURI_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a grandson');
                 case 'F':
                     return I18N::translate('Burial of a granddaughter');
                 default:
                     return I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Burial of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Burial of a granddaughter');
                 default:
                     return I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Burial of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Burial of a granddaughter');
                 default:
                     return I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GPAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a grandfather');
                 case 'F':
                     return I18N::translate('Burial of a grandmother');
                 default:
                     return I18N::translate('Burial of a grandparent');
             }
         case '_BURI_GPA1':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a paternal grandfather');
                 case 'F':
                     return I18N::translate('Burial of a paternal grandmother');
                 default:
                     return I18N::translate('Burial of a paternal grandparent');
             }
         case '_BURI_GPA2':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a maternal grandfather');
                 case 'F':
                     return I18N::translate('Burial of a maternal grandmother');
                 default:
                     return I18N::translate('Burial of a maternal grandparent');
             }
         case '_BURI_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a half-brother');
                 case 'F':
                     return I18N::translate('Burial of a half-sister');
                 default:
                     return I18N::translate('Burial of a half-sibling');
             }
         case '_BURI_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a father');
                 case 'F':
                     return I18N::translate('Burial of a mother');
                 default:
                     return I18N::translate('Burial of a parent');
             }
         case '_BURI_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a brother');
                 case 'F':
                     return I18N::translate('Burial of a sister');
                 default:
                     return I18N::translate('Burial of a sibling');
             }
         case '_BURI_SPOU':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a husband');
                 case 'F':
                     return I18N::translate('Burial of a wife');
                 default:
                     return I18N::translate('Burial of a spouse');
             }
         case '_CHR_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a son');
                 case 'F':
                     return I18N::translate('Christening of a daughter');
                 default:
                     return I18N::translate('Christening of a child');
             }
         case '_CHR_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a grandson');
                 case 'F':
                     return I18N::translate('Christening of a granddaughter');
                 default:
                     return I18N::translate('Christening of a grandchild');
             }
         case '_CHR_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Christening of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Christening of a granddaughter');
                 default:
                     return I18N::translate('Christening of a grandchild');
             }
         case '_CHR_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Christening of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Christening of a granddaughter');
                 default:
                     return I18N::translate('Christening of a grandchild');
             }
         case '_CHR_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a half-brother');
                 case 'F':
                     return I18N::translate('Christening of a half-sister');
                 default:
                     return I18N::translate('Christening of a half-sibling');
             }
         case '_CHR_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a brother');
                 case 'F':
                     return I18N::translate('Christening of a sister');
                 default:
                     return I18N::translate('Christening of a sibling');
             }
         case '_COML':
             return I18N::translate('Common law marriage');
         case '_CREM_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a son');
                 case 'F':
                     return I18N::translate('Cremation of a daughter');
                 default:
                     return I18N::translate('Cremation of a child');
             }
         case '_CREM_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a grandson');
                 case 'F':
                     return I18N::translate('Cremation of a granddaughter');
                 default:
                     return I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Cremation of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Cremation of a granddaughter');
                 default:
                     return I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Cremation of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Cremation of a granddaughter');
                 default:
                     return I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GPAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a grandfather');
                 case 'F':
                     return I18N::translate('Cremation of a grandmother');
                 default:
                     return I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_GPA1':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a paternal grandfather');
                 case 'F':
                     return I18N::translate('Cremation of a paternal grandmother');
                 default:
                     return I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_GPA2':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a maternal grandfather');
                 case 'F':
                     return I18N::translate('Cremation of a maternal grandmother');
                 default:
                     return I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a half-brother');
                 case 'F':
                     return I18N::translate('Cremation of a half-sister');
                 default:
                     return I18N::translate('Cremation of a half-sibling');
             }
         case '_CREM_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a father');
                 case 'F':
                     return I18N::translate('Cremation of a mother');
                 default:
                     return I18N::translate('Cremation of a parent');
             }
         case '_CREM_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a brother');
                 case 'F':
                     return I18N::translate('Cremation of a sister');
                 default:
                     return I18N::translate('Cremation of a sibling');
             }
         case '_CREM_SPOU':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a husband');
                 case 'F':
                     return I18N::translate('Cremation of a wife');
                 default:
                     return I18N::translate('Cremation of a spouse');
             }
         case '_DBID':
             return I18N::translate('Linked database ID');
         case '_DEAT_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a son');
                 case 'F':
                     return I18N::translate('Death of a daughter');
                 default:
                     return I18N::translate('Death of a child');
             }
         case '_DEAT_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a grandson');
                 case 'F':
                     return I18N::translate('Death of a granddaughter');
                 default:
                     return I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Death of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Death of a granddaughter');
                 default:
                     return I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Death of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Death of a granddaughter');
                 default:
                     return I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GPAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a grandfather');
                 case 'F':
                     return I18N::translate('Death of a grandmother');
                 default:
                     return I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_GPA1':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a paternal grandfather');
                 case 'F':
                     return I18N::translate('Death of a paternal grandmother');
                 default:
                     return I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_GPA2':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a maternal grandfather');
                 case 'F':
                     return I18N::translate('Death of a maternal grandmother');
                 default:
                     return I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a half-brother');
                 case 'F':
                     return I18N::translate('Death of a half-sister');
                 default:
                     return I18N::translate('Death of a half-sibling');
             }
         case '_DEAT_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a father');
                 case 'F':
                     return I18N::translate('Death of a mother');
                 default:
                     return I18N::translate('Death of a parent');
             }
         case '_DEAT_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a brother');
                 case 'F':
                     return I18N::translate('Death of a sister');
                 default:
                     return I18N::translate('Death of a sibling');
             }
         case '_DEAT_SPOU':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a husband');
                 case 'F':
                     return I18N::translate('Death of a wife');
                 default:
                     return I18N::translate('Death of a spouse');
             }
         case '_DEG':
             return I18N::translate('Degree');
         case '_DETS':
             return I18N::translate('Death of one spouse');
         case '_DNA':
             return I18N::translate('DNA markers');
         case '_EMAIL':
             return I18N::translate('Email address');
         case '_EYEC':
             return I18N::translate('Eye color');
         case '_FA1':
             return I18N::translate('Fact 1');
         case '_FA2':
             return I18N::translate('Fact 2');
         case '_FA3':
             return I18N::translate('Fact 3');
         case '_FA4':
             return I18N::translate('Fact 4');
         case '_FA5':
             return I18N::translate('Fact 5');
         case '_FA6':
             return I18N::translate('Fact 6');
         case '_FA7':
             return I18N::translate('Fact 7');
         case '_FA8':
             return I18N::translate('Fact 8');
         case '_FA9':
             return I18N::translate('Fact 9');
         case '_FA10':
             return I18N::translate('Fact 10');
         case '_FA11':
             return I18N::translate('Fact 11');
         case '_FA12':
             return I18N::translate('Fact 12');
         case '_FA13':
             return I18N::translate('Fact 13');
         case '_FNRL':
             return I18N::translate('Funeral');
         case '_FREL':
             return I18N::translate('Relationship to father');
         case '_GEDF':
             return I18N::translate('GEDCOM file');
         case '_GODP':
             return I18N::translate('Godparent');
         case '_HAIR':
             return I18N::translate('Hair color');
         case '_HEB':
             return I18N::translate('Hebrew');
         case '_HEIG':
             return I18N::translate('Height');
         case '_HNM':
             return I18N::translate('Hebrew name');
         case '_HOL':
             return I18N::translate('Holocaust');
         case '_INTE':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Interred');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Interred');
                 default:
                     return I18N::translate('Interred');
             }
         case '_LOC':
             return I18N::translate('Location');
         case '_MARI':
             return I18N::translate('Marriage intention');
         case '_MARNM':
             return I18N::translate('Married name');
         case '_PRIM':
             return I18N::translate('Highlighted image');
         case '_MARNM_SURN':
             return I18N::translate('Married surname');
         case '_MARR_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a son');
                 case 'F':
                     return I18N::translate('Marriage of a daughter');
                 default:
                     return I18N::translate('Marriage of a child');
             }
         case '_MARR_FAMC':
             return I18N::translate('Marriage of parents');
         case '_MARR_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a grandson');
                 case 'F':
                     return I18N::translate('Marriage of a granddaughter');
                 default:
                     return I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Marriage of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Marriage of a granddaughter');
                 default:
                     return I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Marriage of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Marriage of a granddaughter');
                 default:
                     return I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a half-brother');
                 case 'F':
                     return I18N::translate('Marriage of a half-sister');
                 default:
                     return I18N::translate('Marriage of a half-sibling');
             }
         case '_MARR_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a father');
                 case 'F':
                     return I18N::translate('Marriage of a mother');
                 default:
                     return I18N::translate('Marriage of a parent');
             }
         case '_MARR_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a brother');
                 case 'F':
                     return I18N::translate('Marriage of a sister');
                 default:
                     return I18N::translate('Marriage of a sibling');
             }
         case '_MBON':
             return I18N::translate('Marriage bond');
         case '_MDCL':
             return I18N::translate('Medical');
         case '_MEDC':
             return I18N::translate('Medical condition');
         case '_MEND':
             return I18N::translate('Marriage ending status');
         case '_MILI':
             return I18N::translate('Military');
         case '_MILT':
             return I18N::translate('Military service');
         case '_MREL':
             return I18N::translate('Relationship to mother');
         case '_MSTAT':
             return I18N::translate('Marriage beginning status');
         case '_NAME':
             return I18N::translate('Mailing name');
         case '_NAMS':
             return I18N::translate('Namesake');
         case '_NLIV':
             return I18N::translate('Not living');
         case '_NMAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Never married');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Never married');
                 default:
                     return I18N::translate('Never married');
             }
         case '_NMR':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Not married');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Not married');
                 default:
                     return I18N::translate('Not married');
             }
         case '_WT_USER':
             return I18N::translate('by');
         case '_PRMN':
             return I18N::translate('Permanent number');
         case '_SCBK':
             return I18N::translate('Scrapbook');
         case '_SEPR':
             return I18N::translate('Separated');
         case '_SSHOW':
             return I18N::translate('Slide show');
         case '_STAT':
             return I18N::translate('Marriage status');
         case '_SUBQ':
             return I18N::translate('Short version');
         case '_TODO':
             return I18N::translate('Research task');
         case '_TYPE':
             return I18N::translate('Media type');
         case '_UID':
             return I18N::translate('Globally unique identifier');
         case '_URL':
             return I18N::translate('URL');
         case '_WEIG':
             return I18N::translate('Weight');
         case '_WITN':
             return I18N::translate('Witness');
         case '_WT_OBJE_SORT':
             return I18N::translate('Re-order media');
         case '_YART':
             return I18N::translate('Yahrzeit');
             // Brit milah applies only to males, no need for male/female translations
         // Brit milah applies only to males, no need for male/female translations
         case '__BRTM_CHIL':
             return I18N::translate('Brit milah of a son');
         case '__BRTM_GCHI':
             return I18N::translate('Brit milah of a grandson');
         case '__BRTM_GCH1':
             return I18N::translateContext('daughter’s son', 'Brit milah of a grandson');
         case '__BRTM_GCH2':
             return I18N::translateContext('son’s son', 'Brit milah of a grandson');
         case '__BRTM_HSIB':
             return I18N::translate('Brit milah of a half-brother');
         case '__BRTM_SIBL':
             return I18N::translate('Brit milah of a brother');
             // These "pseudo" tags are generated internally to present information about a media object
         // These "pseudo" tags are generated internally to present information about a media object
         case '__FILE_SIZE__':
             return I18N::translate('File size');
         case '__IMAGE_SIZE__':
             return I18N::translate('Image dimensions');
         default:
             // If no specialisation exists (e.g. DEAT:CAUS), then look for the general (CAUS)
             if (strpos($tag, ':')) {
                 list(, $tag) = explode(':', $tag, 2);
                 return self::getLabel($tag, $record);
             }
             // Still no translation? Highlight this as an error
             return '<span class="error" title="' . I18N::translate('Unrecognized GEDCOM code') . '">' . Filter::escapeHtml($tag) . '</span>';
     }
 }
Exemplo n.º 26
0
			<?php 
if (Site::getPreference('ALLOW_USER_THEMES')) {
    ?>

			<div class="label">
				<label for="form_theme">
					<?php 
    echo I18N::translate('Theme');
    ?>
				</label>
			</div>
			<div class="value">
				<select id="form_theme" name="form_theme">
					<option value="">
						<?php 
    echo Filter::escapeHtml(I18N::translate('<default theme>'));
    ?>
					</option>
					<?php 
    foreach (Theme::themeNames() as $theme_id => $theme_name) {
        ?>
					<option value="<?php 
        echo $theme_id;
        ?>
" <?php 
        echo $theme_id === Auth::user()->getPreference('theme') ? 'selected' : '';
        ?>
>
						<?php 
        echo $theme_name;
        ?>
Exemplo n.º 27
0
 /**
  * print information for a name record
  *
  * @param Fact $event the event object
  */
 public function printNameRecord(Fact $event)
 {
     $factrec = $event->getGedcom();
     // Create a dummy record, so we can extract the formatted NAME value from the event.
     $dummy = new Individual('xref', "0 @xref@ INDI\n1 DEAT Y\n" . $factrec, null, $event->getParent()->getTree());
     $all_names = $dummy->getAllNames();
     $primary_name = $all_names[0];
     $this->name_count++;
     if ($this->name_count > 1) {
         echo '<h3 class="name_two">', $dummy->getFullName(), '</h3>';
     }
     //Other names accordion element
     echo '<div class="indi_name_details';
     if ($event->isPendingDeletion()) {
         echo ' old';
     }
     if ($event->isPendingAddition()) {
         echo ' new';
     }
     echo '">';
     echo '<div class="name1">';
     echo '<dl><dt class="label">', I18N::translate('Name'), '</dt>';
     $dummy->setPrimaryName(0);
     echo '<dd class="field">', $dummy->getFullName();
     if ($this->name_count == 1) {
         if (Auth::isAdmin()) {
             $user = User::findByGenealogyRecord($this->record);
             if ($user) {
                 echo '<span> - <a class="warning" href="admin_users.php?filter=' . Filter::escapeHtml($user->getUserName()) . '">' . Filter::escapeHtml($user->getUserName()) . '</a></span>';
             }
         }
     }
     if ($this->record->canEdit() && !$event->isPendingDeletion()) {
         echo "<div class=\"deletelink\"><a class=\"deleteicon\" href=\"#\" onclick=\"return delete_fact('" . I18N::translate('Are you sure you want to delete this fact?') . "', '" . $this->record->getXref() . "', '" . $event->getFactId() . "');\" title=\"" . I18N::translate('Delete this name') . "\"><span class=\"link_text\">" . I18N::translate('Delete this name') . "</span></a></div>";
         echo "<div class=\"editlink\"><a href=\"#\" class=\"editicon\" onclick=\"edit_name('" . $this->record->getXref() . "', '" . $event->getFactId() . "'); return false;\" title=\"" . I18N::translate('Edit name') . "\"><span class=\"link_text\">" . I18N::translate('Edit name') . "</span></a></div>";
     }
     echo '</dd>';
     echo '</dl>';
     echo '</div>';
     $ct = preg_match_all('/\\n2 (\\w+) (.*)/', $factrec, $nmatch, PREG_SET_ORDER);
     for ($i = 0; $i < $ct; $i++) {
         echo '<div>';
         $fact = $nmatch[$i][1];
         if ($fact != 'SOUR' && $fact != 'NOTE' && $fact != 'SPFX') {
             echo '<dl><dt class="label">', GedcomTag::getLabel($fact, $this->record), '</dt>';
             echo '<dd class="field">';
             // Before using dir="auto" on this field, note that Gecko treats this as an inline element but WebKit treats it as a block element
             if (isset($nmatch[$i][2])) {
                 $name = Filter::escapeHtml($nmatch[$i][2]);
                 $name = str_replace('/', '', $name);
                 $name = preg_replace('/(\\S*)\\*/', '<span class="starredname">\\1</span>', $name);
                 switch ($fact) {
                     case 'TYPE':
                         echo GedcomCodeName::getValue($name, $this->record);
                         break;
                     case 'SURN':
                         // The SURN field is not necessarily the surname.
                         // Where it is not a substring of the real surname, show it after the real surname.
                         $surname = Filter::escapeHtml($primary_name['surname']);
                         if (strpos($primary_name['surname'], str_replace(',', ' ', $nmatch[$i][2])) !== false) {
                             echo '<span dir="auto">' . $surname . '</span>';
                         } else {
                             echo I18N::translate('%1$s (%2$s)', '<span dir="auto">' . $surname . '</span>', '<span dir="auto">' . $name . '</span>');
                         }
                         break;
                     default:
                         echo '<span dir="auto">' . $name . '</span>';
                         break;
                 }
             }
             echo '</dd>';
             echo '</dl>';
         }
         echo '</div>';
     }
     if (preg_match("/\n2 SOUR/", $factrec)) {
         echo '<div id="indi_sour" class="clearfloat">', FunctionsPrintFacts::printFactSources($factrec, 2), '</div>';
     }
     if (preg_match("/\n2 NOTE/", $factrec)) {
         echo '<div id="indi_note" class="clearfloat">', FunctionsPrint::printFactNotes($factrec, 2), '</div>';
     }
     echo '</div>';
 }
Exemplo n.º 28
0
 /**
  * Get the newest registered user.
  *
  * @param string   $type
  * @param string[] $params
  *
  * @return string
  */
 private function getLatestUserData($type = 'userid', $params = array())
 {
     static $user_id = null;
     if ($user_id === null) {
         $user = User::findLatestToRegister();
     } else {
         $user = User::find($user_id);
     }
     switch ($type) {
         default:
         case 'userid':
             return $user->getUserId();
         case 'username':
             return Filter::escapeHtml($user->getUserName());
         case 'fullname':
             return $user->getRealNameHtml();
         case 'regdate':
             if (is_array($params) && isset($params[0]) && $params[0] != '') {
                 $datestamp = $params[0];
             } else {
                 $datestamp = I18N::dateFormat();
             }
             return FunctionsDate::timestampToGedcomDate($user->getPreference('reg_timestamp'))->display(false, $datestamp);
         case 'regtime':
             if (is_array($params) && isset($params[0]) && $params[0] != '') {
                 $datestamp = $params[0];
             } else {
                 $datestamp = str_replace('%', '', I18N::timeFormat());
             }
             return date($datestamp, $user->getPreference('reg_timestamp'));
         case 'loggedin':
             if (is_array($params) && isset($params[0]) && $params[0] != '') {
                 $yes = $params[0];
             } else {
                 $yes = I18N::translate('yes');
             }
             if (is_array($params) && isset($params[1]) && $params[1] != '') {
                 $no = $params[1];
             } else {
                 $no = I18N::translate('no');
             }
             return Database::prepare("SELECT SQL_NO_CACHE 1 FROM `##session` WHERE user_id=? LIMIT 1")->execute(array($user->getUserId()))->fetchOne() ? $yes : $no;
     }
 }
Exemplo n.º 29
0
    if (strlen($_POST['wtpass']) > 0 && strlen($_POST['wtpass']) < 6) {
        echo '<p class="bad">', I18N::translate('The password needs to be at least six characters long.'), '</p>';
    } elseif ($_POST['wtpass'] != $_POST['wtpass2']) {
        echo '<p class="bad">', I18N::translate('The passwords do not match.'), '</p>';
    } elseif ((empty($_POST['wtname']) || empty($_POST['wtuser']) || empty($_POST['wtpass']) || empty($_POST['wtemail'])) && $_POST['wtname'] . $_POST['wtuser'] . $_POST['wtpass'] . $_POST['wtemail'] != '') {
        echo '<p class="bad">', I18N::translate('You must enter all the administrator account fields.'), '</p>';
    }
    echo '<h2>', I18N::translate('System settings'), '</h2>', '<h3>', I18N::translate('Administrator account'), '</h3>', '<p>', I18N::translate('You need to set up an administrator account.  This account can control all aspects of this webtrees installation.  Please choose a strong password.'), '</p>', '<fieldset><legend>', I18N::translate('Administrator account'), '</legend>', '<table border="0"><tr><td>', I18N::translate('Your name'), '</td><td>', '<input type="text" name="wtname" value="', Filter::escapeHtml($_POST['wtname']), '" autofocus></td><td>', I18N::translate('This is your real name, as you would like it displayed on screen.'), '</td></tr><tr><td>', I18N::translate('Login ID'), '</td><td>', '<input type="text" name="wtuser" value="', Filter::escapeHtml($_POST['wtuser']), '"></td><td>', I18N::translate('You will use this to login to webtrees.'), '</td></tr><tr><td>', I18N::translate('Password'), '</td><td>', '<input type="password" name="wtpass" value="', Filter::escapeHtml($_POST['wtpass']), '"></td><td>', I18N::translate('This must be at least six characters long.  It is case-sensitive.'), '</td></tr><tr><td>', '&nbsp;', '</td><td>', '<input type="password" name="wtpass2" value="', Filter::escapeHtml($_POST['wtpass2']), '"></td><td>', I18N::translate('Type your password again, to make sure you have typed it correctly.'), '</td></tr><tr><td>', I18N::translate('Email address'), '</td><td>', '<input type="email" name="wtemail" value="', Filter::escapeHtml($_POST['wtemail']), '"></td><td>', I18N::translate('This email address will be used to send password reminders, website notifications, and messages from other family members who are registered on the website.'), '</td></tr><tr><td>', '</td></tr></table>', '</fieldset>', '<br><hr><input type="submit" id="btncontinue" value="', I18N::translate('continue'), '">', '</form>', '</body></html>';
    return;
} else {
    // Copy these values through to the next step
    echo '<input type="hidden" name="wtname"  value="', Filter::escapeHtml($_POST['wtname']), '">';
    echo '<input type="hidden" name="wtuser"  value="', Filter::escapeHtml($_POST['wtuser']), '">';
    echo '<input type="hidden" name="wtpass"  value="', Filter::escapeHtml($_POST['wtpass']), '">';
    echo '<input type="hidden" name="wtpass2" value="', Filter::escapeHtml($_POST['wtpass2']), '">';
    echo '<input type="hidden" name="wtemail" value="', Filter::escapeHtml($_POST['wtemail']), '">';
}
////////////////////////////////////////////////////////////////////////////////
// Step six  We have a database connection and a writable folder.  Do it!
////////////////////////////////////////////////////////////////////////////////
try {
    // Create/update the database tables.
    Database::updateSchema('\\Fisharebest\\Webtrees\\Schema', 'WT_SCHEMA_VERSION', 30);
    // Create the admin user
    $admin = User::create($_POST['wtuser'], $_POST['wtname'], $_POST['wtemail'], $_POST['wtpass']);
    $admin->setPreference('canadmin', '1');
    $admin->setPreference('language', WT_LOCALE);
    $admin->setPreference('verified', '1');
    $admin->setPreference('verified_by_admin', '1');
    $admin->setPreference('auto_accept', '0');
    $admin->setPreference('visibleonline', '1');
Exemplo n.º 30
0
	<div class="col-xs-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h2 class="panel-title">
					<?php 
echo I18N::translate('MySQL variables');
?>
				</h2>
			</div>
			<div class="panel-body">
				<dl>
					<?php 
foreach ($variables as $variable => $value) {
    ?>
						<dt><?php 
    echo Filter::escapeHtml($variable);
    ?>
</dt>
						<dd><?php 
    echo Filter::escapeHtml($value);
    ?>
</dd>
					<?php 
}
?>
				</dl>
			</div>
		</div>
	</div>
</div>
<?php