4 * StatusNet, the distributed open-source microblogging tool
6 * Widget to show a list of profiles
10 * LICENCE: This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 * @author Evan Prodromou <evan@status.net>
26 * @copyright 2008-2009 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET') && !defined('LACONICA')) {
35 require_once INSTALLDIR.'/lib/profilelist.php';
38 * Widget to show a list of subscriptions
42 * @author Zach Copley <zach@status.net>
43 * @author Evan Prodromou <evan@status.net>
44 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
45 * @link http://status.net/
48 class SubscriptionList extends ProfileList
50 /** Owner of this list */
53 function __construct($profile, $owner=null, $action=null)
55 parent::__construct($profile, $action);
57 $this->owner = $owner;
60 function newListItem($profile)
62 return new SubscriptionListItem($profile, $this->owner, $this->action);
66 class SubscriptionListItem extends ProfileListItem
68 /** Owner of this list */
71 function __construct($profile, $owner, $action)
73 parent::__construct($profile, $action);
75 $this->owner = $owner;
78 function showProfile()
80 $this->startProfile();
82 $this->showFullName();
83 $this->showLocation();
84 $this->showHomepage();
93 $user = common_current_user();
94 return (!empty($user) && ($this->owner->id == $user->id));
99 $tags = Profile_tag::getTags($this->owner->id, $this->profile->id);
101 $this->out->elementStart('dl', 'entity_tags');
102 $this->out->elementStart('dt');
103 if ($this->isOwn()) {
104 $this->out->element('a', array('href' => common_local_url('tagother',
105 array('id' => $this->profile->id))),
108 $this->out->text(_('Tags'));
110 $this->out->elementEnd('dt');
111 $this->out->elementStart('dd');
113 $this->out->elementStart('ul', 'tags xoxo');
114 foreach ($tags as $tag) {
115 $this->out->elementStart('li');
116 $this->out->element('span', 'mark_hash', '#');
117 $this->out->element('a', array('rel' => 'tag',
118 'href' => common_local_url($this->action->trimmed('action'),
119 array('nickname' => $this->owner->nickname,
122 $this->out->elementEnd('li');
124 $this->out->elementEnd('ul');
126 $this->out->text(_('(none)'));
128 $this->out->elementEnd('dd');
129 $this->out->elementEnd('dl');