123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- class PersonalGroupNav extends Menu
- {
-
- public function show()
- {
-
-
- $target = Profile::current();
- if (!$target instanceof Profile) {
- throw new ServerException('Cannot show personal group navigation without a current user.');
- }
- $nickname = $target->getNickname();
- $name = $target->getBestName();
- $scoped = Profile::current();
- $action = $this->actionName;
- $mine = ($this->action->arg('nickname') == $nickname);
- $this->out->elementStart('ul', array('class' => 'nav'));
- if (Event::handle('StartPersonalGroupNav', array($this, $target, $scoped))) {
- $this->out->menuItem(common_local_url('all', array('nickname' =>
- $nickname)),
-
- _m('MENU','Home'),
-
-
- sprintf(_('%s and friends'), $name),
- $mine && $action =='all', 'nav_timeline_personal');
- $this->out->menuItem(common_local_url('showstream', array('nickname' =>
- $nickname)),
-
- _m('MENU','Profile'),
-
- _('Your profile'),
- $mine && $action =='showstream',
- 'nav_profile');
- $this->out->menuItem(common_local_url('replies', array('nickname' =>
- $nickname)),
-
- _m('MENU','Replies'),
-
-
- sprintf(_('Replies to %s'), $name),
- $mine && $action =='replies', 'nav_timeline_replies');
- Event::handle('EndPersonalGroupNav', array($this, $target, $scoped));
- }
- $this->out->elementEnd('ul');
- }
- }
|