X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FDirectory%2Flib%2Fsortablegrouplist.php;h=709547ae0f4ee0c9629ed9e02b115d7c4df2e771;hb=ed13c9a09840f4ed13473eaa4804cb9b192ba7b1;hp=7d0265d9ac33b27b0204690d65cb1286fce0e346;hpb=3a3a53dfcc6582f637205bc9fb897d5152ca80b1;p=quix0rs-gnu-social.git diff --git a/plugins/Directory/lib/sortablegrouplist.php b/plugins/Directory/lib/sortablegrouplist.php index 7d0265d9ac..709547ae0f 100644 --- a/plugins/Directory/lib/sortablegrouplist.php +++ b/plugins/Directory/lib/sortablegrouplist.php @@ -1,5 +1,4 @@ out->elementStart('tr'); $tableHeaders = array( + // TRANS: Column header in table for user nickname. 'nickname' => _m('Nickname'), + // TRANS: Column header in table for timestamp when user was created. 'created' => _m('Created') ); foreach ($tableHeaders as $id => $label) { - $attrs = array('id' => $id); $current = (!empty($this->action->sort) && $this->action->sort == $id); @@ -110,8 +109,8 @@ class SortableGroupList extends SortableSubscriptionList $this->out->elementEnd('th'); } + // TRANS: Column header in table for members of a group. $this->out->element('th', array('id' => 'Members'), _m('Members')); - $this->out->element('th', array('id' => 'Admins'), _m('Admins')); $this->out->element('th', array('id' => 'controls'), null); $this->out->elementEnd('tr'); @@ -139,20 +138,6 @@ class SortableGroupListItem extends SortableSubscriptionListItem $this->owner = $owner; } - function startItem() - { - $attr = array( - 'class' => 'profile', - 'id' => 'profile-' . $this->profile->id - ); - - if ($this->alt) { - $attr['class'] .= ' alt'; - } - - $this->out->elementStart('tr', $attr); - } - function showHomepage() { if (!empty($this->profile->homepage)) { @@ -164,6 +149,24 @@ class SortableGroupListItem extends SortableSubscriptionListItem } } + 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) + .'…'; + } + + $this->out->elementStart('p', 'note'); + $this->out->raw($description); + $this->out->elementEnd('p'); + } + + } + function showAvatar() { $logo = ($this->profile->stream_logo) ? @@ -197,33 +200,6 @@ class SortableGroupListItem extends SortableSubscriptionListItem $this->out->elementEnd('a'); } - function endItem() - { - $this->out->elementEnd('tr'); - } - - function startProfile() - { - $this->out->elementStart('td', 'entity_profile vcard entry-content'); - } - - function endProfile() - { - $this->out->elementEnd('td'); - } - - function startActions() - { - $this->out->elementStart('td', 'entity_actions'); - $this->out->elementStart('ul'); - } - - function endActions() - { - $this->out->elementEnd('ul'); - $this->out->elementEnd('td'); - } - function show() { if (Event::handle('StartProfileListItem', array($this))) { @@ -236,17 +212,30 @@ class SortableGroupListItem extends SortableSubscriptionListItem // XXX Add events? $this->showCreatedDate(); $this->showMemberCount(); - $this->showAdmins(); if (Event::handle('StartProfileListItemActions', array($this))) { $this->showActions(); Event::handle('EndProfileListItemActions', array($this)); } $this->endItem(); + Event::handle('EndProfileListItem', array($this)); } } + function showProfile() + { + $this->startProfile(); + $this->showAvatar(); + $this->showFullName(); + $this->showLocation(); + $this->showHomepage(); + $this->showDescription(); // groups have this instead of bios + // Relevant portion! + $this->showTags(); + $this->endProfile(); + } + function showActions() { $this->startActions(); @@ -272,12 +261,14 @@ class SortableGroupListItem extends SortableSubscriptionListItem $jf = new JoinForm($this->out, $this->profile); $jf->show(); } + + $this->out->elementEnd('li'); } } function showMemberCount() { - $this->out->elementStart('td', 'entry_subscriber_count'); + $this->out->elementStart('td', 'entry_member_count'); $this->out->raw($this->profile->getMemberCount()); $this->out->elementEnd('td'); } @@ -285,13 +276,14 @@ class SortableGroupListItem extends SortableSubscriptionListItem function showCreatedDate() { $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->elementEnd('td'); } function showAdmins() { - $this->out->elementStart('td', 'entry_notice_count'); + $this->out->elementStart('td', 'entry_admins'); // @todo $this->out->raw('gargargar'); $this->out->elementEnd('td'); @@ -307,5 +299,4 @@ class SortableGroupListItem extends SortableSubscriptionListItem } } - }