当前位置: 首页>>代码示例>>PHP>>正文


PHP WT_I18N::number方法代码示例

本文整理汇总了PHP中WT_I18N::number方法的典型用法代码示例。如果您正苦于以下问题:PHP WT_I18N::number方法的具体用法?PHP WT_I18N::number怎么用?PHP WT_I18N::number使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WT_I18N的用法示例。


在下文中一共展示了WT_I18N::number方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getBlock

 public function getBlock($block_id, $template = true, $cfg = null)
 {
     global $ctype;
     require_once WT_ROOT . 'includes/functions/functions_print_lists.php';
     $days = get_block_setting($block_id, 'days', self::DEFAULT_DAYS);
     $infoStyle = get_block_setting($block_id, 'infoStyle', 'table');
     $sortStyle = get_block_setting($block_id, 'sortStyle', 'date_desc');
     $hide_empty = get_block_setting($block_id, 'hide_empty', false);
     $block = get_block_setting($block_id, 'block', true);
     if ($cfg) {
         foreach (array('days', 'infoStyle', 'show_parents', 'sortStyle', 'hide_empty', 'block') as $name) {
             if (array_key_exists($name, $cfg)) {
                 ${$name} = $cfg[$name];
             }
         }
     }
     $found_facts = get_recent_changes(WT_CLIENT_JD - $days);
     if (!$found_facts && $hide_empty) {
         return '';
     }
     // Print block header
     $id = $this->getName() . $block_id;
     $class = $this->getName() . '_block';
     if ($ctype == 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype == 'user' && WT_USER_ID) {
         $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>';
     } else {
         $title = '';
     }
     $title .= WT_I18N::plural('Changes in the last day', 'Changes in the last %s days', $days, WT_I18N::number($days));
     $content = '';
     // Print block content
     if (count($found_facts) == 0) {
         $content .= WT_I18N::translate('There have been no changes within the last %s days.', WT_I18N::number($days));
     } else {
         ob_start();
         switch ($infoStyle) {
             case 'list':
                 $content .= print_changes_list($found_facts, $sortStyle);
                 break;
             case 'table':
                 // sortable table
                 $content .= print_changes_table($found_facts, $sortStyle);
                 break;
         }
         $content .= ob_get_clean();
     }
     if ($template) {
         if ($block) {
             require WT_THEME_DIR . 'templates/block_small_temp.php';
         } else {
             require WT_THEME_DIR . 'templates/block_main_temp.php';
         }
     } else {
         return $content;
     }
 }
开发者ID:brambravo,项目名称:webtrees,代码行数:56,代码来源:module.php

示例2: execution_stats

/**
 * Prints Exection Statistics
 *
 * prints out the execution time and the databse queries
 */
function execution_stats()
{
    global $start_time;
    return '<div class="execution_stats">' . WT_I18N::translate('Execution time: %1$s seconds. Database queries: %2$s. Memory usage: %3$s KB.', WT_I18N::number(microtime(true) - $start_time, 3), WT_I18N::number(WT_DB::getQueryCount()), WT_I18N::number(memory_get_peak_usage(true) / 1024)) . '</div>';
}
开发者ID:brambravo,项目名称:webtrees,代码行数:10,代码来源:functions_print.php

示例3: help_link

			<input type="hidden" name="action" value="register">
			<h4>', WT_I18N::translate('All fields must be completed.'), '</h4><hr>
			<div>
				<label for="user_realname">', WT_I18N::translate('Real name'), help_link('real_name'), '<input type="text" id="user_realname" name="user_realname" required maxlength="64" value="', WT_Filter::escapeHtml($user_realname), '" autofocus>
				</label>
			</div>
			<div>
				<label for="user_email">', WT_I18N::translate('Email address'), help_link('email'), '<input type="email" id="user_email" name="user_email" required maxlength="64" value="', WT_Filter::escapeHtml($user_email), '">
				</label>
			</div>
			<div>
				<label for="username">', WT_I18N::translate('Desired user name'), help_link('username'), '<input type="text" id="username" name="user_name" required maxlength="32" value="', WT_Filter::escapeHtml($user_name), '">
				</label>
			</div>
			<div>
				<label for="user_password01">', WT_I18N::translate('Desired password'), help_link('password'), '<input type="password" id="user_password01" name="user_password01" value="', WT_Filter::escapeHtml($user_password01), '" required placeholder="', WT_I18N::plural('Use at least %s character.', 'Use at least %s characters.', WT_MINIMUM_PASSWORD_LENGTH, WT_I18N::number(WT_MINIMUM_PASSWORD_LENGTH)), '" pattern="' . WT_REGEX_PASSWORD . '" onchange="form.user_password02.pattern = regex_quote(this.value);">
				</label>
			</div>
			<div>
				<label for="user_password02">', WT_I18N::translate('Confirm password'), help_link('password_confirm'), '<input type="password" id="user_password02" name="user_password02" value="', WT_Filter::escapeHtml($user_password02), '" required placeholder="', WT_I18N::translate('Type the password again.'), '" pattern="' . WT_REGEX_PASSWORD . '">
				</label>
			</div>
			<div>
				<label for="user_comments">', WT_I18N::translate('Comments'), help_link('register_comments'), '<textarea cols="50" rows="5" id="user_comments" name="user_comments" required placeholder="', WT_I18N::translate('Explain why you are requesting an account.'), '">', WT_Filter::escapeHtml($user_comments), '</textarea>
				</label>
			</div>
			<hr>
			<div id="registration-submit">
				<input type="submit" value="', WT_I18N::translate('continue'), '">
			</div>
		</form>
