/** * Get the header for the watchlist page * @param User $user * @param int $id * @param string $actionUrl * @return string Parsed HTML */ private function getHeader(User $user, $id, $actionUrl) { $html = Html::openElement('form', array('action' => $actionUrl)) . Html::openElement('select', array('name' => 'collection-id')); $collections = models\CollectionsList::newFromApi($user, true); foreach ($collections as $collection) { $attrs = array('value' => $collection->getId()); if ($collection->getId() === $id) { $attrs['selected'] = true; } $html .= Html::element('option', $attrs, $collection->getTitle()); } $html .= Html::closeElement('select') . Html::submitButton(wfMessage('gather-editfeed-show'), array('class' => CSS::buttonClass('progressive'))) . Html::closeElement('form'); return '<div class="gather-edit-feed-header content-header">' . $html . '</div>'; }
/** * Renders a list of user collections * * @param User $user owner of collections */ public function renderUserCollectionsList(User $user) { $currentUser = $this->getUser(); $collectionsList = models\CollectionsList::newFromApi($user, $this->getUser()->equals($user), false, $this->getRequest()->getValues()); if ($collectionsList->getCount() > 0) { $this->addMetaInformation(wfMessage('gather-meta-description', $user->getName()), models\Image::getThumbnail($collectionsList->getFile())); if ($collectionsList->isOwner($currentUser)) { $this->renderTabs(1); } $this->render(new views\CollectionsList($currentUser, $collectionsList)); } else { $this->renderError(new views\NoPublic($user)); } }