* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- exit(1);
-}
-
-require_once INSTALLDIR . '/lib/subscriptionlist.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Widget to show a sortable list of subscriptions
*/
class SortableGroupList extends SortableSubscriptionList
{
- /** Owner of this list */
- var $owner = null;
-
- function __construct($profile, $owner=null, $action=null)
- {
- parent::__construct($profile, $owner, $action);
-
- $this->owner = $owner;
- }
-
function startList()
{
$this->out->elementStart('table', array('class' => 'profile_list xoxo'));
$this->out->elementStart('tbody');
}
- function newListItem(Profile $profile, $odd)
+ function newListItem(Profile $profile)
{
- return new SortableGroupListItem($profile, $this->owner, $this->action, $odd);
+ return new SortableGroupListItem($profile, $this->owner, $this->action);
}
}
class SortableGroupListItem extends SortableSubscriptionListItem
{
- /** Owner of this list */
- var $owner = null;
-
- function __construct($profile, $owner, $action, $alt)
- {
- parent::__construct($profile, $owner, $action, $alt);
-
- $this->alt = $alt; // is this row alternate?
- $this->owner = $owner;
- }
-
function showHomepage()
{
- if (!empty($this->profile->homepage)) {
+ if ($this->profile->getHomepage()) {
$this->out->text(' ');
$aAttrs = $this->homepageAttributes();
$this->out->elementStart('a', $aAttrs);
- $this->out->raw($this->highlight($this->profile->homepage));
+ $this->out->text($this->profile->getHomepage());
$this->out->elementEnd('a');
}
}
function showDescription()
{
- if (!empty($this->profile->description)) {
- $cutoff = 140; // XXX Should this be configurable?
- $description = htmlspecialchars($this->profile->description);
-
- if (mb_strlen($description) > $cutoff) {
- $description = mb_substr($description, 0, $cutoff - 1)
- .'<a href="' . $this->profile->homeUrl() .'">…</a>';
- }
-
+ if ($this->profile->getDescription()) {
$this->out->elementStart('p', 'note');
- $this->out->raw($description);
+ $this->out->text($this->profile->getDescription());
$this->out->elementEnd('p');
}
{
$this->startProfile();
- $this->showAvatar($this->profile->getProfile());
- $this->out->element('a', array('href' => $this->profile->homeUrl(),
+ $this->showAvatar($this->profile);
+ $this->out->element('a', array('href' => $this->profile->getUrl(),
'class' => 'p-org p-nickname',
'rel' => 'contact group'),
$this->profile->getNickname());
$r2args['action'] = $action;
if ($cur instanceof User && $cur->hasRight(Right::DELETEGROUP)) {
$this->out->elementStart('li', 'entity_delete');
- $df = new DeleteGroupForm($this->out, $this->profile, $r2args);
+ $df = new DeleteGroupForm($this->out, $this->profile->getGroup(), $r2args);
$df->show();
$this->out->elementEnd('li');
}
$this->out->elementStart('li', 'entity_subscribe');
// XXX: special-case for user looking at own
// subscriptions page
- if ($user->isMember($this->profile)) {
- $lf = new LeaveForm($this->out, $this->profile);
+ if ($user->isMember($this->profile->getGroup())) {
+ $lf = new LeaveForm($this->out, $this->profile->getGroup());
$lf->show();
- } else if (!Group_block::isBlocked($this->profile, $user->getProfile())) {
- $jf = new JoinForm($this->out, $this->profile);
+ } else if (!Group_block::isBlocked($this->profile->getGroup(), $user->getProfile())) {
+ $jf = new JoinForm($this->out, $this->profile->getGroup());
$jf->show();
}
function showMemberCount()
{
$this->out->elementStart('td', 'entry_member_count');
- $this->out->raw($this->profile->getMemberCount());
+ $this->out->text($this->profile->getGroup()->getMemberCount());
$this->out->elementEnd('td');
}
{
$this->out->elementStart('td', 'entry_created');
// @todo FIXME: Should we provide i18n for timestamps in core?
- $this->out->raw(date('j M Y', strtotime($this->profile->created)));
+ $this->out->text(date('j M Y', strtotime($this->profile->created)));
$this->out->elementEnd('td');
}
{
$this->out->elementStart('td', 'entry_admins');
// @todo
- $this->out->raw('gargargar');
+ $this->out->text('gargargar');
$this->out->elementEnd('td');
}