exit(1);
}
-require_once INSTALLDIR.'/lib/widget.php';
require_once INSTALLDIR.'/lib/peopletags.php';
/**
function startList()
{
- $this->out->elementStart('ul', 'profiles xoxo');
+ $this->out->elementStart('ul', 'profile_list xoxo');
}
function endList()
function showProfiles()
{
- // Note: we don't use fetchAll() because it's borked with query()
-
- $profiles = array();
-
- while ($this->profile->fetch()) {
- $profiles[] = clone($this->profile);
- }
-
- $cnt = count($profiles);
+ $cnt = $this->profile->N;
+ $profiles = $this->profile->fetchAll();
$max = min($cnt, $this->maxProfiles());
return $cnt;
}
- function newListItem($profile)
+ function newListItem(Profile $profile)
{
return new ProfileListItem($profile, $this->action);
}
{
return PROFILES_PER_PAGE;
}
-
- function avatarSize()
- {
- return AVATAR_STREAM_SIZE;
- }
}
class ProfileListItem extends Widget
function startItem()
{
- $this->out->elementStart('li', array('class' => 'profile hentry',
+ $this->out->elementStart('li', array('class' => 'profile',
'id' => 'profile-' . $this->profile->id));
}
$this->startProfile();
if (Event::handle('StartProfileListItemProfileElements', array($this))) {
if (Event::handle('StartProfileListItemAvatar', array($this))) {
- $this->showAvatar();
+ $aAttrs = $this->linkAttributes();
+ $this->out->elementStart('a', $aAttrs);
+ $this->showAvatar($this->profile);
+ $this->out->elementEnd('a');
Event::handle('EndProfileListItemAvatar', array($this));
}
+ if (Event::handle('StartProfileListItemNickname', array($this))) {
+ $this->showNickname();
+ Event::handle('EndProfileListItemNickname', array($this));
+ }
if (Event::handle('StartProfileListItemFullName', array($this))) {
$this->showFullName();
Event::handle('EndProfileListItemFullName', array($this));
function startProfile()
{
- $this->out->elementStart('div', 'entity_profile vcard entry-content');
+ $this->out->elementStart('div', 'entity_profile h-card');
}
- function showAvatar()
+ function showNickname()
{
- $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);
- $aAttrs = $this->linkAttributes();
- $this->out->elementStart('a', $aAttrs);
- $this->out->element('img', array('src' => (!empty($avatar)) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE),
- 'class' => 'photo avatar',
- 'width' => AVATAR_STREAM_SIZE,
- 'height' => AVATAR_STREAM_SIZE,
- 'alt' =>
- ($this->profile->fullname) ? $this->profile->fullname :
- $this->profile->nickname));
- $this->out->text(' ');
- $hasFN = (!empty($this->profile->fullname)) ? 'nickname' : 'fn nickname';
- $this->out->elementStart('span', $hasFN);
- $this->out->raw($this->highlight($this->profile->nickname));
- $this->out->elementEnd('span');
- $this->out->elementEnd('a');
+ $this->out->element('a', array('href'=>$this->profile->getUrl(),
+ 'class'=>'p-nickname'),
+ $this->profile->getNickname());
}
function showFullName()
{
if (!empty($this->profile->fullname)) {
- $this->out->text(' ');
- $this->out->elementStart('span', 'fn');
- $this->out->raw($this->highlight($this->profile->fullname));
- $this->out->elementEnd('span');
+ $this->out->element('span', 'p-name', $this->profile->fullname);
}
}
function showLocation()
{
if (!empty($this->profile->location)) {
- $this->out->text(' ');
- $this->out->elementStart('span', 'label');
- $this->out->raw($this->highlight($this->profile->location));
- $this->out->elementEnd('span');
+ $this->out->element('span', 'label p-locality', $this->profile->location);
}
}
function linkAttributes()
{
return array('href' => $this->profile->profileurl,
- 'class' => 'url entry-title',
+ 'class' => 'u-url',
'rel' => 'contact');
}
function homepageAttributes()
{
return array('href' => $this->profile->homepage,
- 'class' => 'url');
+ 'class' => 'u-url');
}
}