开发者ID:sadr110,项目名称:webtrees,代码行数:31,代码来源:login.php

示例4: adminPlaceCheck


//.........这里部分代码省略.........
                    $level = 0;
                    $matched[$x] = 0;
                    // used to exclude places where the gedcom place is matched at all levels
                    $mapstr_edit = "<a href=\"#\" onclick=\"edit_place_location('";
                    $mapstr_add = "<a href=\"#\" onclick=\"add_place_location('";
                    $mapstr3 = "";
                    $mapstr4 = "";
                    $mapstr5 = "')\" title='";
                    $mapstr6 = "' >";
                    $mapstr7 = "')\">";
                    $mapstr8 = "</a>";
                    $plac = array();
                    $lati = array();
                    $long = array();
                    while ($z < $parts) {
                        if ($levels[$z] == ' ' || $levels[$z] == '') {
                            $levels[$z] = "unknown";
                        }
                        // GoogleMap module uses "unknown" while GEDCOM uses , ,
                        $levels[$z] = rtrim(ltrim($levels[$z]));
                        $placelist = $this->createPossiblePlaceNames($levels[$z], $z + 1);
                        // add the necessary prefix/postfix values to the place name
                        foreach ($placelist as $key => $placename) {
                            $row = WT_DB::prepare("SELECT pl_id, pl_place, pl_long, pl_lati, pl_zoom FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place")->execute(array($z, $id, $placename))->fetchOneRow(PDO::FETCH_ASSOC);
                            if (!empty($row['pl_id'])) {
                                $row['pl_placerequested'] = $levels[$z];
                                // keep the actual place name that was requested so we can display that instead of what is in the db
                                break;
                            }
                        }
                        if ($row['pl_id'] != '') {
                            $id = $row['pl_id'];
                        }
                        if ($row['pl_place'] != '') {
                            $placestr2 = $mapstr_edit . $id . "&amp;level=" . $level . $mapstr3 . $mapstr5 . WT_I18N::translate('Zoom=') . $row['pl_zoom'] . $mapstr6 . $row['pl_placerequested'] . $mapstr8;
                            if ($row['pl_place'] == 'unknown') {
                                $matched[$x]++;
                            }
                        } else {
                            if ($levels[$z] == "unknown") {
                                $placestr2 = $mapstr_add . $id . "&amp;level=" . $level . $mapstr3 . $mapstr7 . "<strong>" . rtrim(ltrim(WT_I18N::translate('unknown'))) . "</strong>" . $mapstr8;
                                $matched[$x]++;
                            } else {
                                $placestr2 = $mapstr_add . $id . "&amp;place_name=" . urlencode($levels[$z]) . "&amp;level=" . $level . $mapstr3 . $mapstr7 . '<span class="error">' . rtrim(ltrim($levels[$z])) . '</span>' . $mapstr8;
                                $matched[$x]++;
                            }
                        }
                        $plac[$z] = "<td>" . $placestr2 . "</td>\n";
                        if ($row['pl_lati'] == '0') {
                            $lati[$z] = "<td class='error'><strong>" . $row['pl_lati'] . "</strong></td>";
                        } elseif ($row['pl_lati'] != '') {
                            $lati[$z] = "<td>" . $row['pl_lati'] . "</td>";
                        } else {
                            $lati[$z] = "<td class='error center'><strong>X</strong></td>";
                            $matched[$x]++;
                        }
                        if ($row['pl_long'] == '0') {
                            $long[$z] = "<td class='error'><strong>" . $row['pl_long'] . "</strong></td>";
                        } elseif ($row['pl_long'] != '') {
                            $long[$z] = "<td>" . $row['pl_long'] . "</td>";
                        } else {
                            $long[$z] = "<td class='error center'><strong>X</strong></td>";
                            $matched[$x]++;
                        }
                        $level++;
                        $mapstr3 = $mapstr3 . "&amp;parent[" . $z . "]=" . WT_Filter::escapeJs($row['pl_placerequested']);
                        $mapstr4 = $mapstr4 . "&amp;parent[" . $z . "]=" . WT_Filter::escapeJs($levels[$z]);
                        $z++;
                    }
                    if ($matching) {
                        $matched[$x] = 1;
                    }
                    if ($matched[$x] != 0) {
                        echo $gedplace;
                        $z = 0;
                        while ($z < $max) {
                            if ($z < $parts) {
                                echo $plac[$z];
                                echo $lati[$z];
                                echo $long[$z];
                            } else {
                                echo '<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>';
                            }
                            $z++;
                        }
                        echo '</tr>';
                        $countrows++;
                    }
                    $x++;
                }
                // echo final row of table
                echo '<tr><td colspan="2" class="accepted">', WT_I18N::translate('Total places: %s', WT_I18N::number($countrows)), '</td></tr></table></div>';
                break;
            default:
                // Do not run until user selects a gedcom/place/etc.
                // Instead, show some useful help info.
                echo '<div class="gm_check_top accepted">', WT_I18N::translate('This will list all the places from the selected GEDCOM file. By default this will NOT INCLUDE places that are fully matched between the GEDCOM file and the GoogleMap tables'), '</div>';
                break;
        }
    }
