/** * Administrtion view for smileys */ public function index_action() { $this->view = Request::option('view', Smiley::getFirstUsedCharacter() ?: 'a'); $this->smileys = Smiley::getGrouped($this->view); $this->favorites_enabled = SmileyFavorites::isEnabled(); $this->setSidebar($this->view); }
/** * Common tasks for all actions. */ function before_filter(&$action, &$args) { parent::before_filter($action, $args); PageLayout::setTitle(_('Smiley-Übersicht')); $this->favorites_activated = SmileyFavorites::isEnabled() && $GLOBALS['user']->id != nobody; if ($this->favorites_activated) { $this->favorites = new SmileyFavorites($GLOBALS['user']->id); $this->default = count($this->favorites->get()) > 0 ? 'favorites' : Smiley::getFirstUsedCharacter(); } else { $this->default = Smiley::getFirstUsedCharacter(); } }