X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FDirectory%2Factions%2Fuserdirectory.php;h=85835e2c1f85b3e70bddfe6f54c9f06e2ed62736;hb=579fc11862173c8be3a623ebc3248ce9d61835a8;hp=005fb787d35a6ed096f7b9c5a8bd3ccf89b34e23;hpb=b3e3264a4d7371872dd337e73f613f316266430d;p=quix0rs-gnu-social.git diff --git a/plugins/Directory/actions/userdirectory.php b/plugins/Directory/actions/userdirectory.php index 005fb787d3..85835e2c1f 100644 --- a/plugins/Directory/actions/userdirectory.php +++ b/plugins/Directory/actions/userdirectory.php @@ -91,20 +91,18 @@ class UserdirectoryAction extends Action if ($this->filter == 'all') { if ($this->page != 1) { - return(sprintf(_m('All users, page %d'), $this->page)); + return(sprintf(_m('User Directory, page %d'), $this->page)); } - return _m('All users'); - } - - if ($this->page == 1) { + return _m('User directory'); + } else if ($this->page == 1) { return sprintf( - _m('Users with nicknames beginning with %s'), - $this->filter + _m('User directory - %s'), + strtoupper($this->filter) ); } else { return sprintf( - _m('Users with nicknames starting with %s, page %d'), - $this->filter, + _m('User directory - %s, page %d'), + strtoupper($this->filter), $this->page ); } @@ -117,7 +115,12 @@ class UserdirectoryAction extends Action */ function getInstructions() { - return _('User directory'); + // TRANS: %%site.name%% is the name of the StatusNet site. + return _( + 'Search for people on %%site.name%% by their name, ' + . 'location, or interests. Separate the terms by spaces; ' + . ' they must be 3 characters or more.' + ); } /** @@ -184,18 +187,6 @@ class UserdirectoryAction extends Action $this->elementEnd('div'); } - /** - * Local navigation - * - * This page is part of the public group, so show that. - * - * @return void - */ - function showLocalNav() - { - $nav = new PublicGroupNav($this); - $nav->show(); - } /** * Content area @@ -210,7 +201,7 @@ class UserdirectoryAction extends Action $this->elementStart('div', array('id' => 'user_directory')); - $alphaNav = new AlphaNav($this, true, array('All')); + $alphaNav = new AlphaNav($this, false, false, array('0-9', 'All')); $alphaNav->show(); $profile = null; @@ -317,7 +308,16 @@ class UserdirectoryAction extends Action $sort = $this->getSortKey(); $sql = 'SELECT profile.* FROM profile, user WHERE profile.id = user.id'; - if ($this->filter != 'all') { + switch($this->filter) + { + case 'all': + // NOOP + break; + case '0-9': + $sql .= + ' AND LEFT(profile.nickname, 1) BETWEEN \'0\' AND \'9\''; + break; + default: $sql .= sprintf( ' AND LEFT(LOWER(profile.nickname), 1) = \'%s\'', $this->filter @@ -362,11 +362,28 @@ class UserdirectoryAction extends Action */ function showEmptyListMessage() { - $message = sprintf(_m('No users starting with **%s**'), $this->filter); - - $this->elementStart('div', 'guide'); - $this->raw(common_markup_to_html($message)); - $this->elementEnd('div'); + if (!empty($this->filter) && ($this->filter != 'all')) { + $this->element( + 'p', + 'error', + sprintf( + _m('No users starting with %s'), + $this->filter + ) + ); + } else { + $this->element('p', 'error', _('No results.')); + $message = _m(<<elementStart('div', 'help instructions'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); + } } }