开发者ID:jacoline,项目名称:webtrees,代码行数:101,代码来源:module.php

示例5: set_params

function set_params($current, $indfam, $xg, $zg, $titstr, $xt, $yt, $gx, $gz, $myfunc)
{
    global $x_as, $y_as, $z_as, $n1, $months;
    global $legend, $xdata, $ydata, $xmax, $zmax, $zgrenzen, $xgiven, $zgiven, $percentage, $male_female;
    global $stats;
    if (!function_exists($myfunc)) {
        echo WT_I18N::translate('%s not implemented', $myfunc);
        exit;
    }
    $monthdata = array();
    for ($i = 0; $i < 12; ++$i) {
        $monthdata[$i] = WT_Date_Gregorian::monthNameNominativeCase($i + 1, false);
    }
    $months = array('JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC');
    if ($x_as == $current) {
        if (($x_as == 13 || $x_as == 15) && $z_as == 301) {
            $z_as = 300;
        }
        $xgiven = $xg;
        $zgiven = $zg;
        $title = $titstr;
        $xtitle = $xt;
        $ytitle = WT_I18N::translate('numbers');
        $grenzen_xas = $gx;
        $grenzen_zas = $gz;
        if ($xg == true) {
            $xdata = $monthdata;
            $xmax = 12;
        } else {
            calc_axis($grenzen_xas);
        }
        if ($z_as != 300 && $z_as != 301) {
            calc_legend($grenzen_zas);
        }
        $percentage = false;
        if ($y_as == 201) {
            $percentage = false;
            if ($current == 13 || $current == 15 || $current == 16 || $current == 21) {
                $ytitle = WT_I18N::translate('Families');
            } else {
                if ($current == 14) {
                    $ytitle = WT_I18N::translate('Children');
                } else {
                    $ytitle = WT_I18N::translate('Individuals');
                }
            }
        } else {
            if ($y_as == 202) {
                $percentage = true;
                $ytitle = WT_I18N::translate('percentage');
            }
        }
        $male_female = false;
        if ($z_as == 300) {
            $zgiven = false;
            $legend[0] = 'all';
            $zmax = 1;
            $zgrenzen[0] = 100000;
        } else {
            if ($z_as == 301) {
                $male_female = true;
                $zgiven = true;
                $legend[0] = WT_I18N::translate('Male');
                $legend[1] = WT_I18N::translate('Female');
                $zmax = 2;
                $xtitle = $xtitle . WT_I18N::translate(' per gender');
            } else {
                if ($z_as == 302) {
                    $xtitle = $xtitle . WT_I18N::translate(' per time period');
                }
            }
        }
        //-- reset the data array
        for ($i = 0; $i < $zmax; $i++) {
            for ($j = 0; $j < $xmax; $j++) {
                $ydata[$i][$j] = 0;
            }
        }
        $myfunc();
        if ($indfam == 'IND') {
            $hstr = $title . '|' . WT_I18N::translate('Counts ') . ' ' . WT_I18N::number($n1) . ' ' . WT_I18N::translate('of') . ' ' . $stats->totalIndividuals();
        } else {
            if ($x_as == 21) {
                $hstr = $title . '|' . WT_I18N::translate('Counts ') . ' ' . WT_I18N::number($n1) . ' ' . WT_I18N::translate('of') . ' ' . $stats->totalChildren();
            } else {
                $hstr = $title . '|' . WT_I18N::translate('Counts ') . ' ' . WT_I18N::number($n1) . ' ' . WT_I18N::translate('of') . ' ' . $stats->totalFamilies();
            }
        }
        myplot($hstr, $zmax, $xdata, $xtitle, $ydata, $ytitle, $legend);
    }
}
开发者ID:brambravo,项目名称:webtrees,代码行数:91,代码来源:statisticsplot.php

