예제 #1
0
 /**
  * This function is called before any output is generated or any other
  * actions are performed. Initializations happen here.
  *
  * @param $action Name of the action to perform
  * @param $args   Arguments for the given action
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $this->modules = array();
     // Set Navigation
     PageLayout::setHelpKeyword("Basis.ProfileModules");
     PageLayout::setTitle(_("Mehr Funktionen"));
     PageLayout::addSqueezePackage('lightbox');
     Navigation::activateItem('/profile/modules');
     // Get current user.
     $this->username = Request::username('username', $GLOBALS['user']->username);
     $this->user_id = get_userid($this->username);
     $this->plugins = array();
     $blubber = PluginEngine::getPlugin('Blubber');
     // Add blubber to plugin list so status can be updated.
     if ($blubber) {
         $this->plugins[] = $blubber;
     }
     // Get homepage plugins from database.
     $this->plugins = array_merge($this->plugins, PluginEngine::getPlugins('HomepagePlugin'));
     // Show info message if user is not on his own profile
     if ($this->user_id != $GLOBALS['user']->id) {
         $current_user = User::find($this->user_id);
         $message = sprintf(_('Daten von: %s %s (%s), Status: %s'), htmlReady($current_user->Vorname), htmlReady($current_user->Nachname), htmlReady($current_user->username), htmlReady($current_user->perms));
         PageLayout::postMessage(MessageBox::info($message));
     }
     $this->setupSidebar();
 }
예제 #2
0
파일: overview.php 프로젝트: ratbird/hope
 function before_filter(&$action, &$args)
 {
     if (Request::option('auswahl')) {
         Request::set('cid', Request::option('auswahl'));
     }
     parent::before_filter($action, $args);
     checkObject();
     $this->institute = Institute::findCurrent();
     if (!$this->institute) {
         throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
     }
     $this->institute_id = $this->institute->id;
     //set visitdate for institute, when coming from meine_seminare
     if (Request::option('auswahl')) {
         object_set_visit($this->institute_id, "inst");
     }
     //gibt es eine Anweisung zur Umleitung?
     if (Request::get('redirect_to')) {
         $query_parts = explode('&', stristr(urldecode($_SERVER['QUERY_STRING']), 'redirect_to'));
         list(, $where_to) = explode('=', array_shift($query_parts));
         $new_query = $where_to . '?' . join('&', $query_parts);
         page_close();
         $new_query = preg_replace('/[^:0-9a-z+_\\-.#?&=\\/]/i', '', $new_query);
         header('Location: ' . URLHelper::getURL($new_query, array('cid' => $this->institute_id)));
         die;
     }
     PageLayout::setHelpKeyword("Basis.Einrichtungen");
     PageLayout::setTitle($this->institute->getFullName() . " - " . _("Kurzinfo"));
     Navigation::activateItem('/course/main/info');
 }
예제 #3
0
파일: admission.php 프로젝트: ratbird/hope
 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     global $perm;
     parent::before_filter($action, $args);
     $course_id = $args[0];
     $this->course_id = Request::option('cid', $course_id);
     Navigation::activateItem('/course/admin/admission');
     if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$perm->have_studip_perm("tutor", $this->course_id)) {
         throw new Trails_Exception(403);
     }
     $this->course = Course::find($this->course_id);
     $this->user_id = $GLOBALS['user']->id;
     PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenZugangsberechtigungen");
     PageLayout::setTitle($this->course->getFullname() . " - " . _("Verwaltung von Zugangsberechtigungen"));
     $lockrules = words('admission_turnout admission_type admission_endtime admission_binding passwort read_level write_level admission_prelim admission_prelim_txt admission_starttime admission_endtime_sem admission_disable_waitlist user_domain admission_binding admission_studiengang');
     foreach ($lockrules as $rule) {
         $this->is_locked[$rule] = LockRules::Check($this->course_id, $rule) ? 'disabled readonly' : '';
     }
     if (!SeminarCategories::GetByTypeId($this->course->status)->write_access_nobody) {
         $this->is_locked['write_level'] = 'disabled readonly';
     }
     update_admission($this->course->id);
     PageLayout::addSqueezePackage('admission');
     URLHelper::addLinkParam('return_to_dialog', Request::get('return_to_dialog'));
 }
예제 #4
0
 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     global $perm;
     parent::before_filter($action, $args);
     if (Request::get('termin_id')) {
         $this->dates[0] = new SingleDate(Request::option('termin_id'));
         $this->course_id = $this->dates[0]->range_id;
     }
     if (Request::get('issue_id')) {
         $this->issue_id = Request::option('issue_id');
         $this->dates = array_values(array_map(function ($data) {
             $d = new SingleDate();
             $d->fillValuesFromArray($data);
             return $d;
         }, IssueDB::getDatesforIssue(Request::option('issue_id'))));
         $this->course_id = $this->dates[0]->range_id;
     }
     if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$perm->have_studip_perm("tutor", $this->course_id)) {
         throw new Trails_Exception(400);
     }
     PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenAendernVonZeitenUndTerminen");
     PageLayout::setTitle(Course::findCurrent()->getFullname() . " - " . _("Veranstaltungstermine absagen"));
     $this->set_content_type('text/html;charset=windows-1252');
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('X-Title', PageLayout::getTitle());
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     }
 }
예제 #5
0
 /**
  * Common code for all actions: set default layout and page title.
  *
  * @param type $action
  * @param type $args
  */
 function before_filter(&$action, &$args)
 {
     $this->validate_args($args, array('option', 'option'));
     parent::before_filter($action, $args);
     // set correct encoding if this is an ajax-call
     if (Request::isAjax()) {
         header('Content-Type: text/html; charset=Windows-1252');
     }
     $this->flash = Trails_Flash::instance();
     // set default layout
     $layout = $GLOBALS['template_factory']->open('layouts/base');
     $this->set_layout($layout);
     // Set help keyword for Stud.IP's user-documentation and page title
     PageLayout::setHelpKeyword('Basis.Forum');
     PageLayout::setTitle($_SESSION['SessSemName']['header_line'] . ' - ' . _('Forum'));
     $this->AVAILABLE_DESIGNS = array('web20', 'studip');
     if ($GLOBALS['CANONICAL_RELATIVE_PATH_STUDIP'] && $GLOBALS['CANONICAL_RELATIVE_PATH_STUDIP'] != '/') {
         $this->picturepath = $GLOBALS['CANONICAL_RELATIVE_PATH_STUDIP'] . '/' . $this->dispatcher->trails_root . '/img';
     } else {
         $this->picturepath = '/' . $this->dispatcher->trails_root . '/img';
     }
     // we want to display the dates in german
     setlocale(LC_TIME, 'de_DE@euro', 'de_DE', 'de', 'ge');
     // the default for displaying timestamps
     $this->time_format_string = "%a %d. %B %Y, %H:%M";
     $this->time_format_string_short = "%d.%m.%Y, %H:%M";
     $this->template_factory = new Flexi_TemplateFactory(dirname(__FILE__) . '/../templates');
     //$this->check_token();
     ForumVisit::setVisit($this->getId());
     if (Request::int('page')) {
         ForumHelpers::setPage(Request::int('page'));
     }
     $this->seminar_id = $this->getId();
 }
