123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- define('PROFILES_PER_SECTION', 6);
- abstract class ProfileSection extends Section
- {
- function showContent()
- {
- $profiles = $this->getProfiles();
- if (!$profiles->N) {
- return false;
- }
- $cnt = 0;
- $this->out->elementStart('table');
- $this->out->elementStart('tbody');
- while ($profiles->fetch() && ++$cnt <= PROFILES_PER_SECTION) {
- $this->showProfile($profiles);
- }
- $this->out->elementEnd('tbody');
- $this->out->elementEnd('table');
- return ($cnt > PROFILES_PER_SECTION);
- }
- function getProfiles()
- {
- return null;
- }
- function showProfile($profile)
- {
- $this->out->elementStart('tr');
- $this->out->elementStart('td');
- $this->out->elementStart('a', array('title' => $profile->getBestName(),
- 'href' => $profile->profileurl,
- 'rel' => 'contact member',
- 'class' => 'h-card u-url'));
- $avatarUrl = $profile->avatarUrl(AVATAR_MINI_SIZE);
- $this->out->element('img', array('src' => $avatarUrl,
- 'width' => AVATAR_MINI_SIZE,
- 'height' => AVATAR_MINI_SIZE,
- 'class' => 'avatar u-photo',
- 'alt' => $profile->getBestName()));
- $this->out->elementEnd('a');
- $this->out->elementEnd('td');
- if (isset($profile->value)) {
- $this->out->element('td', 'value', $profile->value);
- }
- $this->out->elementEnd('tr');
- }
- }
|