示例6:

                    echo " onclick=\"statusDisable('zas-grenzen-periode');";
                    echo '"><label for="z_sex">', WT_I18N::translate('gender'), '</label><br>';
                    echo '<input type="radio" id="z_time" name="z-as" value="302"';
                    if ($plotshow == "302") {
                        echo ' checked="checked"';
                    }
                    echo " onclick=\"statusEnable('zas-grenzen-periode');";
                    echo '"><label for="z_time">', WT_I18N::translate('date periods'), '</label><br><br>';
                    echo WT_I18N::translate('Date range'), '<br>';
                    echo '<select id="zas-grenzen-periode" name="zas-grenzen-periode">
				<option value="1700,1750,1800,1850,1900,1950,2000" selected="selected">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, WT_I18N::digits(1700), WT_I18N::number(50)), '</option>
				<option value="1800,1840,1880,1920,1950,1970,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 40, WT_I18N::digits(1800), WT_I18N::number(40)), '</option>
				<option value="1800,1850,1900,1950,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, WT_I18N::digits(1800), WT_I18N::number(50)), '</option>
				<option value="1900,1920,1940,1960,1980,1990,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 20, WT_I18N::digits(1900), WT_I18N::number(20)), '</option>
				<option value="1900,1925,1950,1975,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 25, WT_I18N::digits(1900), WT_I18N::number(25)), '</option>
				<option value="1940,1950,1960,1970,1980,1990,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 10, WT_I18N::digits(1940), WT_I18N::number(10)), '</option>
			</select>
			<br><br>';
                    echo WT_I18N::translate('results:'), '<br>';
                    echo '<input type="radio" id="y_num" name="y-as" value="201"';
                    if ($plotnp == "201") {
                        echo ' checked="checked"';
                    }
                    echo '><label for="y_num">', WT_I18N::translate('numbers'), '</label><br>';
                    echo '<input type="radio" id="y_perc" name="y-as" value="202"';
                    if ($plotnp == "202") {
                        echo ' checked="checked"';
                    }
                    echo '><label for="y_perc">', WT_I18N::translate('percentage'), '</label><br>';
                    echo '</td>
			</tr>
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:statistics.php

