/** * @inheritdoc */ public function getHtml($data = array()) { $collection = $this->collection; $defaults = array('langdir' => 'ltr', 'articleCountMsg' => wfMessage('gather-article-count', $collection->getCount())->text(), 'privacyMsg' => $this->getPrivacyMsg(), 'collectionUrl' => $collection->getUrl(), 'hasImage' => $collection->hasImage(), 'image' => $this->image->getHtml(), 'title' => $this->getTitle()); $owner = $collection->getOwner(); if ($owner && $this->showOwnerLink) { $defaults['owner'] = array('link' => $collection->getOwnerUrl(), 'className' => helpers\CSS::iconClass('profile', 'before'), 'label' => $owner->getName()); } return Template::render('CollectionsListItemCard', array_merge($defaults, $data)); }
/** * @inheritdoc */ public function getHtml($data = array()) { $cList = $this->collectionsList; $defaults = array('mode' => $cList->getMode(), 'items' => $this->getListItemsHtml($cList)); if ($cList->getOwner()) { $defaults['owner'] = $cList->getOwner()->getName(); $defaults['isOwner'] = $cList->isOwner($this->user) ? true : false; } return Template::render('CollectionsList', array_merge($defaults, $data)); }
/** * @param integer $size the width of the thumbnail * @return string */ private function getPageImageHtml($size = 750) { if ($this->item->hasImage()) { $thumb = models\Image::getThumbnail($this->item->getFile(), $size); if ($thumb && $thumb->getUrl()) { $data = array('url' => wfExpandUrl($thumb->getUrl(), PROTO_CURRENT), 'wide' => $thumb->getWidth() > $thumb->getHeight()); return Template::render('CardImage', $data); } } return ''; }
/** * @inheritdoc */ protected function getHtml($data = array()) { $dir = isset($data['langdir']) ? $data['langdir'] : 'ltr'; $item = $this->item; $title = $item->getTitle(); $img = $this->image->getHtml(); $pageUrl = $title->getLocalUrl(); $isMissing = $item->isMissing(); $data = array('dir' => $dir, 'page' => array('url' => $pageUrl, 'displayTitle' => $title->getPrefixedText()), 'msgMissing' => wfMessage('gather-page-not-found')->escaped(), 'isMissing' => $isMissing, 'progressiveAnchorClass' => CSS::anchorClass('progressive'), 'iconClass' => CSS::iconClass('collections-read-more', 'element', 'collections-read-more-arrow')); // Handle excerpt for titles with an extract or unknown pages if ($item->hasExtract()) { $data['extract'] = $item->getExtract(); } if ($img) { $data['cardImage'] = $img; } return Template::render('CollectionItemCard', $data); }
/** * @inheritdoc */ public function getHtml($data = array()) { return Template::render('tabs', $data); }