本文整理汇总了PHP中_ngettext函数的典型用法代码示例。如果您正苦于以下问题:PHP _ngettext函数的具体用法?PHP _ngettext怎么用?PHP _ngettext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_ngettext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPluralText
public static function getPluralText($singular, $plural, $number)
{
if (self::_getTextMode() == self::GETTEXT_MODE_NATIVE) {
return ngettext($singular, $plural, $number);
}
return _ngettext($singular, $plural, $number);
}
示例2: getBookmarkContent
/**
* Renders the bookmark content
*
* @access public
* @return string
*/
public static function getBookmarkContent()
{
$output = '';
$cfgBookmark = PMA_Bookmark_getParams();
if ($cfgBookmark) {
$tpl_bookmark_actions = '<span class="action collapse">' . __('Collapse') . '</span> ' . '<span class="action expand">' . __('Expand') . '</span> ' . '<span class="action requery">' . __('Requery') . '</span> ' . '<span class="action edit_bookmark">' . __('Edit') . '</span> ' . '<span class="action delete_bookmark">' . __('Delete') . '</span> ' . '<span class="text targetdb">' . __('Database') . ': <span>%s</span></span>';
$bookmarks = PMA_Bookmark_getList();
$output .= '<div class="message welcome"><span>';
$count_bookmarks = count($bookmarks);
if ($count_bookmarks > 0) {
$bookmarks_message = sprintf(_ngettext('Total %d bookmark', 'Total %d bookmarks', $count_bookmarks), $count_bookmarks);
$private_message = sprintf('<span class="bookmark_label">%1$s</span>', __('private'));
$shared_message = sprintf('<span class="bookmark_label shared">%1$s</span>', __('shared'));
$output .= sprintf(__('%1$s, %2$s and %3$s bookmarks included'), $bookmarks_message, $private_message, $shared_message);
} else {
$output .= __('No bookmarks');
}
unset($count_bookmarks, $private_message, $shared_message);
$output .= '</span></div>';
foreach ($bookmarks as $val) {
$output .= '<div class="message collapsed bookmark" bookmarkid="' . $val['id'] . '" targetdb="' . htmlspecialchars($val['db']) . '"><div class="action_content">' . sprintf($tpl_bookmark_actions, htmlspecialchars($val['db'])) . '</div><span class="bookmark_label ' . ($val['shared'] ? 'shared' : '') . '">' . htmlspecialchars($val['label']) . '</span> <span class="query">' . htmlspecialchars($val['query']) . '</span></div>';
}
}
return $output;
}
示例3: make_feed_browser
function make_feed_browser($search, $limit, $mode = 1)
{
if (defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER) {
return;
}
$owner_uid = $_SESSION["uid"];
$rv = '';
if ($search) {
$search_qpart = "AND (UPPER(feed_url) LIKE UPPER('%{$search}%') OR\n\t\t\t\t\t\tUPPER(title) LIKE UPPER('%{$search}%'))";
} else {
$search_qpart = "";
}
if ($mode == 1) {
/* $result = db_query("SELECT feed_url, subscribers FROM
ttrss_feedbrowser_cache WHERE (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf
WHERE tf.feed_url = ttrss_feedbrowser_cache.feed_url
AND owner_uid = '$owner_uid') $search_qpart
ORDER BY subscribers DESC LIMIT $limit"); */
$result = db_query("SELECT feed_url, site_url, title, SUM(subscribers) AS subscribers FROM\n\t\t\t\t\t\t(SELECT feed_url, site_url, title, subscribers FROM ttrss_feedbrowser_cache UNION ALL\n\t\t\t\t\t\t\tSELECT feed_url, site_url, title, subscribers FROM ttrss_linked_feeds) AS qqq\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t(SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf\n\t\t\t\t\t\t\t\tWHERE tf.feed_url = qqq.feed_url\n\t\t\t\t\t\t\t\t\tAND owner_uid = '{$owner_uid}') {$search_qpart}\n\t\t\t\t\t\tGROUP BY feed_url, site_url, title ORDER BY subscribers DESC LIMIT {$limit}");
} else {
if ($mode == 2) {
$result = db_query("SELECT *,\n\t\t\t\t\t\t(SELECT COUNT(*) FROM ttrss_user_entries WHERE\n\t\t\t\t\t \t\torig_feed_id = ttrss_archived_feeds.id) AS articles_archived\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tttrss_archived_feeds\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t(SELECT COUNT(*) FROM ttrss_feeds\n\t\t\t\t\t\t\tWHERE ttrss_feeds.feed_url = ttrss_archived_feeds.feed_url AND\n\t\t\t\t\t\t\t\towner_uid = '{$owner_uid}') = 0\tAND\n\t\t\t\t\t\towner_uid = '{$owner_uid}' {$search_qpart}\n\t\t\t\t\t\tORDER BY id DESC LIMIT {$limit}");
}
}
$feedctr = 0;
while ($line = db_fetch_assoc($result)) {
if ($mode == 1) {
$feed_url = htmlspecialchars($line["feed_url"]);
$site_url = htmlspecialchars($line["site_url"]);
$subscribers = $line["subscribers"];
$check_box = "<input onclick='toggleSelectListRow2(this)'\n\t\t\t\t\t\t\tdojoType=\"dijit.form.CheckBox\"\n\t\t\t\t\t\t\ttype=\"checkbox\" \">";
$class = $feedctr % 2 ? "even" : "odd";
$site_url = "<a target=\"_blank\"\n\t\t\t\t\t\t\thref=\"{$site_url}\">\n\t\t\t\t\t\t\t<span class=\"fb_feedTitle\">" . htmlspecialchars($line["title"]) . "</span></a>";
$feed_url = "<a target=\"_blank\" class=\"fb_feedUrl\"\n\t\t\t\t\t\t\thref=\"{$feed_url}\"><img src='images/pub_set.png'\n\t\t\t\t\t\t\tstyle='vertical-align : middle'></a>";
$rv .= "<li>{$check_box} {$feed_url} {$site_url}" . " <span class='subscribers'>({$subscribers})</span></li>";
} else {
if ($mode == 2) {
$feed_url = htmlspecialchars($line["feed_url"]);
$site_url = htmlspecialchars($line["site_url"]);
$check_box = "<input onclick='toggleSelectListRow2(this)' dojoType=\"dijit.form.CheckBox\"\n\t\t\t\t\t\t\ttype=\"checkbox\">";
$class = $feedctr % 2 ? "even" : "odd";
if ($line['articles_archived'] > 0) {
$archived = sprintf(_ngettext("%d archived article", "%d archived articles", $line['articles_archived']), $line['articles_archived']);
$archived = " <span class='subscribers'>({$archived})</span>";
} else {
$archived = '';
}
$site_url = "<a target=\"_blank\"\n\t\t\t\t\t\t\thref=\"{$site_url}\">\n\t\t\t\t\t\t\t<span class=\"fb_feedTitle\">" . htmlspecialchars($line["title"]) . "</span></a>";
$feed_url = "<a target=\"_blank\" class=\"fb_feedUrl\"\n\t\t\t\t\t\t\thref=\"{$feed_url}\"><img src='images/pub_set.png'\n\t\t\t\t\t\t\tstyle='vertical-align : middle'></a>";
$rv .= "<li id=\"FBROW-" . $line["id"] . "\">" . "{$check_box} {$feed_url} {$site_url} {$archived}</li>";
}
}
++$feedctr;
}
if ($feedctr == 0) {
$rv .= "<li style=\"text-align : center\"><p>" . __('No feeds found.') . "</p></li>";
}
return $rv;
}
示例4: testGettext
public function testGettext()
{
$this->assertEquals('Typ', _gettext('Type'));
$this->assertEquals('Typ', __('Type'));
$this->assertEquals('%d sekundy', _ngettext('%d second', '%d seconds', 2));
$this->assertEquals('%d seconds', _npgettext('context', '%d second', '%d seconds', 2));
$this->assertEquals('Tabulka', _pgettext('Display format', 'Table'));
}
示例5: testGettext
/**
* Test for setting and parsing locales
*
* @param string $locale locale name
*
* @return void
*
* @group large
* @dataProvider listLocales
*/
public function testGettext($locale)
{
/* We should be able to set the language */
$this->assertTrue(PMA_langSet($locale));
/* Bind locales */
_setlocale(LC_MESSAGES, $GLOBALS['lang']);
_bind_textdomain_codeset('phpmyadmin', 'UTF-8');
_textdomain('phpmyadmin');
/* Grab some texts */
$this->assertContains('%s', _ngettext('%s table', '%s tables', 10));
$this->assertContains('%s', _ngettext('%s table', '%s tables', 1));
}
示例6: getBookmarkContent
/**
* Renders the bookmark content
*
* @access public
* @return string
*/
public static function getBookmarkContent()
{
$cfgBookmark = Bookmark::getParams();
if ($cfgBookmark) {
$bookmarks = Bookmark::getList();
$count_bookmarks = count($bookmarks);
if ($count_bookmarks > 0) {
$welcomeMessage = sprintf(_ngettext('Showing %1$d bookmark (both private and shared)', 'Showing %1$d bookmarks (both private and shared)', $count_bookmarks), $count_bookmarks);
} else {
$welcomeMessage = __('No bookmarks');
}
unset($count_bookmarks, $private_message, $shared_message);
return Template::get('console/bookmark_content')->render(array('welcomeMessage' => $welcomeMessage, 'bookmarks' => $bookmarks));
}
return '';
}
示例7: PMA_getHtmlForRefreshList
/**
* Builds a <select> list for refresh rates
*
* @param string $name Name of select
* @param int $defaultRate Currently chosen rate
* @param array $refreshRates List of refresh rates
*
* @return string
*/
function PMA_getHtmlForRefreshList($name, $defaultRate = 5, $refreshRates = array(1, 2, 5, 10, 20, 40, 60, 120, 300, 600))
{
$return = '<select name="' . $name . '" id="id_' . $name . '" class="refreshRate">';
foreach ($refreshRates as $rate) {
$selected = $rate == $defaultRate ? ' selected="selected"' : '';
$return .= '<option value="' . $rate . '"' . $selected . '>';
if ($rate < 60) {
$return .= sprintf(_ngettext('%d second', '%d seconds', $rate), $rate);
} else {
$rate = $rate / 60;
$return .= sprintf(_ngettext('%d minute', '%d minutes', $rate), $rate);
}
$return .= '</option>';
}
$return .= '</select>';
return $return;
}
示例8: make_feed_browser
function make_feed_browser($search, $limit, $mode = 1)
{
if ($mode != 1 && $mode != 2) {
return "";
}
$owner_uid = $_SESSION["uid"];
if ($search) {
$search_qpart = "AND (UPPER(feed_url) LIKE UPPER('%{$search}%') OR\n UPPER(title) LIKE UPPER('%{$search}%'))";
} else {
$search_qpart = "";
}
if ($mode == 1) {
$result = db_query("SELECT feed_url, site_url, title, SUM(subscribers) AS subscribers FROM\n (SELECT feed_url, site_url, title, subscribers FROM ttrss_feedbrowser_cache UNION ALL\n SELECT feed_url, site_url, title, subscribers FROM ttrss_linked_feeds) AS qqq\n WHERE\n (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf\n WHERE tf.feed_url = qqq.feed_url\n AND owner_uid = '{$owner_uid}') {$search_qpart}\n GROUP BY feed_url, site_url, title\n ORDER BY subscribers DESC LIMIT {$limit}");
} elseif ($mode == 2) {
$result = db_query("SELECT *,\n (SELECT COUNT(*) FROM ttrss_user_entries WHERE\n orig_feed_id = ttrss_archived_feeds.id) AS articles_archived\n FROM\n ttrss_archived_feeds\n WHERE\n (SELECT COUNT(*) FROM ttrss_feeds\n WHERE ttrss_feeds.feed_url = ttrss_archived_feeds.feed_url AND\n owner_uid = '{$owner_uid}') = 0 AND\n owner_uid = '{$owner_uid}' {$search_qpart}\n ORDER BY id DESC LIMIT {$limit}");
}
$rv = "";
while ($line = db_fetch_assoc($result)) {
$feed_url = htmlspecialchars($line['feed_url']);
$site_url = htmlspecialchars($line['site_url']);
$check_box = "<input onclick='toggleSelectListRow2(this)'\n dojoType=\"dijit.form.CheckBox\" type=\"checkbox\">";
$site_url_tag = "<a target=\"_blank\" href=\"" . $site_url . "\">\n <span class=\"fb_feedTitle\">" . htmlspecialchars($line['title']) . "</span></a>";
$feed_url_tag = "<a target=\"_blank\" class=\"fb_feedUrl\"\n href=\"" . $feed_url . "\"><img src='images/pub_set.png'\n style='vertical-align:middle;'></a>";
if ($mode == 1) {
$id = "";
$count = $line['subscribers'];
} elseif ($mode == 2) {
$id = " id=\"FBROW-" . $line["id"] . "\"";
if ($line['articles_archived'] > 0) {
$archived = sprintf(_ngettext("%d archived article", "%d archived articles", $line['articles_archived']), $line['articles_archived']);
$count = "(" . $archived . ")";
} else {
$count = '';
}
}
$rv .= "<li" . $id . ">" . $check_box . " " . $feed_url_tag . " " . $site_url_tag . " <span class='subscribers'>" . $count . "</span></li>";
}
if ($rv === "") {
$rv = "<li style=\"text-align:center;\"><p>" . __('No feeds found.') . "</p></li>";
}
return $rv;
}
示例9: makefeedtree
function makefeedtree()
{
if ($_REQUEST['mode'] != 2) {
$search = $_SESSION["prefs_feed_search"];
} else {
$search = "";
}
if ($search) {
$search_qpart = " AND LOWER(title) LIKE LOWER('%{$search}%')";
}
$root = array();
$root['id'] = 'root';
$root['name'] = __('Feeds');
$root['items'] = array();
$root['type'] = 'category';
$enable_cats = get_pref('ENABLE_FEED_CATS');
if ($_REQUEST['mode'] == 2) {
if ($enable_cats) {
$cat = $this->feedlist_init_cat(-1);
} else {
$cat['items'] = array();
}
foreach (array(-4, -3, -1, -2, 0, -6) as $i) {
array_push($cat['items'], $this->feedlist_init_feed($i));
}
/* Plugin feeds for -1 */
$feeds = PluginHost::getInstance()->get_feeds(-1);
if ($feeds) {
foreach ($feeds as $feed) {
$feed_id = PluginHost::pfeed_to_feed_id($feed['id']);
$item = array();
$item['id'] = 'FEED:' . $feed_id;
$item['bare_id'] = (int) $feed_id;
$item['auxcounter'] = 0;
$item['name'] = $feed['title'];
$item['checkbox'] = false;
$item['error'] = '';
$item['icon'] = $feed['icon'];
$item['param'] = '';
$item['unread'] = 0;
//$feed['sender']->get_unread($feed['id']);
$item['type'] = 'feed';
array_push($cat['items'], $item);
}
}
if ($enable_cats) {
array_push($root['items'], $cat);
} else {
$root['items'] = array_merge($root['items'], $cat['items']);
}
$result = $this->dbh->query("SELECT * FROM\n\t\t\t\tttrss_labels2 WHERE owner_uid = " . $_SESSION['uid'] . " ORDER by caption");
if ($this->dbh->num_rows($result) > 0) {
if (get_pref('ENABLE_FEED_CATS')) {
$cat = $this->feedlist_init_cat(-2);
} else {
$cat['items'] = array();
}
while ($line = $this->dbh->fetch_assoc($result)) {
$label_id = label_to_feed_id($line['id']);
$feed = $this->feedlist_init_feed($label_id, false, 0);
$feed['fg_color'] = $line['fg_color'];
$feed['bg_color'] = $line['bg_color'];
array_push($cat['items'], $feed);
}
if ($enable_cats) {
array_push($root['items'], $cat);
} else {
$root['items'] = array_merge($root['items'], $cat['items']);
}
}
}
if ($enable_cats) {
$show_empty_cats = $_REQUEST['force_show_empty'] || $_REQUEST['mode'] != 2 && !$search;
$result = $this->dbh->query("SELECT id, title FROM ttrss_feed_categories\n\t\t\t\tWHERE owner_uid = " . $_SESSION["uid"] . " AND parent_cat IS NULL ORDER BY order_id, title");
while ($line = $this->dbh->fetch_assoc($result)) {
$cat = array();
$cat['id'] = 'CAT:' . $line['id'];
$cat['bare_id'] = (int) $line['id'];
$cat['auxcounter'] = 0;
$cat['name'] = $line['title'];
$cat['items'] = array();
$cat['checkbox'] = false;
$cat['type'] = 'category';
$cat['unread'] = 0;
$cat['child_unread'] = 0;
$cat['items'] = $this->get_category_items($line['id']);
$num_children = $this->calculate_children_count($cat);
$cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', $num_children), $num_children);
if ($num_children > 0 || $show_empty_cats) {
array_push($root['items'], $cat);
}
$root['param'] += count($cat['items']);
}
/* Uncategorized is a special case */
$cat = array();
$cat['id'] = 'CAT:0';
$cat['bare_id'] = 0;
$cat['auxcounter'] = 0;
$cat['name'] = __("Uncategorized");
$cat['items'] = array();
//.........这里部分代码省略.........
示例10: _getResultsRow
/**
* Provides search results row with browse/delete links.
* (for a table)
*
* @param string $each_table One of the tables on which search was performed
* @param array $newsearchsqls Contains SQL queries
* @param bool $odd_row For displaying contrasting table rows
* @param integer $res_cnt Number of results found
*
* @return string HTML row
*/
private function _getResultsRow($each_table, $newsearchsqls, $odd_row, $res_cnt)
{
$this_url_params = array('db' => $GLOBALS['db'], 'table' => $each_table, 'goto' => 'db_sql.php', 'pos' => 0, 'is_js_confirmed' => 0);
// Start forming search results row
$html_output = '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">';
// Displays results count for a table
$html_output .= '<td>';
$html_output .= sprintf(_ngettext('%1$s match in <strong>%2$s</strong>', '%1$s matches in <strong>%2$s</strong>', $res_cnt), $res_cnt, htmlspecialchars($each_table));
$html_output .= '</td>';
// Displays browse/delete link if result count > 0
if ($res_cnt > 0) {
$this_url_params['sql_query'] = $newsearchsqls['select_columns'];
$browse_result_path = 'sql.php' . PMA_URL_getCommon($this_url_params);
$html_output .= '<td><a name="browse_search" class="ajax" href="' . $browse_result_path . '" onclick="loadResult(\'' . $browse_result_path . '\',\'' . $each_table . '\',\'' . PMA_URL_getCommon($GLOBALS['db'], $each_table) . '\'' . ');return false;" >' . __('Browse') . '</a></td>';
$this_url_params['sql_query'] = $newsearchsqls['delete'];
$delete_result_path = 'sql.php' . PMA_URL_getCommon($this_url_params);
$html_output .= '<td><a name="delete_search" class="ajax" href="' . $delete_result_path . '" onclick="deleteResult(\'' . $delete_result_path . '\' , \'' . sprintf(__('Delete the matches for the %s table?'), htmlspecialchars($each_table)) . '\');return false;">' . __('Delete') . '</a></td>';
} else {
$html_output .= '<td> </td>' . '<td> </td>';
}
// end if else
$html_output .= '</tr>';
return $html_output;
}
示例11: PMA_getHtmlBodyForTableSummary
/**
* Get HTML body for table summery
*
* @param integer $num_tables number of tables
* @param boolean $server_slave_status server slave state
* @param boolean $db_is_system_schema whether database is information schema or not
* @param integer $sum_entries sum entries
* @param string $db_collation collation of given db
* @param boolean $is_show_stats whether stats is show or not
* @param double $sum_size sum size
* @param double $overhead_size overhead size
* @param string $create_time_all create time
* @param string $update_time_all update time
* @param string $check_time_all check time
* @param integer $sum_row_count_pre sum row count pre
*
* @return string $html_output
*/
function PMA_getHtmlBodyForTableSummary($num_tables, $server_slave_status, $db_is_system_schema, $sum_entries, $db_collation, $is_show_stats, $sum_size, $overhead_size, $create_time_all, $update_time_all, $check_time_all, $sum_row_count_pre)
{
if ($is_show_stats) {
list($sum_formatted, $unit) = PMA_Util::formatByteDown($sum_size, 3, 1);
list($overhead_formatted, $overhead_unit) = PMA_Util::formatByteDown($overhead_size, 3, 1);
}
$html_output = '<tbody id="tbl_summary_row">' . '<tr><th></th>';
$html_output .= '<th class="tbl_num nowrap">';
$html_output .= sprintf(_ngettext('%s table', '%s tables', $num_tables), PMA_Util::formatNumber($num_tables, 0));
$html_output .= '</th>';
if ($server_slave_status) {
$html_output .= '<th>' . __('Replication') . '</th>' . "\n";
}
$html_output .= '<th colspan="' . ($db_is_system_schema ? 4 : 7) . '">' . __('Sum') . '</th>';
$html_output .= '<th class="value tbl_rows">' . $sum_row_count_pre . PMA_Util::formatNumber($sum_entries, 0) . '</th>';
if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
$default_engine = $GLOBALS['dbi']->fetchValue('SHOW VARIABLES LIKE \'storage_engine\';', 0, 1);
$html_output .= '<th class="center">' . "\n" . '<dfn title="' . sprintf(__('%s is the default storage engine on this MySQL server.'), $default_engine) . '">' . $default_engine . '</dfn></th>' . "\n";
// we got a case where $db_collation was empty
$html_output .= '<th>' . "\n";
if (!empty($db_collation)) {
$html_output .= '<dfn title="' . PMA_getCollationDescr($db_collation) . ' (' . __('Default') . ')">' . $db_collation . '</dfn>';
}
$html_output .= '</th>';
}
if ($is_show_stats) {
$html_output .= '<th class="value tbl_size">' . $sum_formatted . ' ' . $unit . '</th>';
$html_output .= '<th class="value tbl_overhead">' . $overhead_formatted . ' ' . $overhead_unit . '</th>';
}
if ($GLOBALS['cfg']['ShowDbStructureCreation']) {
$html_output .= '<th class="value tbl_creation">' . "\n" . ' ' . ($create_time_all ? PMA_Util::localisedDate(strtotime($create_time_all)) : '-') . '</th>';
}
if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']) {
$html_output .= '<th class="value tbl_last_update">' . "\n" . ' ' . ($update_time_all ? PMA_Util::localisedDate(strtotime($update_time_all)) : '-') . '</th>';
}
if ($GLOBALS['cfg']['ShowDbStructureLastCheck']) {
$html_output .= '<th class="value tbl_last_check">' . "\n" . ' ' . ($check_time_all ? PMA_Util::localisedDate(strtotime($check_time_all)) : '-') . '</th>';
}
$html_output .= '</tr>' . '</tbody>';
return $html_output;
}
示例12: testGettext
/**
* Test for setting and parsing locales
*
* @param string $locale locale name
*
* @return void
*
* @group large
* @dataProvider listLocales
*/
public function testGettext($locale)
{
/* We should be able to set the language */
$this->manager->getLanguage($locale)->activate();
/* Grab some texts */
$this->assertContains('%s', _ngettext('%s table', '%s tables', 10));
$this->assertContains('%s', _ngettext('%s table', '%s tables', 1));
$this->assertEquals($locale, $this->manager->getCurrentLanguage()->getCode());
}
示例13: sprintf
<?php
}
?>
</table>
<?php
}
?>
</td>
</tr>
<?php
}
?>
<tr>
<th align="center">
<?php
echo sprintf(_ngettext('%s table', '%s tables', $num_tables), PMA_formatNumber($num_tables, 0));
?>
</th>
<th align="right" nowrap="nowrap">
<?php
echo PMA_formatNumber($sum_entries, 0);
?>
</th>
<th align="center">
--
</th>
<?php
if ($cfg['ShowStats']) {
list($sum_formated, $unit) = PMA_formatByteDown($sum_size, 3, 1);
?>
<th align="right" nowrap="nowrap">
示例14: _jn
function _jn($str, $str_plural, $n)
{
return utf8_encode(_ngettext($str, $str_plural, $n));
}
示例15: renderPath
/**
* Renders a part of the tree, used for Ajax
* requests in light mode
*
* @return string HTML code for the navigation tree
*/
public function renderPath()
{
$node = $this->_buildPath();
if ($node === false) {
$retval = false;
} else {
$this->groupTree();
$retval = "<div class='list_container' style='display: none;'>";
$retval .= "<ul>";
$retval .= $this->_fastFilterHtml($node);
$retval .= $this->_getPageSelector($node);
$children = $node->children;
usort($children, array('PMA_NavigationTree', 'sortNode'));
for ($i = 0; $i < count($children); $i++) {
if ($i + 1 != count($children)) {
$retval .= $this->_renderNode($children[$i], true);
} else {
$retval .= $this->_renderNode($children[$i], true, 'last');
}
}
$retval .= "</ul>";
$retval .= "</div>";
}
if (!empty($this->_searchClause) || !empty($this->_searchClause2)) {
if (!empty($this->_searchClause2)) {
$results = $node->realParent()->getPresence($node->real_name, $this->_searchClause2);
} else {
$results = $this->_tree->getPresence('databases', $this->_searchClause);
}
$clientResults = 0;
if (!empty($_REQUEST['results'])) {
$clientResults = (int) $_REQUEST['results'];
}
$otherResults = $results - $clientResults;
if ($otherResults < 1) {
$otherResults = '';
} else {
$otherResults = sprintf(_ngettext('%s other result found', '%s other results found', $otherResults), $otherResults);
}
PMA_Response::getInstance()->addJSON('results', $otherResults);
}
return $retval;
}