X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fgroupsearch.php;h=fce5c2b16a7885bb6b07d47bcbbbc0f24bc0f9c3;hb=0cbb7411a69f63a4c2947d5c66e62f28e0714532;hp=7437166e6ae2a70698dbe015301ea9317ba6f070;hpb=7dc271723110cd2e9b179a3ae8dc8eee2c7c2534;p=quix0rs-gnu-social.git diff --git a/actions/groupsearch.php b/actions/groupsearch.php index 7437166e6a..fce5c2b16a 100644 --- a/actions/groupsearch.php +++ b/actions/groupsearch.php @@ -5,14 +5,14 @@ * PHP version 5 * * @category Action - * @package Laconica - * @author Evan Prodromou - * @author Robin Millette + * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ * - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -28,7 +28,7 @@ * along with this program. If not, see . */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,22 +39,24 @@ if (!defined('LACONICA')) { * Group search action class. * * @category Action - * @package Laconica - * @author Evan Prodromou - * @author Robin Millette + * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ */ class GroupsearchAction extends SearchAction { function getInstructions() { + // TRANS: Instructions for page where groups can be searched. %%site.name%% is the name of the StatusNet site. return _('Search for groups on %%site.name%% by their name, location, or description. ' . 'Separate the terms by spaces; they must be 3 characters or more.'); } function title() { + // TRANS: Title for page where groups can be searched. return _('Group search'); } @@ -76,14 +78,18 @@ class GroupsearchAction extends SearchAction $this->pagination($page > 1, $cnt > GROUPS_PER_PAGE, $page, 'groupsearch', array('q' => $q)); } else { + // TRANS: Text on page where groups can be searched if no results were found for a query. $this->element('p', 'error', _('No results.')); $this->searchSuggestions($q); if (common_logged_in()) { - $message = _('If you can\'t find the group you\'re looking for, you can [create it](%%action.newgroup%%) yourself.'); + // TRANS: Additional text on page where groups can be searched if no results were found for a query for a logged in user. + // TRANS: This message contains Markdown links in the form [link text](link). + $message = _('If you cannot find the group you\'re looking for, you can [create it](%%action.newgroup%%) yourself.'); } else { - $message = sprintf(_('Why not [register an account](%%%%action.%s%%%%) and [create the group](%%%%action.newgroup%%%%) yourself!'), - (!common_config('site','openidonly')) ? 'register' : 'openidlogin'); + // TRANS: Additional text on page where groups can be searched if no results were found for a query for a not logged in user. + // TRANS: This message contains Markdown links in the form [link text](link). + $message = _('Why not [register an account](%%action.register%%) and [create the group](%%action.newgroup%%) yourself!'); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); @@ -91,6 +97,12 @@ class GroupsearchAction extends SearchAction $user_group->free(); } } + + function showScripts() + { + parent::showScripts(); + $this->autofocus('q'); + } } class GroupSearchResults extends GroupList @@ -100,7 +112,7 @@ class GroupSearchResults extends GroupList function __construct($user_group, $terms, $action) { - parent::__construct($user_group, $terms, $action); + parent::__construct($user_group, null, $action); $this->terms = array_map('preg_quote', array_map('htmlspecialchars', $terms)); $this->pattern = '/('.implode('|',$terms).')/i'; @@ -111,4 +123,3 @@ class GroupSearchResults extends GroupList return preg_replace($this->pattern, '\\1', htmlspecialchars($text)); } } -