예제 #6
0
파일: profile.php 프로젝트: ratbird/hope
 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';
     }
 }
예제 #7
0
파일: show.php 프로젝트: anantace/SCMTabs
 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     $this->priviledged = $GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1]);
     if (Request::isXhr()) {
         $this->set_content_type('text/html;charset=Windows-1252');
     } else {
         $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     }
     if (!in_array($action, words('index create edit move delete'))) {
         array_unshift($args, $action);
         $action = 'index';
     }
     if (in_array($action, words('create edit move delete')) && !$this->priviledged) {
         throw new AccessDeniedException(_('Sie sind nicht berechtigt, auf diesen Bereich zuzugreifen'));
     }
     if ($GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1])) {
         $widget = new ActionsWidget();
         $widget->addLink(_('Neuen Eintrag anlegen'), $this->url_for('show/create'), 'icons/16/blue/add.png')->asDialog();
         Sidebar::get()->addWidget($widget);
     }
     PageLayout::setHelpKeyword('Basis.Informationsseite');
     /**
             checkObject(); // do we have an open object?
             checkObjectModule('scm');
             object_set_visit_module('scm');
     	 **/
 }
예제 #8
0
 /**
  *
  */
 function auth_registerform()
 {
     // set up dummy user environment
     if ($GLOBALS['user']->id !== 'nobody') {
         $GLOBALS['user'] = new Seminar_User('nobody');
         $GLOBALS['perm'] = new Seminar_Perm();
         $GLOBALS['auth'] = $this;
     }
     // set up user session
     include 'lib/seminar_open.php';
     if (!$_COOKIE[get_class($GLOBALS['sess'])]) {
         $register_template = $GLOBALS['template_factory']->open('nocookies');
     } else {
         $register_template = $GLOBALS['template_factory']->open('registerform');
         $register_template->set_attribute('validator', new email_validation_class());
         $register_template->set_attribute('error_msg', $this->error_msg);
         $register_template->set_attribute('username', Request::get('username'));
         $register_template->set_attribute('Vorname', Request::get('Vorname'));
         $register_template->set_attribute('Nachname', Request::get('Nachname'));
         $register_template->set_attribute('Email', Request::get('Email'));
         $register_template->set_attribute('title_front', Request::get('title_front'));
         $register_template->set_attribute('title_rear', Request::get('title_rear'));
         $register_template->set_attribute('geschlecht', Request::int('geschlecht', 0));
     }
     PageLayout::setHelpKeyword('Basis.AnmeldungRegistrierung');
     PageLayout::setTitle(_('Registrierung'));
     // $header_template = $GLOBALS['template_factory']->open('header');
     // $header_template->current_page = _('Registrierung');
     $layout = $GLOBALS['template_factory']->open('layouts/base.php');
     $register_template->set_layout($layout);
     // include 'lib/include/html_head.inc.php';
     // echo $header_template->render();
     echo $register_template->render();
     // include 'lib/include/html_end.inc.php';
 }
