function onStartShowStylesheets(Action $action) { //get the theme and set the current config for site and theme. if ($action->getScoped() instanceof Profile) { $site_theme = common_config('site', 'theme'); $user_theme = $action->getScoped()->getPref('chosen_theme', 'theme', $site_theme); common_config_set('site', 'theme', $user_theme); } return true; }
public function onEndShowSections(Action $action) { if (!$action->isAction(array('all', 'public'))) { return true; } if (!common_config('performance', 'high')) { $section = new PopularNoticeSection($action, $action->getScoped()); $section->show(); } }
public function onStartShowConversation(Action $action, Conversation $conv, Profile $scoped = null) { $nl = new ConversationTree($conv->getNotices($action->getScoped()), $action); $cnt = $nl->show(); return false; }
function onEndShowSections(Action $action) { if (!$action instanceof ShowstreamAction) { // early return for actions we're not interested in return true; } $scoped = $action->getScoped(); if (!$scoped instanceof Profile || !$scoped->hasRight(self::VIEWMODLOG)) { // only continue if we are allowed to VIEWMODLOG return true; } $profile = $action->getTarget(); $ml = new ModLog(); $ml->profile_id = $profile->getID(); $ml->orderBy("created"); $cnt = $ml->find(); if ($cnt > 0) { $action->elementStart('div', array('id' => 'entity_mod_log', 'class' => 'section')); $action->element('h2', null, _('Moderation')); $action->elementStart('table'); while ($ml->fetch()) { $action->elementStart('tr'); $action->element('td', null, strftime('%y-%m-%d', strtotime($ml->created))); $action->element('td', null, sprintf($ml->is_grant ? _('+%s') : _('-%s'), $ml->role)); $action->elementStart('td'); if ($ml->moderator_id) { $mod = Profile::getByID($ml->moderator_id); if (empty($mod)) { $action->text(_('[unknown]')); } else { $action->element('a', array('href' => $mod->getUrl(), 'title' => $mod->getFullname()), $mod->getNickname()); } } else { $action->text(_('[unknown]')); } $action->elementEnd('td'); $action->elementEnd('tr'); } $action->elementEnd('table'); $action->elementEnd('div'); } }