X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsearch.php;h=c1990bf8708ba1d9a9d5148264f34d87ea9c9a79;hb=0454d0a670e051e8519e9a4220606f83d1408214;hp=af9dd99563927923e71a30ef8dc7e76bd5063470;hpb=104a03e82a1cc4c72de65f27cc5b7953a24bf069;p=friendica.git diff --git a/mod/search.php b/mod/search.php index af9dd99563..c1990bf870 100644 --- a/mod/search.php +++ b/mod/search.php @@ -7,6 +7,8 @@ use Friendica\Content\Feature; use Friendica\Content\Nav; use Friendica\Core\Cache; use Friendica\Core\Config; +use Friendica\Core\L10n; +use Friendica\Core\System; use Friendica\Database\DBM; require_once "include/bbcode.php"; @@ -32,7 +34,7 @@ function search_saved_searches() { 'id' => $rr['id'], 'term' => $rr['term'], 'encodedterm' => urlencode($rr['term']), - 'delete' => t('Remove term'), + 'delete' => L10n::t('Remove term'), 'selected' => ($search==$rr['term']), ]; } @@ -41,7 +43,7 @@ function search_saved_searches() { $tpl = get_markup_template("saved_searches_aside.tpl"); $o .= replace_macros($tpl, [ - '$title' => t('Saved Searches'), + '$title' => L10n::t('Saved Searches'), '$add' => '', '$searchbox' => '', '$saved' => $saved, @@ -93,16 +95,16 @@ function search_post(App $a) { function search_content(App $a) { if (Config::get('system','block_public') && !local_user() && !remote_user()) { - notice(t('Public access denied.') . EOL); + notice(L10n::t('Public access denied.') . EOL); return; } if (Config::get('system','local_search') && !local_user() && !remote_user()) { - http_status_exit(403, - ["title" => t("Public access denied."), - "description" => t("Only logged in users are permitted to perform a search.")]); + System::httpExit(403, + ["title" => L10n::t("Public access denied."), + "description" => L10n::t("Only logged in users are permitted to perform a search.")]); killme(); - //notice(t('Public access denied.').EOL); + //notice(L10n::t('Public access denied.').EOL); //return; } @@ -123,9 +125,9 @@ function search_content(App $a) { if (!is_null($result)) { $resultdata = json_decode($result); if (($resultdata->time > (time() - $crawl_permit_period)) && ($resultdata->accesses > $free_crawls)) { - http_status_exit(429, - ["title" => t("Too Many Requests"), - "description" => t("Only one search per minute is permitted for not logged in users.")]); + System::httpExit(429, + ["title" => L10n::t("Too Many Requests"), + "description" => L10n::t("Only one search per minute is permitted for not logged in users.")]); killme(); } Cache::set("remote_search:".$remote, json_encode(["time" => time(), "accesses" => $resultdata->accesses + 1]), CACHE_HOUR); @@ -150,7 +152,7 @@ function search_content(App $a) { // contruct a wrapper for the search header $o .= replace_macros(get_markup_template("content_wrapper.tpl"),[ 'name' => "search-header", - '$title' => t("Search"), + '$title' => L10n::t("Search"), '$title_size' => 3, '$content' => search($search,'search-box','search',((local_user()) ? true : false), false) ]); @@ -220,15 +222,16 @@ function search_content(App $a) { } if (! DBM::is_result($r)) { - info( t('No results.') . EOL); + info(L10n::t('No results.') . EOL); return $o; } - if ($tag) - $title = sprintf( t('Items tagged with: %s'), $search); - else - $title = sprintf( t('Results for: %s'), $search); + if ($tag) { + $title = L10n::t('Items tagged with: %s', $search); + } else { + $title = L10n::t('Results for: %s', $search); + } $o .= replace_macros(get_markup_template("section_title.tpl"),[ '$title' => $title