本文整理匯總了PHP中Translator::get_by_search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Translator::get_by_search方法的具體用法?PHP Translator::get_by_search怎麽用?PHP Translator::get_by_search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Translator
的用法示例。
在下文中一共展示了Translator::get_by_search方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
}
$page->layout = 'admin';
$lang = $this->params[0];
$empty = isset($_GET['empty']) && $_GET['empty'] == 1 ? true : false;
if (!$empty) {
$_GET['empty'] = '';
}
$info = $i18n->languages[$lang];
$page->title = __('Editing language') . ': ' . $info['name'];
$all = unserialize(file_get_contents('lang/_index.php'));
$sources = Translator::get_sources($all);
require_once 'apps/translator/lib/Functions.php';
if (isset($_GET['contains']) && !empty($_GET['contains'])) {
$tr = new Translator();
$all = $tr->translations($lang, $all);
$items = Translator::get_by_search($all, $_GET['contains']);
echo $tpl->render('translator/edit_search', array('items' => $items, 'name' => $info['name'], 'lang' => $lang, 'sources' => $sources, 'contains' => $_GET['contains'], 'empty' => $empty));
} elseif (isset($_GET['source']) && !empty($_GET['source'])) {
$items = Translator::get_by_source($all, $_GET['source']);
$tr = new Translator();
$items = $tr->translations($lang, $items);
echo $tpl->render('translator/edit_source', array('items' => $items, 'name' => $info['name'], 'lang' => $lang, 'sources' => $sources, 'source' => $_GET['source'], 'empty' => $empty));
} else {
$num = isset($this->params[1]) ? $this->params[1] : 1;
$limit = 40;
$offset = ($num - 1) * $limit;
if ($empty) {
$tr = new Translator();
$all = $tr->translations($lang, $all);
foreach ($all as $k => $v) {
if ($v['trans'] !== '') {