示例7: getImageAttributes

 /**
  * get image properties
  *
  * @param string $which     specify either 'main' or 'thumb'
  * @param int    $addWidth  amount to add to width
  * @param int    $addHeight amount to add to height
  *
  * @return array
  */
 public function getImageAttributes($which = 'main', $addWidth = 0, $addHeight = 0)
 {
     global $THUMBNAIL_WIDTH;
     $var = $which . 'imagesize';
     if (!empty($this->{$var})) {
         return $this->{$var};
     }
     $imgsize = array();
     if ($this->fileExists($which)) {
         $imgsize = @getimagesize($this->getServerFilename($which));
         // [0]=width [1]=height [2]=filetype ['mime']=mimetype
         if (is_array($imgsize) && !empty($imgsize['0'])) {
             // this is an image
             $imgsize[0] = $imgsize[0] + 0;
             $imgsize[1] = $imgsize[1] + 0;
             $imgsize['adjW'] = $imgsize[0] + $addWidth;
             // adjusted width
             $imgsize['adjH'] = $imgsize[1] + $addHeight;
             // adjusted height
             $imageTypes = array('', 'GIF', 'JPG', 'PNG', 'SWF', 'PSD', 'BMP', 'TIFF', 'TIFF', 'JPC', 'JP2', 'JPX', 'JB2', 'SWC', 'IFF', 'WBMP', 'XBM');
             $imgsize['ext'] = $imageTypes[0 + $imgsize[2]];
             // this is for display purposes, always show non-adjusted info
             $imgsize['WxH'] = WT_I18N::translate('%1$s × %2$s pixels', WT_I18N::number($imgsize['0']), WT_I18N::number($imgsize['1']));
             $imgsize['imgWH'] = ' width="' . $imgsize['adjW'] . '" height="' . $imgsize['adjH'] . '" ';
             if ($which == 'thumb' && $imgsize['0'] > $THUMBNAIL_WIDTH) {
                 // don’t let large images break the dislay
                 $imgsize['imgWH'] = ' width="' . $THUMBNAIL_WIDTH . '" ';
             }
         }
     }
     if (!is_array($imgsize) || empty($imgsize['0'])) {
         // this is not an image, OR the file doesn’t exist OR it is a url
         $imgsize[0] = 0;
         $imgsize[1] = 0;
         $imgsize['adjW'] = 0;
         $imgsize['adjH'] = 0;
         $imgsize['ext'] = '';
         $imgsize['mime'] = '';
         $imgsize['WxH'] = '';
         $imgsize['imgWH'] = '';
         if ($this->isExternal($which)) {
             // don’t let large external images break the dislay
             $imgsize['imgWH'] = ' width="' . $THUMBNAIL_WIDTH . '" ';
         }
     }
     if (empty($imgsize['mime'])) {
         // this is not an image, OR the file doesn’t exist OR it is a url
         // set file type equal to the file extension - can’t use parse_url because this may not be a full url
         $exp = explode('?', $this->file);
         $pathinfo = pathinfo($exp[0]);
         $imgsize['ext'] = @strtoupper($pathinfo['extension']);
         // all mimetypes we wish to serve with the media firewall must be added to this array.
         $mime = array('DOC' => 'application/msword', 'MOV' => 'video/quicktime', 'MP3' => 'audio/mpeg', 'PDF' => 'application/pdf', 'PPT' => 'application/vnd.ms-powerpoint', 'RTF' => 'text/rtf', 'SID' => 'image/x-mrsid', 'TXT' => 'text/plain', 'XLS' => 'application/vnd.ms-excel', 'WMV' => 'video/x-ms-wmv');
         if (empty($mime[$imgsize['ext']])) {
             // if we don’t know what the mimetype is, use something ambiguous
             $imgsize['mime'] = 'application/octet-stream';
             if ($this->fileExists($which)) {
                 // alert the admin if we cannot determine the mime type of an existing file
                 // as the media firewall will be unable to serve this file properly
                 Log::addMediaLog('Media Firewall error: >Unknown Mimetype< for file >' . $this->file . '<');
             }
         } else {
             $imgsize['mime'] = $mime[$imgsize['ext']];
         }
     }
     $this->{$var} = $imgsize;
     return $this->{$var};
 }
开发者ID:sadr110,项目名称:webtrees,代码行数:77,代码来源:Media.php

示例8: media_file_info

function media_file_info($media_folder, $media_path, $file)
{
    $html = '<b>' . WT_Filter::escapeHtml($file) . '</b>';
    $full_path = WT_DATA_DIR . $media_folder . $media_path . $file;
    if ($file && file_exists($full_path)) {
        $size = @filesize($full_path);
        if ($size !== false) {
            $size = (int) (($size + 1023) / 1024);
            // Round up to next KB
            $size = WT_I18N::translate('%s KB', WT_I18N::number($size));
            $html .= WT_Gedcom_Tag::getLabelValue('__FILE_SIZE__', $size);
            $imgsize = @getimagesize($full_path);
            if (is_array($imgsize)) {
                $imgsize = WT_I18N::translate('%1$s × %2$s pixels', WT_I18N::number($imgsize['0']), WT_I18N::number($imgsize['1']));
                $html .= WT_Gedcom_Tag::getLabelValue('__IMAGE_SIZE__', $imgsize);
            }
        } else {
            $html .= '<div class="error">' . WT_I18N::translate('This media file exists, but cannot be accessed.') . '</div>';
        }
    } else {
        $html .= '<div class="error">' . WT_I18N::translate('This media file does not exist.') . '</div>';
    }
    return $html;
}
开发者ID:brambravo,项目名称:webtrees,代码行数:24,代码来源:admin_media.php