예제 #9
0
파일: calendar.php 프로젝트: ratbird/hope
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setHelpKeyword('Basis.Terminkalender');
     $this->settings = UserConfig::get($GLOBALS['user']->id)->getValue('CALENDAR_SETTINGS');
     if (!is_array($this->settings)) {
         $this->settings = Calendar::getDefaultUserSettings();
     }
     URLHelper::bindLinkParam('atime', $this->atime);
     $this->atime = Request::int('atime', time());
     $this->category = Request::int('category');
     $this->last_view = Request::option('last_view', $this->settings['view']);
     $this->action = $action;
     $this->restrictions = $this->category ? array('STUDIP_CATEGORY' => $this->category) : null;
     if ($this->category) {
         URLHelper::bindLinkParam('category', $this->category);
     }
     $self = Request::option('self');
     //   var_dump($_SESSION['SessSemName'], $self); exit;
     if (!$self && $_SESSION['SessSemName']['class'] == 'sem') {
         $this->range_id = Request::option('cid');
         Navigation::activateItem('/course/calendar');
     } else {
         $this->range_id = Request::option('range_id', $GLOBALS['user']->id);
         Navigation::activateItem('/calendar/calendar');
         URLHelper::bindLinkParam('range_id', $this->range_id);
     }
     URLHelper::bindLinkParam('last_view', $this->last_view);
 }
