Example #1
0
 /**
  * These functions provide access to hitcounter for use in the HTML block.
  *
  * @param string   $page_name
  * @param string[] $params
  *
  * @return string
  */
 private function hitCountQuery($page_name, $params)
 {
     if (is_array($params) && isset($params[0]) && $params[0] != '') {
         $page_parameter = $params[0];
     } else {
         $page_parameter = '';
     }
     if ($page_name === null) {
         // index.php?ctype=gedcom
         $page_name = 'index.php';
         $page_parameter = 'gedcom:' . ($page_parameter ? Tree::findByName($page_parameter)->getTreeId() : $this->tree->getTreeId());
     } elseif ($page_name == 'index.php') {
         // index.php?ctype=user
         $user = User::findByIdentifier($page_parameter);
         $page_parameter = 'user:'******'<span class="odometer">' . I18N::digits(HitCounter::getCount($this->tree, $page_name, $page_parameter)) . '</span>';
 }
Example #2
0
 /**
  * Add markup to the hit counter.
  *
  * @param int $count
  *
  * @return string
  */
 protected function formatPageViews($count)
 {
     if ($count > 0) {
         return '<div class="page-views">' . I18N::plural('This page has been viewed %s time.', 'This page has been viewed %s times.', $count, '<span class="odometer">' . I18N::digits($count) . '</span>') . '</div>';
     } else {
         return '';
     }
 }
Example #3
0
		<div id="pgv-import-wizard" class="panel-collapse collapse">
			<div class="panel-body">
				<p>
					<?php 
    echo I18N::translate('The PhpGedView to webtrees wizard is an automated process to assist administrators make the move from a PhpGedView installation to a new webtrees one.  It will transfer all PhpGedView GEDCOM and other database information directly to your new webtrees database.  The following requirements are necessary:');
    ?>
				</p>
				<ul>
					<li>
						<?php 
    echo I18N::translate('webtrees’ database must be on the same server as PhpGedView’s');
    ?>
					</li>
					<li>
						<?php 
    echo I18N::translate('PhpGedView must be version 4.2.3, or any SVN up to #%s', I18N::digits(7101));
    ?>
					</li>
					<li>
						<?php 
    echo I18N::translate('All changes in PhpGedView must be accepted');
    ?>
					</li>
					<li>
						<?php 
    echo I18N::translate('All existing PhpGedView users must have distinct email addresses');
    ?>
					</li>
				</ul>
				<p>
					<?php 
Example #4
0
 /**
  * Generate the %Y format for a date.
  *
  * @return string
  */
 protected function formatLongYear()
 {
     return I18N::digits($this->y);
 }
Example #5
0
 /**
  * Convert a unix timestamp into a formatted date-time value, for logs, etc.
  * Don't attempt to convert into other calendars, as not all days start at
  * midnight, and we can only get it wrong.
  *
  * @param int $time
  *
  * @return string
  */
 public static function formatTimestamp($time)
 {
     $time_fmt = I18N::timeFormat();
     // PHP::date() doesn't do I18N. Do it ourselves....
     preg_match_all('/%[^%]/', $time_fmt, $matches);
     foreach ($matches[0] as $match) {
         switch ($match) {
             case '%a':
                 $t = gmdate('His', $time);
                 if ($t == '000000') {
                     $time_fmt = str_replace($match, I18N::translate('midnight'), $time_fmt);
                 } elseif ($t < '120000') {
                     $time_fmt = str_replace($match, I18N::translate('a.m.'), $time_fmt);
                 } elseif ($t == '120000') {
                     $time_fmt = str_replace($match, I18N::translate('noon'), $time_fmt);
                 } else {
                     $time_fmt = str_replace($match, I18N::translate('p.m.'), $time_fmt);
                 }
                 break;
             case '%A':
                 $t = gmdate('His', $time);
                 if ($t == '000000') {
                     $time_fmt = str_replace($match, I18N::translate('Midnight'), $time_fmt);
                 } elseif ($t < '120000') {
                     $time_fmt = str_replace($match, I18N::translate('A.M.'), $time_fmt);
                 } elseif ($t == '120000') {
                     $time_fmt = str_replace($match, I18N::translate('Noon'), $time_fmt);
                 } else {
                     $time_fmt = str_replace($match, I18N::translate('P.M.'), $time_fmt);
                 }
                 break;
             default:
                 $time_fmt = str_replace($match, I18N::digits(gmdate(substr($match, -1), $time)), $time_fmt);
         }
     }
     return self::timestampToGedcomDate($time)->display() . '<span class="date"> - ' . $time_fmt . '</span>';
 }
Example #6
0
 /**
  * Generate the %Y format for a date.
  *
  * @return string
  */
 protected function formatLongYear()
 {
     if ($this->y < 0) {
         return I18N::translate('%s&nbsp;BCE', I18N::digits(-$this->y));
     } else {
         if ($this->new_old_style) {
             return I18N::translate('%s&nbsp;CE', I18N::digits(sprintf('%d/%02d', $this->y - 1, $this->y % 100)));
         } else {
             return I18N::translate('%s&nbsp;CE', I18N::digits($this->y));
         }
     }
 }
Example #7
0
        echo " onclick=\"statusDisable('z-axis-boundaries-periods');";
        echo '"><label for="z_none">', I18N::translate('overall'), '</label><br>';
        echo '<input type="radio" id="z_sex" name="z-as" value="301" ';
        echo " onclick=\"statusDisable('z-axis-boundaries-periods');";
        echo '"><label for="z_sex">', I18N::translate('gender'), '</label><br>';
        echo '<input type="radio" id="z_time" name="z-as" value="302" checked';
        echo " onclick=\"statusEnable('z-axis-boundaries-periods');";
        echo '"><label for="z_time">', I18N::translate('date periods'), '</label><br><br>';
        echo I18N::translate('Date range'), '<br>';
        echo '<select id="z-axis-boundaries-periods" name="z-axis-boundaries-periods">
				<option value="1700,1750,1800,1850,1900,1950,2000" selected>', I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, I18N::digits(1700), I18N::number(50)), '</option>
				<option value="1800,1840,1880,1920,1950,1970,2000">', I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 40, I18N::digits(1800), I18N::number(40)), '</option>
				<option value="1800,1850,1900,1950,2000">', I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, I18N::digits(1800), I18N::number(50)), '</option>
				<option value="1900,1920,1940,1960,1980,1990,2000">', I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 20, I18N::digits(1900), I18N::number(20)), '</option>
				<option value="1900,1925,1950,1975,2000">', I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 25, I18N::digits(1900), I18N::number(25)), '</option>
				<option value="1940,1950,1960,1970,1980,1990,2000">', I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 10, I18N::digits(1940), I18N::number(10)), '</option>
			</select>
			<br><br>';
        echo I18N::translate('Results'), '<br>';
        echo '<input type="radio" id="y_num" name="y-as" value="201" checked';
        echo '><label for="y_num">', I18N::translate('numbers'), '</label><br>';
        echo '<input type="radio" id="y_perc" name="y-as" value="202" ';
        echo '><label for="y_perc">', I18N::translate('percentage'), '</label><br>';
        echo '</td>
			</tr>
			</table>
			<table width="100%">
			<tr align="center"><td>
				<br>
				<input type="submit" value="', I18N::translate('show the plot'), ' ">
				<input type="reset"  value=" ', I18N::translate('reset'), ' " onclick="{statusEnable(\'z_sex\'); statusHide(\'x_years\'); statusHide(\'x_months\'); statusHide(\'x_numbers\'); statusHide(\'map_opt\');}"><br>
Example #8
0
        echo I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, I18N::digits(1800), I18N::number(50));
        ?>
									</option>
									<option value="1900,1920,1940,1960,1980,1990,2000">
										<?php 
        echo I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 20, I18N::digits(1900), I18N::number(20));
        ?>
									</option>
									<option value="1900,1925,1950,1975,2000">
										<?php 
        echo I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 25, I18N::digits(1900), I18N::number(25));
        ?>
									</option>
									<option value="1940,1950,1960,1970,1980,1990,2000">
										<?php 
        echo I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 10, I18N::digits(1940), I18N::number(10));
        ?>
									</option>
								</select>
								<br>
								<br>
								<?php 
        echo I18N::translate('Results');
        ?>
								<br>
								<label>
									<input type="radio" name="y-as" value="201" checked>
									<?php 
        echo I18N::translate('numbers');
        ?>
								</label>