示例9: VALUES

    case 'repo.php':
        $page_parameter = WT_Filter::get('rid', WT_REGEX_XREF);
        break;
    case 'note.php':
        $page_parameter = WT_Filter::get('nid', WT_REGEX_XREF);
        break;
    case 'mediaviewer.php':
        $page_parameter = WT_Filter::get('mid', WT_REGEX_XREF);
        break;
    default:
        $page_parameter = '';
        break;
}
if ($page_parameter) {
    $hitCount = WT_DB::prepare("SELECT page_count FROM `##hit_counter`" . " WHERE gedcom_id=? AND page_name=? AND page_parameter=?")->execute(array(WT_GED_ID, WT_SCRIPT_NAME, $page_parameter))->fetchOne();
    // Only record one hit per session
    if ($page_parameter && empty($WT_SESSION->SESSION_PAGE_HITS[WT_SCRIPT_NAME . $page_parameter])) {
        $WT_SESSION->SESSION_PAGE_HITS[WT_SCRIPT_NAME . $page_parameter] = true;
        if (is_null($hitCount)) {
            $hitCount = 1;
            WT_DB::prepare("INSERT INTO `##hit_counter` (gedcom_id, page_name, page_parameter, page_count) VALUES (?, ?, ?, ?)")->execute(array(WT_GED_ID, WT_SCRIPT_NAME, $page_parameter, $hitCount));
        } else {
            $hitCount++;
            WT_DB::prepare("UPDATE `##hit_counter` SET page_count=?" . " WHERE gedcom_id=? AND page_name=? AND page_parameter=?")->execute(array($hitCount, WT_GED_ID, WT_SCRIPT_NAME, $page_parameter));
        }
    }
} else {
    $hitCount = 1;
}
$hitCount = '<span class="hit-counter">' . WT_I18N::number($hitCount) . '</span>';
unset($page_name, $page_parameter);
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:hitcount.php

示例10: help_link

				<tr>
					<th colspan="2">
						<?php 
echo WT_I18N::translate('Places');
?>
					</th>
				</tr>
				<tr>
					<td>
						<?php 
echo WT_I18N::translate('Abbreviate place names'), help_link('SHOW_PEDIGREE_PLACES');
?>
					</td>
					<td>
						<?php 
echo WT_I18N::translate('Show the %1$s %2$s parts of a place name.', select_edit_control('NEW_SHOW_PEDIGREE_PLACES_SUFFIX', array(false => WT_I18N::translate_c('Show the [first/last] [N] parts of a place name.', 'first'), true => WT_I18N::translate_c('Show the [first/last] [N] parts of a place name.', 'last')), null, get_gedcom_setting(WT_GED_ID, 'SHOW_PEDIGREE_PLACES_SUFFIX')), select_edit_control('NEW_SHOW_PEDIGREE_PLACES', array(1 => WT_I18N::number(1), 2 => WT_I18N::number(2), 3 => WT_I18N::number(3), 4 => WT_I18N::number(4), 5 => WT_I18N::number(5), 6 => WT_I18N::number(6), 7 => WT_I18N::number(7), 8 => WT_I18N::number(8), 9 => WT_I18N::number(9)), null, get_gedcom_setting(WT_GED_ID, 'SHOW_PEDIGREE_PLACES')));
?>
					</td>
				</tr>
				<tr>
					<th colspan="2">
						<?php 
echo WT_I18N::translate('Format');
?>
					</th>
				</tr>
				<tr>
					<td>
						<?php 
echo WT_I18N::translate('Format text and notes'), help_link('FORMAT_TEXT');
?>
开发者ID:jacoline,项目名称:webtrees,代码行数:31,代码来源:admin_trees_config.php

