X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fprofilelist.php;h=af38fa71d9bc62f1fcf0ea3593579f4771a5ffe3;hb=f446db8e2ae9be8ae7b8489ddffcc04c6074b6f2;hp=934907bc35ec075b8712a434f8178cab8e966888;hpb=0b30230b5ad482b9510775510f77dbbc62970150;p=quix0rs-gnu-social.git diff --git a/lib/profilelist.php b/lib/profilelist.php index 934907bc35..af38fa71d9 100644 --- a/lib/profilelist.php +++ b/lib/profilelist.php @@ -33,6 +33,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { } require_once INSTALLDIR.'/lib/widget.php'; +require_once INSTALLDIR.'/lib/peopletags.php'; /** * Widget to show a list of profiles @@ -168,6 +169,10 @@ class ProfileListItem extends Widget $this->showBio(); Event::handle('EndProfileListItemBio', array($this)); } + if (Event::handle('StartProfileListItemTags', array($this))) { + $this->showTags(); + Event::handle('EndProfileListItemTags', array($this)); + } Event::handle('EndProfileListItemProfileElements', array($this)); } $this->endProfile(); @@ -222,8 +227,8 @@ class ProfileListItem extends Widget { if (!empty($this->profile->homepage)) { $this->out->text(' '); - $this->out->elementStart('a', array('href' => $this->profile->homepage, - 'class' => 'url')); + $aAttrs = $this->homepageAttributes(); + $this->out->elementStart('a', $aAttrs); $this->out->raw($this->highlight($this->profile->homepage)); $this->out->elementEnd('a'); } @@ -238,6 +243,20 @@ class ProfileListItem extends Widget } } + function showTags() + { + $user = common_current_user(); + if (!empty($user)) { + if ($user->id == $this->profile->id) { + $tags = new SelftagsWidget($this->out, $user, $this->profile); + $tags->show(); + } else if ($user->getProfile()->canTag($this->profile)) { + $tags = new PeopletagsWidget($this->out, $user, $this->profile); + $tags->show(); + } + } + } + function endProfile() { $this->out->elementEnd('div'); @@ -305,4 +324,10 @@ class ProfileListItem extends Widget 'class' => 'url entry-title', 'rel' => 'contact'); } + + function homepageAttributes() + { + return array('href' => $this->profile->homepage, + 'class' => 'url'); + } }