X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fprofilecompletion.php;h=aaf6026eb58115c0ccef5134f0cc5e6da8c2e3b9;hb=b3bf036975593db27c6e7e653f18160d086f7b2d;hp=8208f3bd376614fda740d8a62706e85ef7206889;hpb=e75c9988ebe33822e493ac225859bc593ff9b855;p=quix0rs-gnu-social.git diff --git a/actions/profilecompletion.php b/actions/profilecompletion.php index 8208f3bd37..aaf6026eb5 100644 --- a/actions/profilecompletion.php +++ b/actions/profilecompletion.php @@ -68,7 +68,6 @@ class ProfilecompletionAction extends Action * * @return boolean success flag */ - function prepare($args) { parent::prepare($args); @@ -78,9 +77,9 @@ class ProfilecompletionAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { + // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.'. ' Try again, please.')); - return false; } // Only for logged-in users @@ -88,22 +87,23 @@ class ProfilecompletionAction extends Action $this->user = common_current_user(); if (empty($this->user)) { + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } $id = $this->arg('peopletag_id'); - $this->peopletag = Profile_list::staticGet('id', $id); + $this->peopletag = Profile_list::getKV('id', $id); if (empty($this->peopletag)) { - $this->clientError(_('No such peopletag.')); - return false; + // TRANS: Client error displayed trying to reference a non-existing list. + $this->clientError(_('No such list.')); } $field = $this->arg('field'); if (!in_array($field, array('fulltext', 'nickname', 'fullname', 'description', 'location', 'uri'))) { - $this->clientError(sprintf(_('Unidentified field %s'), htmlspecialchars($field)), 404); - return false; + // TRANS: Client error displayed when trying to add an unindentified field to profile. + // TRANS: %s is a field name. + $this->clientError(sprintf(_('Unidentified field %s.'), htmlspecialchars($field)), 404); } $this->field = $field; @@ -126,7 +126,8 @@ class ProfilecompletionAction extends Action $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); - $this->element('title', null, _('Search results')); + // TRANS: Page title. + $this->element('title', null, _m('TITLE','Search results')); $this->elementEnd('head'); $this->elementStart('body'); $profiles = $this->getResults(); @@ -141,11 +142,12 @@ class ProfilecompletionAction extends Action } $this->elementEnd('ul'); } else { + // TRANS: Output when there are no results for a search. $this->element('p', 'error', _('No results.')); } } $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } function getResults() @@ -154,7 +156,8 @@ class ProfilecompletionAction extends Action $q = $this->arg('q'); $q = strtolower($q); if (strlen($q) < 3) { - $this->msg = _('The search string must be atleast 3 characters long'); + // TRANS: Error message in case a search is shorter than three characters. + $this->msg = _('The search string must be at least 3 characters long.'); } $page = $this->arg('page'); $page = (int) (empty($page) ? 1 : $page); @@ -172,7 +175,7 @@ class ProfilecompletionAction extends Action else { $cnt = $profile->find(); } - Event::handle('EndProfileCompletionSearch', $this, &$profile, $search_engine); + Event::handle('EndProfileCompletionSearch', array($this, &$profile, $search_engine)); } while ($profile->fetch()) {