Example #1
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();
 }
Example #2
0
 /**
  *
  **/
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     # initialize Stud.IP-Session
     page_open(array('sess' => 'Seminar_Session', 'auth' => 'Seminar_Default_Auth', 'perm' => 'Seminar_Perm', 'user' => 'Seminar_User'));
     $this->set_layout(null);
 }
Example #3
0
 /**
  * Callback function being called before an action is executed.
  */
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // open session
     page_open(array('sess' => 'Seminar_Session', 'auth' => 'Seminar_Default_Auth', 'perm' => 'Seminar_Perm', 'user' => 'Seminar_User'));
     // set up user session
     include 'lib/seminar_open.php';
     $this->set_content_type('text/html; charset=windows-1252');
     $this->area_structure = ['global' => ['title' => _('Stud.IP (systemweit)'), 'icon' => 'home'], 'inst' => ['title' => _('Einrichtungen'), 'icon' => 'institute'], 'sem' => ['title' => _('Veranstaltungen'), 'icon' => 'seminar'], 'user' => ['title' => _('Profile'), 'icon' => 'person']];
 }
Example #4
0
 /**
  *
  **/
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $GLOBALS['perm']->check('autor');
     $layout = $GLOBALS['template_factory']->open('layouts/base');
     $this->set_layout($layout);
     Navigation::activateItem('/links/settings/oauth');
     PageLayout::setTabNavigation('/links/settings');
     PageLayout::setTitle(_('Applikationen'));
     $this->store = new OAuthConsumer();
     $this->types = array('website' => _('Website'), 'program' => _('Herkömmliches Desktopprogramm'), 'app' => _('Mobile App'));
 }
Example #5
0
 /**
  * common tasks for all actions
  */
 public function before_filter(&$action, &$args)
 {
     $this->with_session = true;
     parent::before_filter($action, $args);
     // Siteinfo-Class is defined in models/siteinfo.php
     $this->si = new Siteinfo();
     $this->populate_ids($args);
     $this->add_navigation($action);
     if (is_object($GLOBALS['perm']) && $GLOBALS['perm']->have_perm('root')) {
         $this->setupSidebar();
     } else {
         $action = 'show';
     }
     PageLayout::setTitle(_('Impressum'));
     PageLayout::setTabNavigation('/footer/siteinfo');
 }
Example #6
0
 /**
  *
  **/
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $GLOBALS['perm']->check('root');
     $layout = $GLOBALS['template_factory']->open('layouts/base');
     $this->set_layout($layout);
     Navigation::activateItem('/admin/config/oauth');
     PageLayout::setTitle(_('OAuth Administration'));
     $this->store = new OAuthConsumer();
     $this->types = array('website' => _('Website'), 'program' => _('Herkömmliches Desktopprogramm'), 'app' => _('Mobile App'));
     // Infobox
     $this->setInfoboxImage('infobox/administration.jpg');
     if ($action !== 'index') {
         $back = sprintf('<a href="%s">%s</a>', $this->url_for('admin'), _('Zurück zur Übersicht'));
         $this->addToInfobox('Aktionen', $back, 'icons/16/black/arr_1left');
     }
     $new = sprintf('<a href="%s">%s</a>', $this->url_for('admin/edit'), _('Neue Applikation registrieren'));
     $this->addToInfobox('Aktionen', $new, 'icons/16/black/plus');
     $new = sprintf('<a href="%s">%s</a>', $this->url_for('admin/permissions'), _('Globale Zugriffseinstellungen'));
     $this->addToInfobox('Aktionen', $new, 'icons/16/black/admin');
 }
Example #7
0
File: scm.php Project: 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);
     // open session
     page_open(array('sess' => 'Seminar_Session', 'auth' => 'Seminar_Default_Auth', 'perm' => 'Seminar_Perm', 'user' => 'Seminar_User'));
     // set up user session
     include 'lib/seminar_open.php';
     if (!Config::Get()->SCM_ENABLE) {
         throw new AccessDeniedException(_('Die freien Informationsseiten sind nicht aktiviert.'));
     }
     $GLOBALS['auth']->login_if(Request::get('again') && $GLOBALS['auth']->auth['uid'] == 'nobody');
     $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();
     }
     if ($GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1])) {
         $widget = new ActionsWidget();
         $widget->addLink(_('Neuen Eintrag anlegen'), URLHelper::getLink('dispatch.php/course/scm/create'), Icon::create('add', 'clickable'))->asDialog();
         Sidebar::get()->addWidget($widget);
     }
     PageLayout::setHelpKeyword('Basis.Informationsseite');
     Navigation::activateItem('/course/scm');
     checkObject();
     // do we have an open object?
     checkObjectModule('scm');
     object_set_visit_module('scm');
     // Set sidebar image
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/info-sidebar.png');
 }
Example #8
0
 function before_filter(&$action, &$args)
 {
     $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     parent::before_filter($action, $args);
 }