function before_filter(&$action, &$args) { parent::before_filter($action, $args); // Remove cid URLHelper::removeLinkParam('cid'); unset($_SESSION['SessionSeminar']); $this->set_layout($GLOBALS['template_factory']->open('layouts/base_without_infobox')); Navigation::activateItem('/profile/index'); URLHelper::addLinkParam('username', Request::username('username')); PageLayout::setHelpKeyword('Basis.Homepage'); SkipLinks::addIndex(_('Benutzerprofil'), 'user_profile', 100); $this->user = User::findCurrent(); // current logged in user $this->perm = $GLOBALS['perm']; // perms of current logged in user $this->current_user = User::findByUsername(Request::username('username', $this->user->username)); // current selected user // get additional informations to selected user $this->profile = new ProfileModel($this->current_user->user_id, $this->user->user_id); // set the page title depending on user selection if ($this->current_user['user_id'] == $this->user->id && !$this->current_user['locked']) { PageLayout::setTitle(_('Mein Profil')); UserConfig::get($this->user->id)->store('PROFILE_LAST_VISIT', time()); } elseif ($this->current_user['user_id'] && ($this->perm->have_perm('root') || !$this->current_user['locked'] && get_visibility_by_id($this->current_user['user_id']))) { PageLayout::setTitle(_('Profil') . ' - ' . $this->current_user->getFullname()); object_add_view($this->current_user->user_id); } else { PageLayout::setTitle(_('Profil')); $action = 'not_available'; } }
public function perform($unconsumed) { if ($unconsumed !== 'read_all') { return; } $global_news = StudipNews::GetNewsByRange('studip', true); foreach ($global_news as $news) { object_add_view($news['news_id']); object_set_visit($news['news_id'], 'news'); } if (Request::isXhr()) { echo json_encode(true); } else { PageLayout::postMessage(MessageBox::success(_('Alle Ankündigungen wurden als gelesen markiert.'))); header('Location: ' . URLHelper::getLink('dispatch.php/start')); } }
function visit() { if ($GLOBALS['user']->id && $GLOBALS['user']->id != 'nobody' && Request::option('contentbox_open') && Request::option('contentbox_type') === 'news') { object_add_view(Request::option('contentbox_open')); object_set_visit(Request::option('contentbox_open'), 'news'); //and, set a visittime } }