}
require_once INSTALLDIR.'/lib/widget.php';
+require_once INSTALLDIR.'/lib/peopletags.php';
/**
* Widget to show a list of profiles
$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();
{
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');
}
}
}
+ 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');
'class' => 'url entry-title',
'rel' => 'contact');
}
+
+ function homepageAttributes()
+ {
+ return array('href' => $this->profile->homepage,
+ 'class' => 'url');
+ }
}