123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- require_once INSTALLDIR . '/lib/peopletaglist.php';
- define('PEOPLETAGS_PER_SECTION', 6);
- class PeopletagSection extends Section
- {
- protected $avatarSize = AVATAR_MINI_SIZE;
- function showContent()
- {
- $tags = $this->getPeopletags();
- if (!$tags) {
- return false;
- }
- $cnt = 0;
- $this->out->elementStart('table', 'peopletag_section');
- while ($tags->fetch() && ++$cnt <= PEOPLETAGS_PER_SECTION) {
- $this->showPeopletag($tags);
- }
- $this->out->elementEnd('table');
- return ($cnt > PEOPLETAGS_PER_SECTION);
- }
- function getPeopletags()
- {
- return null;
- }
- function showPeopletag($peopletag)
- {
- $tag = new PeopletagSectionItem($peopletag, null, $this->out);
- $tag->show();
- }
- }
- class PeopletagSectionItem extends PeopletagListItem
- {
- function showStart()
- {
- }
- function showEnd()
- {
- }
- function showPeopletag()
- {
- $this->showCreator();
- $this->showTag();
- $this->showPrivacy();
- }
- function show()
- {
- if (empty($this->peopletag)) {
- common_log(LOG_WARNING, "Trying to show missing peopletag; skipping.");
- return;
- }
- $mode = ($this->peopletag->private) ? 'private' : 'public';
- $this->out->elementStart('tr');
- $this->out->elementStart('td', 'peopletag mode-' . $mode);
- $this->showPeopletag();
- $this->out->elementEnd('td');
- if (isset($this->peopletag->value)) {
- $this->out->element('td', 'value', $this->peopletag->value);
- }
- $this->out->elementEnd('tr');
- }
- function showTag()
- {
-
-
- $title = sprintf(_('Listed: %1$d Subscribers: %2$d'),
- $this->peopletag->taggedCount(),
- $this->peopletag->subscriberCount());
- $this->out->elementStart('span', 'entry-title tag');
- $this->out->element('a',
- array('rel' => 'bookmark',
- 'href' => $this->url(),
- 'title' => $title),
- htmlspecialchars($this->peopletag->tag));
- $this->out->elementEnd('span');
- }
- }
|