示例11: _centuryName

 private static function _centuryName($century)
 {
     if ($century < 0) {
         return str_replace(-$century, WT_Stats::_centuryName(-$century), WT_I18N::translate('%s BCE', WT_I18N::number(-$century)));
     }
     // The current chart engine (Google charts) can't handle <sup></sup> markup
     switch ($century) {
         case 21:
             return strip_tags(WT_I18N::translate_c('CENTURY', '21st'));
         case 20:
             return strip_tags(WT_I18N::translate_c('CENTURY', '20th'));
         case 19:
             return strip_tags(WT_I18N::translate_c('CENTURY', '19th'));
         case 18:
             return strip_tags(WT_I18N::translate_c('CENTURY', '18th'));
         case 17:
             return strip_tags(WT_I18N::translate_c('CENTURY', '17th'));
         case 16:
             return strip_tags(WT_I18N::translate_c('CENTURY', '16th'));
         case 15:
             return strip_tags(WT_I18N::translate_c('CENTURY', '15th'));
         case 14:
             return strip_tags(WT_I18N::translate_c('CENTURY', '14th'));
         case 13:
             return strip_tags(WT_I18N::translate_c('CENTURY', '13th'));
         case 12:
             return strip_tags(WT_I18N::translate_c('CENTURY', '12th'));
         case 11:
             return strip_tags(WT_I18N::translate_c('CENTURY', '11th'));
         case 10:
             return strip_tags(WT_I18N::translate_c('CENTURY', '10th'));
         case 9:
             return strip_tags(WT_I18N::translate_c('CENTURY', '9th'));
         case 8:
             return strip_tags(WT_I18N::translate_c('CENTURY', '8th'));
         case 7:
             return strip_tags(WT_I18N::translate_c('CENTURY', '7th'));
         case 6:
             return strip_tags(WT_I18N::translate_c('CENTURY', '6th'));
         case 5:
             return strip_tags(WT_I18N::translate_c('CENTURY', '5th'));
         case 4:
             return strip_tags(WT_I18N::translate_c('CENTURY', '4th'));
         case 3:
             return strip_tags(WT_I18N::translate_c('CENTURY', '3rd'));
         case 2:
             return strip_tags(WT_I18N::translate_c('CENTURY', '2nd'));
         case 1:
             return strip_tags(WT_I18N::translate_c('CENTURY', '1st'));
         default:
             return $century - 1 . '01-' . $century . '00';
     }
 }
开发者ID:sadr110,项目名称:webtrees,代码行数:53,代码来源:Stats.php

示例12: getAge

 static function getAge(WT_Date $d1, WT_Date $d2 = null, $format)
 {
     if ($d2) {
         if ($d2->MaxJD() >= $d1->MinJD() && $d2->MinJD() <= $d1->MinJD()) {
             // Overlapping dates
             $jd = $d1->MinJD();
         } else {
             // Non-overlapping dates
             $jd = $d2->MinJD();
         }
     } else {
         // If second date not specified, use today’s date
         $jd = WT_CLIENT_JD;
     }
     switch ($format) {
         case 0:
             // Years - integer only (for statistics, rather than for display)
             if ($jd && $d1->MinJD() && $d1->MinJD() <= $jd) {
                 return $d1->MinDate()->GetAge(false, $jd, false);
             } else {
                 return -1;
             }
         case 1:
             // Days - integer only (for sorting, rather than for display)
             if ($jd && $d1->MinJD()) {
                 return $jd - $d1->MinJD();
             } else {
                 return -1;
             }
         case 2:
             // Just years, in local digits, with warning for negative/
             if ($jd && $d1->MinJD()) {
                 if ($d1->MinJD() > $jd) {
                     return '<i class="icon-warning"></i>';
                 } else {
                     return WT_I18N::number($d1->MinDate()->GetAge(false, $jd));
                 }
             } else {
                 return '&nbsp;';
             }
             // TODO: combine GetAgeGedcom() into this function
     }
 }
开发者ID:sadr110,项目名称:webtrees,代码行数:43,代码来源:Date.php

示例13:

			</tr>
			<tr>
				<td class="descriptionbox">
					<?php 
echo WT_I18N::translate('Generations');
?>
				</td>
				<td class="optionbox">
					<select name="PEDIGREE_GENERATIONS">
						<?php 
for ($i = 2; $i <= $MAX_PEDIGREE_GENERATIONS; $i++) {
    echo '<option value="', $i, '"';
    if ($i == $OLD_PGENS) {
        echo ' selected="selected"';
    }
    echo '>', WT_I18N::number($i), '</option>';
}
?>
					</select>
				</td>
				<td class="descriptionbox">
					<?php 
echo WT_I18N::translate('Show details');
?>
				</td>
				<td class="optionbox">
					<input type="checkbox" value="<?php 