예제 #10
0
파일: privacy.php 프로젝트: ratbird/hope
 /**
  * Set up this controller.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setHelpKeyword('Basis.MyStudIPPrivacy');
     PageLayout::setTitle(_('Privatsphäre'));
     Navigation::activateItem('/profile/settings/privacy');
     SkipLinks::addIndex(_('Privatsphäre'), 'layout_content', 100);
 }
예제 #11
0
파일: files.php 프로젝트: ratbird/hope
 /**
  * Before filter, basically initializes the controller by actvating the
  * according navigation entry and other settings.
  *
  * @param String $action Action to execute
  * @param Array $args    Arguments passed for the action (might be empty)
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setTitle(_('Dateiverwaltung'));
     PageLayout::setHelpKeyword('Basis.Dateien');
     Navigation::activateItem('/profile/files');
     PageLayout::addSqueezePackage('document');
 }
예제 #12
0
파일: details.php 프로젝트: ratbird/hope
 /**
  * Set up this controller and define the infobox.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setHelpKeyword('Basis.HomepageLebenslauf');
     PageLayout::setTitle($this->user->perms == 'dozent' ? _('Lebenslauf, Arbeitsschwerpunkte und Publikationen bearbeiten') : _('Lebenslauf bearbeiten'));
     Navigation::activateItem('/profile/edit/details');
     SkipLinks::addIndex(_('Private Daten bearbeiten'), 'layout_content');
 }
예제 #13
0
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!$GLOBALS['perm']->have_perm("root")) {
         throw new AccessDeniedException();
     }
     PageLayout::setHelpKeyword("Admins.SemClasses");
     PageLayout::setTitle("Veranstaltungskategorien");
 }
예제 #14
0
파일: account.php 프로젝트: ratbird/hope
 /**
  * Set up this controller and define the infobox
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setHelpKeyword('Basis.HomepagePersönlicheDaten');
     PageLayout::setTitle(_('Benutzerkonto bearbeiten'));
     Navigation::activateItem('/profile/edit/profile');
     SkipLinks::addIndex(_('Benutzerkonto bearbeiten'), 'layout_content');
     Sidebar::get()->setImage('sidebar/person-sidebar.png');
 }
예제 #15
0
 public function index_action()
 {
     PageLayout::setHelpKeyword("Basis.MeineStudiengruppen");
     PageLayout::setTitle(_("Meine Studiengruppen"));
     URLHelper::removeLinkParam('cid');
     $this->studygroups = MyRealmModel::getStudygroups();
     $this->nav_elements = MyRealmModel::calc_single_navigation($this->studygroups);
     $this->set_sidebar();
 }
예제 #16
0
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!$GLOBALS['perm']->have_perm("root")) {
         Navigation::activateItem('/browse/my_institutes');
     }
     $this->user_id = $GLOBALS['auth']->auth['uid'];
     PageLayout::setHelpKeyword("Basis.MeineEinrichtungen");
     PageLayout::setTitle(_("Meine Einrichtungen"));
 }
예제 #17
0
파일: studygroup.php 프로젝트: ratbird/hope
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setTitle(_('Studiengruppen suchen'));
     Navigation::activateItem('/community/studygroups/browse');
     PageLayout::setHelpKeyword('Basis.SuchenStudiengruppen');
     // add skip link
     SkipLinks::addIndex(Navigation::getItem('/community/studygroups/browse')->getTitle(), 'layout_content', 100);
     Sidebar::get()->setImage('sidebar/studygroup-sidebar.png');
 }
예제 #18
0
 /**
  * Set up this controller.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setHelpKeyword('Basis.HomepageNutzerdomänen');
     PageLayout::setTitle(_('Nutzerdomänen bearbeiten'));
     Navigation::activateItem('/profile/edit/userdomains');
     SkipLinks::addIndex(_('Zugeordnete Nutzerdomänen'), 'assigned_userdomains');
     SkipLinks::addIndex(_('Nutzerdomäne auswählen'), 'select_userdomains');
     Sidebar::get()->setImage('sidebar/admin-sidebar.png');
 }
예제 #19
0
파일: closed.php 프로젝트: ratbird/hope
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     //Configurations for the Documentarea for this user
     $this->userConfig = DocUsergroupConfig::getUserConfig($GLOBALS['user']->id);
     $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     PageLayout::setTitle(_('Dateiverwaltung'));
     PageLayout::setHelpKeyword('Basis.Dateien');
     Navigation::activateItem('/document/files');
 }
예제 #20
0
파일: deputies.php 프로젝트: ratbird/hope
 /**
  * Set up this controller.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     require_once 'lib/deputies_functions.inc.php';
     PageLayout::setHelpKeyword('Basis.MyStudIPDeputies');
     PageLayout::setTitle(_('Standardvertretung'));
     Navigation::activateItem('/profile/settings/deputies');
     SkipLinks::addIndex(_('Standardvertretung'), 'main_content', 100);
     $this->edit_about_enabled = get_config('DEPUTIES_EDIT_ABOUT_ENABLE');
 }
예제 #21
0
파일: elearning.php 프로젝트: ratbird/hope
 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!Config::Get()->ELEARNING_INTERFACE_ENABLE) {
         throw new AccessDeniedException(_('Elearning-Interface ist nicht aktiviert.'));
     } else {
         $this->elearning_active = true;
     }
     PageLayout::setHelpKeyword('Basis.Ilias');
     PageLayout::setTitle($_SESSION['SessSemName']["header_line"] . " - " . _("Lernmodule"));
     checkObject();
     // do we have an open object?
     checkObjectModule('elearning_interface');
     object_set_visit_module('elearning_interface');
     $this->search_key = Request::get('search_key');
     $GLOBALS['search_key'] = $this->search_key;
     $this->cms_select = Request::quoted('cms_select');
     $GLOBALS['cms_select'] = $this->cms_select;
     $this->open_all = Request::get('open_all');
     $this->close_all = Request::get('close_all');
     $this->new_account_cms = Request::get('new_account_cms');
     $this->module_system_type = Request::get('module_system_type');
     $this->module_id = Request::get('module_id');
     $this->module_type = Request::get('module_type');
     $this->anker_target = Request::get('anker_target');
     $this->seminar_id = $_SESSION['SessSemName'][1];
     $this->rechte = $GLOBALS['perm']->have_studip_perm('tutor', $this->seminar_id);
     if (!isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->new_account_cms])) {
         unset($this->new_account_cms);
     }
     if (!isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_select])) {
         unset($this->cms_select);
     }
     if ($this->seminar_id != $_SESSION['elearning_open_close']["id"]) {
         unset($_SESSION['cache_data']);
         unset($_SESSION['elearning_open_close']);
     }
     if ($this->open_all != "") {
         $_SESSION['elearning_open_close']["all open"] = true;
     } elseif ($this->close_all != "") {
         $_SESSION['elearning_open_close']["all open"] = "";
     }
     $_SESSION['elearning_open_close']["type"] = "seminar";
     $_SESSION['elearning_open_close']["id"] = $this->seminar_id;
     if (Request::get('do_open')) {
         $this->anker_target = Request::get('do_open');
         $_SESSION['elearning_open_close'][Request::get('do_open')] = true;
     } elseif (Request::get('do_close')) {
         $this->anker_target = Request::get('do_close');
         $_SESSION['elearning_open_close'][Request::get('do_close')] = false;
     }
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage('sidebar/learnmodule-sidebar.png');
     $this->sidebar->setContextAvatar(CourseAvatar::getAvatar($this->seminar_id));
 }
예제 #22
0
파일: password.php 프로젝트: ratbird/hope
 /**
  * Set up this controller.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  * @throws AccessDeniedException if the current user is not allowed to
  *                               change the password
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!$this->shallChange('auth_user_md5.password', 'password')) {
         throw new AccessDeniedException();
     }
     PageLayout::setHelpKeyword('Basis.HomepagePersönlicheDaten');
     PageLayout::setTitle(_('Passwort ändern'));
     Navigation::activateItem('profile/edit/password');
     SkipLinks::addIndex(_('Passwort ändern'), 'layout_content');
 }
예제 #23
0
파일: categories.php 프로젝트: ratbird/hope
 /**
  * Set up this controller. Rewrites $action on verification.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     Navigation::activateItem('/profile/categories');
     PageLayout::setHelpKeyword('Basis.HomepageSonstiges');
     PageLayout::setTitle(_('Eigene Kategorien bearbeiten'));
     SkipLinks::addIndex(_('Eigene Kategorien bearbeiten'), 'layout_content', 100);
     if ($action === 'verify') {
         $action = 'index';
     }
 }
예제 #24
0
파일: members.php 프로젝트: ratbird/hope
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     global $perm;
     checkObject();
     checkObjectModule("participants");
     $this->course_id = $_SESSION['SessSemName'][1];
     $this->course_title = $_SESSION['SessSemName'][0];
     $this->user_id = $GLOBALS['auth']->auth['uid'];
     // Check dozent-perms
     if ($perm->have_studip_perm('dozent', $this->course_id)) {
         $this->is_dozent = true;
     }
     // Check tutor-perms
     if ($perm->have_studip_perm('tutor', $this->course_id)) {
         $this->is_tutor = true;
     }
     // Check autor-perms
     if ($perm->have_studip_perm('autor', $this->course_id)) {
         $this->is_autor = true;
     }
     if ($this->is_tutor) {
         PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenTeilnehmer");
     } else {
         PageLayout::setHelpKeyword("Basis.InVeranstaltungTeilnehmer");
     }
     // Check lock rules
     $this->dozent_is_locked = LockRules::Check($this->course_id, 'dozent');
     $this->tutor_is_locked = LockRules::Check($this->course_id, 'tutor');
     $this->is_locked = LockRules::Check($this->course_id, 'participants');
     // Layoutsettings
     PageLayout::setTitle(sprintf('%s - %s', Course::findCurrent()->getFullname(), _("Teilnehmende")));
     PageLayout::addScript('members.js');
     SkipLinks::addIndex(Navigation::getItem('/course/members')->getTitle(), 'main_content', 100);
     object_set_visit_module('participants');
     $this->last_visitdate = object_get_visit($this->course_id, 'participants');
     // Check perms and set the last visit date
     if (!$this->is_tutor) {
         $this->last_visitdate = time() + 10;
     }
     // Get the max-page-value for the pagination
     $this->max_per_page = Config::get()->ENTRIES_PER_PAGE;
     $this->status_groups = array('dozent' => get_title_for_status('dozent', 2), 'tutor' => get_title_for_status('tutor', 2), 'autor' => get_title_for_status('autor', 2), 'user' => get_title_for_status('user', 2), 'accepted' => get_title_for_status('accepted', 2), 'awaiting' => _("Wartende Personen"), 'claiming' => _("Wartende Personen"));
     // StatusGroups for the view
     $this->decoratedStatusGroups = array('dozent' => get_title_for_status('dozent', 1), 'autor' => get_title_for_status('autor', 1), 'tutor' => get_title_for_status('tutor', 1), 'user' => get_title_for_status('user', 1));
     //check for admission / waiting list
     update_admission($this->course_id);
     // Create new MembersModel, to get additionanl informations to a given Seminar
     $this->members = new MembersModel($this->course_id, $this->course_title);
     $this->members->checkUserVisibility();
     // Set default sidebar image
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/person-sidebar.png');
 }
예제 #25
0
 /**
  * this action is the main action of the schedule-controller, setting the environment for the timetable,
  * accepting a comma-separated list of days.
  *
  * @param  string  a list of an arbitrary mix of the numbers 0-6, separated with a comma (e.g. 1,2,3,4,5 (for Monday to Friday, the default))
  */
 function index_action($days = false)
 {
     if ($GLOBALS['perm']->have_perm('admin')) {
         $inst_mode = true;
     }
     $my_schedule_settings = $GLOBALS['user']->cfg->SCHEDULE_SETTINGS;
     // set the days to be displayed
     if ($days === false) {
         if (Request::getArray('days')) {
             $this->days = array_keys(Request::getArray('days'));
         } else {
             $this->days = array(0, 1, 2, 3, 4, 5, 6);
         }
     } else {
         $this->days = explode(',', $days);
     }
     // try to find the correct institute-id
     $institute_id = Request::option('institute_id', $SessSemName[1] ? $SessSemName[1] : Request::option('cid', false));
     if (!$institute_id) {
         $institute_id = $GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT;
     }
     if (!$institute_id || in_array(get_object_type($institute_id), words('inst fak')) === false) {
         throw new Exception(sprintf(_('Kann Einrichtungskalendar nicht anzeigen!' . 'Es wurde eine ungültige Instituts-Id übergeben (%s)!', $institute_id)));
     }
     // load semester-data and current semester
     $semdata = new SemesterData();
     $this->semesters = $semdata->getAllSemesterData();
     if (Request::option('semester_id')) {
         $this->current_semester = $semdata->getSemesterData(Request::option('semester_id'));
     } else {
         $this->current_semester = $semdata->getCurrentSemesterData();
     }
     $this->entries = (array) CalendarInstscheduleModel::getInstituteEntries($GLOBALS['user']->id, $this->current_semester, 8, 20, $institute_id, $this->days);
     Navigation::activateItem('/course/main/schedule');
     PageLayout::setHelpKeyword('Basis.TerminkalenderStundenplan');
     PageLayout::setTitle($GLOBALS['SessSemName']['header_line'] . ' - ' . _('Veranstaltungs-Stundenplan'));
     $zoom = Request::int('zoom', 0);
     $this->controller = $this;
     $this->calendar_view = new CalendarWeekView($this->entries, 'instschedule');
     $this->calendar_view->setHeight(40 + 20 * $zoom);
     $this->calendar_view->setRange($my_schedule_settings['glb_start_time'], $my_schedule_settings['glb_end_time']);
     $this->calendar_view->groupEntries();
     // if enabled, group entries with same start- and end-date
     URLHelper::addLinkParam('zoom', $zoom);
     URLHelper::addLinkParam('semester_id', $this->current_semester['semester_id']);
     $style_parameters = array('whole_height' => $this->calendar_view->getOverallHeight(), 'entry_height' => $this->calendar_view->getHeight());
     $factory = new Flexi_TemplateFactory($this->dispatcher->trails_root . '/views');
     PageLayout::addStyle($factory->render('calendar/stylesheet', $style_parameters));
     if (Request::option('printview')) {
         PageLayout::addStylesheet('print.css');
     } else {
         PageLayout::addStylesheet('print.css', array('media' => 'print'));
     }
 }
