summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@controlyourself.ca>2009-03-04 05:23:41 +0000
committerSarven Capadisli <csarven@controlyourself.ca>2009-03-04 05:23:41 +0000
commit78a715bc37041a852d9e0eb6dc3e3dc0a0b9e279 (patch)
tree88a3c8fc1d4a2da043047a6e07b500cff592302a
parent753b69991603e6aa2c33d7a6e953141b85caf878 (diff)
Hooks for: Public group nav in order to place a list-anchor item at
the start or end of the list.
-rw-r--r--EVENTS.txt7
-rw-r--r--lib/publicgroupnav.php28
2 files changed, 22 insertions, 13 deletions
diff --git a/EVENTS.txt b/EVENTS.txt
index ed461ee9f..2f33b2d5d 100644
--- a/EVENTS.txt
+++ b/EVENTS.txt
@@ -88,9 +88,14 @@ StartShowLocalNavBlock: Showing the local nav menu
EndShowLocalNavBlock: At the end of the local nav menu
- $action: the current action
-StartShowHTML: Chance to set document content type, charset, language, DOCTYPE and html element properties
+StartShowHTML: Chance to set document headers (e.g., content type, charset, language), DOCTYPE and html element properties
- $action: the current action
EndShowHTML: Showing after the html element
- $action: the current action
+StartPublicGroupNav: Showing the public group nav menu
+- $action: the current action
+
+EndPublicGroupNav: At the end of the public group nav menu
+- $action: the current action
diff --git a/lib/publicgroupnav.php b/lib/publicgroupnav.php
index d72475e20..485d25e20 100644
--- a/lib/publicgroupnav.php
+++ b/lib/publicgroupnav.php
@@ -39,6 +39,7 @@ require_once INSTALLDIR.'/lib/widget.php';
* @category Output
* @package Laconica
* @author Evan Prodromou <evan@controlyourself.ca>
+ * @author Sarven Capadisli <csarven@controlyourself.ca>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://laconi.ca/
*
@@ -73,23 +74,26 @@ class PublicGroupNav extends Widget
$this->action->elementStart('ul', array('class' => 'nav'));
- $this->out->menuItem(common_local_url('public'), _('Public'),
- _('Public timeline'), $action_name == 'public', 'nav_timeline_public');
+ if (Event::handle('StartPublicGroupNav', array($this))) {
+ $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('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');
+ $this->out->menuItem(common_local_url('publictagcloud'), _('Recent tags'),
+ _('Recent tags'), $action_name == 'publictagcloud', 'nav_recent-tags');
- if (count(common_config('nickname', 'featured')) > 0) {
- $this->out->menuItem(common_local_url('featured'), _('Featured'),
- _('Featured users'), $action_name == 'featured', 'nav_featured');
- }
+ if (count(common_config('nickname', 'featured')) > 0) {
+ $this->out->menuItem(common_local_url('featured'), _('Featured'),
+ _('Featured users'), $action_name == 'featured', 'nav_featured');
+ }
- $this->out->menuItem(common_local_url('favorited'), _('Popular'),
- _("Popular notices"), $action_name == 'favorited', 'nav_timeline_favorited');
+ $this->out->menuItem(common_local_url('favorited'), _('Popular'),
+ _("Popular notices"), $action_name == 'favorited', 'nav_timeline_favorited');
+ Event::handle('EndPublicGroupNav', array($this));
+ }
$this->action->elementEnd('ul');
}
}