if ($controller->show_full) {
    echo '1" checked="checked" onclick="document.people.show_full.value=\'0\';';
} else {
    echo '0" onclick="document.people.show_full.value=\'1\';';
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:ancestry.php

示例14: edit_field_integers

function edit_field_integers($name, $selected = '', $min, $max, $extra = '')
{
    $array = array();
    for ($i = $min; $i <= $max; ++$i) {
        $array[$i] = WT_I18N::number($i);
    }
    return select_edit_control($name, $array, null, $selected, $extra);
}
开发者ID:jacoline,项目名称:webtrees,代码行数:8,代码来源:functions_edit.php

示例15: print_events_list

/**
 * print a list of events
 *
 * This performs the same function as print_events_table(), but formats the output differently.
 */
function print_events_list($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv')
{
    // Did we have any output?  Did we skip anything?
    $output = 0;
    $filter = 0;
    $filtered_events = array();
    $html = '';
    foreach (get_events_list($startjd, $endjd, $events) as $fact) {
        $record = $fact->getParent();
        //-- only living people ?
        if ($only_living) {
            if ($record instanceof WT_Individual && $record->isDead()) {
                $filter++;
                continue;
            }
            if ($record instanceof WT_Family) {
                $husb = $record->getHusband();
                if (is_null($husb) || $husb->isDead()) {
                    $filter++;
                    continue;
                }
                $wife = $record->getWife();
                if (is_null($wife) || $wife->isDead()) {
                    $filter++;
                    continue;
                }
            }
        }
        $output++;
        $filtered_events[] = $fact;
    }
    // Now we've filtered the list, we can sort by event, if required
    switch ($sort_by) {
        case 'anniv':
            uasort($filtered_events, function ($x, $y) {
                return WT_Date::compare($y->getDate(), $x->getDate());
                // most recent first
            });
            break;
        case 'alpha':
            uasort($filtered_events, function ($x, $y) {
                return WT_GedcomRecord::compare($x->getParent(), $y->getParent());
            });
            break;
    }
    foreach ($filtered_events as $fact) {
        $record = $fact->getParent();
        $html .= '<a href="' . $record->getHtmlUrl() . '" class="list_item name2">' . $record->getFullName() . '</a>';
        if ($record instanceof WT_Individual) {
            $html .= $record->getSexImage();
        }
        $html .= '<br><div class="indent">';
        $html .= $fact->getLabel() . ' — ' . $fact->getDate()->Display(true);
        if ($fact->anniv) {
            $html .= ' (' . WT_I18N::translate('%s year anniversary', $fact->anniv) . ')';
        }
        if (!$fact->getPlace()->isEmpty()) {
            $html .= ' — <a href="' . $fact->getPlace()->getURL() . '">' . $fact->getPlace()->getFullName() . '</a>';
        }
        $html .= '</div>';
    }
    // Print a final summary message about restricted/filtered facts
    $summary = '';
    if ($endjd == WT_CLIENT_JD) {
        // We're dealing with the Today’s Events block
        if ($output == 0) {
            if ($filter == 0) {
                $summary = WT_I18N::translate('No events exist for today.');
            } else {
                $summary = WT_I18N::translate('No events for living individuals exist for today.');
            }
        }
    } else {
        // We're dealing with the Upcoming Events block
        if ($output == 0) {
            if ($filter == 0) {
                if ($endjd == $startjd) {
                    $summary = WT_I18N::translate('No events exist for tomorrow.');
                } else {
                    // I18N: translation for %s==1 is unused; it is translated separately as “tomorrow”
                    $summary = WT_I18N::plural('No events exist for the next %s day.', 'No events exist for the next %s days.', $endjd - $startjd + 1, WT_I18N::number($endjd - $startjd + 1));
                }
            } else {
                if ($endjd == $startjd) {
                    $summary = WT_I18N::translate('No events for living individuals exist for tomorrow.');
                } else {
                    // I18N: translation for %s==1 is unused; it is translated separately as “tomorrow”
                    $summary = WT_I18N::plural('No events for living people exist for the next %s day.', 'No events for living people exist for the next %s days.', $endjd - $startjd + 1, WT_I18N::number($endjd - $startjd + 1));
                }
            }
        }
    }
    if ($summary) {
        $html .= "<b>" . $summary . "</b>";
    }
//.........这里部分代码省略.........
开发者ID:brambravo,项目名称:webtrees,代码行数:101,代码来源:functions_print_lists.php


注:本文中的WT_I18N::number方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。