예제 #26
0
파일: calendar.php 프로젝트: ratbird/hope
 /**
  * Set up this controller
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  * @throws AccessDeniedException if the calendar is not globally enabled
  */
 public function before_filter(&$action, &$args)
 {
     if (!get_config('CALENDAR_ENABLE')) {
         throw new AccessDeniedException(_('Der Kalender ist nicht aktiviert.'));
     }
     parent::before_filter($action, $args);
     PageLayout::setHelpKeyword('Basis.MyStudIPTerminkalender');
     PageLayout::setTitle(_('Einstellungen des Terminkalenders anpassen'));
     Navigation::activateItem('/profile/settings/calendar_new');
     SkipLinks::addIndex(_('Einstellungen des Terminkalenders anpassen'), 'main_content', 100);
 }
예제 #27
0
파일: messages.php 프로젝트: ratbird/hope
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setTitle(_("Nachrichten"));
     PageLayout::setHelpKeyword("Basis.InteraktionNachrichten");
     if (Request::isXhr() && Request::isGet()) {
         $request = Request::getInstance();
         foreach (words('default_body default_subject') as $key) {
             $request[$key] = Request::removeMagicQuotes($_GET[$key]);
         }
     }
 }
예제 #28
0
파일: avatar.php 프로젝트: ratbird/hope
 /**
  * Set up this controller
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setHelpKeyword('Basis.HomepageBild');
     PageLayout::setTitle(_('Hochladen eines persönlichen Bildes'));
     Navigation::activateItem('/profile/avatar');
     SkipLinks::addIndex(_('Hochladen eines persönlichen Bildes'), 'edit_avatar');
     $this->customized = Avatar::getAvatar($this->user->user_id)->is_customized();
     if ($this->customized) {
         SkipLinks::addIndex(_('Eigenes Bild löschen'), 'delete_picture');
     }
 }
예제 #29
0
 /**
  * Initializes the controller.
  *
  * @param string $action Action to execute
  * @param array  $args   Passed parameters
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!Config::get()->ENABLE_FREE_ACCESS) {
         throw new AccessDeniedException(_('Öffentliche Veranstaltungen sind nicht aktiviert.'));
     }
     Navigation::activateItem('/browse');
     PageLayout::setTitle(_('Öffentliche Veranstaltungen'));
     PageLayout::setHelpKeyword('Basis.SymboleFreieVeranstaltungen');
     // we are definitely not in an lexture or institute
     closeObject();
 }
예제 #30
0
파일: autoinsert.php 프로젝트: ratbird/hope
 /**
  * Common tasks for all actions.
  */
 public function before_filter(&$action, &$args)
 {
     global $perm;
     parent::before_filter($action, $args);
     // user must have root permission
     $perm->check('root');
     // set navigation
     Navigation::activateItem('/admin/locations/auto_insert');
     //pagelayout
     PageLayout::setTitle(_('Automatisiertes Eintragen verwalten'));
     PageLayout::setHelpKeyword("Admins.AutomatisiertesEintragen");
 }