123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- require_once INSTALLDIR.'/lib/widget.php';
- class PeopletagGroupNav extends Widget
- {
- var $action = null;
-
- function __construct(Action $action=null)
- {
- parent::__construct($action);
- $this->action = $action;
- }
-
- function show()
- {
- $user = null;
-
- $action = $this->action->trimmed('action');
- if (common_config('singleuser', 'enabled')) {
- $nickname = User::singleUserNickname();
- } else {
- $nickname = $this->action->arg('tagger');
- }
- $tag = $this->action->trimmed('tag');
- if ($nickname) {
- $user = User::getKV('nickname', $nickname);
- $user_profile = $user->getProfile();
- if ($tag) {
- $tag = Profile_list::pkeyGet(array('tagger' => $user->id,
- 'tag' => $tag));
- } else {
- $tag = false;
- }
- } else {
- $user_profile = false;
- }
- $this->out->elementStart('ul', array('class' => 'nav'));
- if (Event::handle('StartPeopletagGroupNav', array($this))) {
-
- $this->out->menuItem(common_local_url('showprofiletag', array('nickname' => $user_profile->nickname,
- 'tag' => $tag->tag)),
-
- _m('MENU','List'),
-
-
- sprintf(_('%1$s list by %2$s.'), $tag->tag,
- (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
- $action == 'showprofiletag', 'nav_timeline_peopletag');
-
- $this->out->menuItem(common_local_url('peopletagged', array('tagger' => $user->nickname,
- 'tag' => $tag->tag)),
-
- _m('MENU','Listed'),
-
-
- sprintf(_('%1$s list by %2$s.'), $tag->tag,
- (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
- $action == 'peopletagged', 'nav_peopletag_tagged');
-
- $this->out->menuItem(common_local_url('peopletagsubscribers', array('tagger' => $user->nickname,
- 'tag' => $tag->tag)),
-
- _m('MENU','Subscribers'),
-
-
- sprintf(_('Subscribers to %1$s list by %2$s.'), $tag->tag,
- (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
- $action == 'peopletagsubscribers', 'nav_peopletag_subscribers');
- $cur = common_current_user();
- if (!empty($cur) && $user_profile->id == $cur->id) {
-
- $this->out->menuItem(common_local_url('editpeopletag', array('tagger' => $user->nickname,
- 'tag' => $tag->tag)),
-
- _m('MENU','Edit'),
-
-
- sprintf(_('Edit %s list by you.'), $tag->tag,
- (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
- $action == 'editpeopletag', 'nav_peopletag_edit');
- }
- Event::handle('EndPeopletagGroupNav', array($this));
- }
- $this->out->elementEnd('ul');
- }
- }
|