*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
$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;
$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;
}
$this->peopletag = Profile_list::staticGet('id', $id);
if (empty($this->peopletag)) {
- $this->clientError(_('No such peopletag.'));
+ // TRANS: Client error displayed trying to reference a non-existing list.
+ $this->clientError(_('No such list.'));
return false;
}
$field = $this->arg('field');
if (!in_array($field, array('fulltext', 'nickname', 'fullname', 'description', 'location', 'uri'))) {
- $this->clientError(sprintf(_('Unidentified field %s'), htmlspecialchars($field)), 404);
+ // 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);
return false;
}
$this->field = $field;
$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();
}
$this->elementEnd('ul');
} else {
+ // TRANS: Output when there are no results for a search.
$this->element('p', 'error', _('No results.'));
}
}
$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);
else {
$cnt = $profile->find();
}
+ // @todo FIXME: Call-time pass-by-reference has been deprecated.
Event::handle('EndProfileCompletionSearch', $this, &$profile, $search_engine);
}