diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/form.php | 8 | ||||
-rw-r--r-- | lib/grouplist.php | 18 | ||||
-rw-r--r-- | lib/publicgroupnav.php | 3 | ||||
-rw-r--r-- | lib/searchaction.php | 7 | ||||
-rw-r--r-- | lib/searchgroupnav.php | 12 | ||||
-rw-r--r-- | lib/util.php | 2 |
6 files changed, 27 insertions, 23 deletions
diff --git a/lib/form.php b/lib/form.php index 011d4bfc9..5317df471 100644 --- a/lib/form.php +++ b/lib/form.php @@ -65,7 +65,7 @@ class Form extends Widget { $this->out->elementStart('form', array('id' => $this->id(), - 'class' => $this->formClass(), + 'class' => $this->formClass(), 'method' => 'post', 'action' => $this->action())); $this->out->elementStart('fieldset'); @@ -88,7 +88,6 @@ class Form extends Widget $this->out->hidden('token', common_session_token()); } - /** * Name of the form * @@ -101,7 +100,6 @@ class Form extends Widget { } - /** * Visible or invisible data elements * @@ -154,7 +152,7 @@ class Form extends Widget function action() { } - + /** * Class of the form. * @@ -163,6 +161,6 @@ class Form extends Widget function formClass() { - return 'form'; + return 'form'; } } diff --git a/lib/grouplist.php b/lib/grouplist.php index 869e44897..629bdd05d 100644 --- a/lib/grouplist.php +++ b/lib/grouplist.php @@ -34,7 +34,7 @@ if (!defined('LACONICA')) { require_once INSTALLDIR.'/lib/widget.php'; -define('groupS_PER_PAGE', 20); +define('GROUPS_PER_PAGE', 20); /** * Widget to show a list of groups @@ -72,7 +72,7 @@ class GroupList extends Widget while ($this->group->fetch()) { $cnt++; - if($cnt > groupS_PER_PAGE) { + if($cnt > GROUPS_PER_PAGE) { break; } $this->showgroup(); @@ -99,12 +99,12 @@ class GroupList extends Widget 'class' => 'url', 'rel' => 'group')); $this->out->element('img', array('src' => $logo, - 'class' => 'photo avatar', - 'width' => AVATAR_STREAM_SIZE, - 'height' => AVATAR_STREAM_SIZE, - 'alt' => - ($this->group->fullname) ? $this->group->fullname : - $this->group->nickname)); + 'class' => 'photo avatar', + 'width' => AVATAR_STREAM_SIZE, + 'height' => AVATAR_STREAM_SIZE, + 'alt' => + ($this->group->fullname) ? $this->group->fullname : + $this->group->nickname)); $hasFN = ($this->group->fullname) ? 'nickname url uid' : 'fn org nickname url uid'; $this->out->elementStart('span', $hasFN); $this->out->raw($this->highlight($this->group->nickname)); @@ -164,7 +164,7 @@ class GroupList extends Widget $lf = new LeaveForm($this->out, $this->group); $lf->show(); } else { - $jf = new JoinForm(); + $jf = new JoinForm($this->out, $this->group); $jf->show(); } } diff --git a/lib/publicgroupnav.php b/lib/publicgroupnav.php index 8dd97a3b7..d72475e20 100644 --- a/lib/publicgroupnav.php +++ b/lib/publicgroupnav.php @@ -76,6 +76,9 @@ class PublicGroupNav extends Widget $this->out->menuItem(common_local_url('public'), _('Public'), _('Public timeline'), $action_name == 'public', 'nav_timeline_public'); + $this->out->menuItem(common_local_url('groups'), _('Groups'), + _('User groups'), $action_name == 'groups', 'nav_groups'); + $this->out->menuItem(common_local_url('publictagcloud'), _('Recent tags'), _('Recent tags'), $action_name == 'publictagcloud', 'nav_recent-tags'); diff --git a/lib/searchaction.php b/lib/searchaction.php index 71ab3a6ef..70e63146a 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -73,7 +73,7 @@ class SearchAction extends Action function showLocalNav() { - $nav = new SearchGroupNav($this); + $nav = new SearchGroupNav($this, $this->trimmed('q')); $nav->show(); } @@ -98,11 +98,6 @@ class SearchAction extends Action return null; } - function show_header($arr) - { - return; - } - function showNoticeForm() { // remote post notice form } diff --git a/lib/searchgroupnav.php b/lib/searchgroupnav.php index 2a0f5a6ea..4ea226692 100644 --- a/lib/searchgroupnav.php +++ b/lib/searchgroupnav.php @@ -48,6 +48,7 @@ require_once INSTALLDIR.'/lib/widget.php'; class SearchGroupNav extends Widget { var $action = null; + var $q = null; /** * Construction @@ -55,10 +56,11 @@ class SearchGroupNav extends Widget * @param Action $action current action, used for output */ - function __construct($action=null) + function __construct($action=null, $q = null) { parent::__construct($action); $this->action = $action; + $this->q = $q; } /** @@ -71,9 +73,13 @@ class SearchGroupNav extends Widget { $action_name = $this->action->trimmed('action'); $this->action->elementStart('ul', array('class' => 'nav')); - $this->out->menuItem(common_local_url('peoplesearch'), _('People'), + $args = array(); + if ($this->q) { + $args['q'] = $this->q; + } + $this->out->menuItem(common_local_url('peoplesearch', $args), _('People'), _('Find people on this site'), $action_name == 'peoplesearch', 'nav_search_people'); - $this->out->menuItem(common_local_url('noticesearch'), _('Notice'), + $this->out->menuItem(common_local_url('noticesearch', $args), _('Notice'), _('Find content of notices'), $action_name == 'noticesearch', 'nav_search_notice'); $this->action->elementEnd('ul'); } diff --git a/lib/util.php b/lib/util.php index d30a56c77..42bc08e7e 100644 --- a/lib/util.php +++ b/lib/util.php @@ -945,6 +945,8 @@ function common_fancy_url($action, $args=null) return common_path('group/'.$args['nickname'].'/members'); case 'usergroups': return common_path($args['nickname'].'/groups'); + case 'groups': + return common_path('group'); default: return common_simple_url($action, $args); } |