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'); }
/** * Renders the sidebar. * The sidebar will only be rendered if it actually contains any widgets. * It will use the template "sidebar.php" located at "templates/sidebar". * A notification is dispatched before and after the actual rendering * process. * * @return String The HTML code of the rendered sidebar. */ public function render() { $content = ''; if ($this->context_avatar === null) { $breadcrumbs = $this->getBreadCrumbs(); $keys = array_keys($breadcrumbs); if (reset($keys) === 'course') { $course = Course::findCurrent(); if ($course) { if ($course->getSemClass()->offsetGet('studygroup_mode')) { $avatar = StudygroupAvatar::getAvatar($course->id); } else { $avatar = CourseAvatar::getAvatar($course->id); } } else { $institute = Institute::findCurrent(); $avatar = InstituteAvatar::getAvatar($institute->id); } $this->setContextAvatar($avatar); } } NotificationCenter::postNotification('SidebarWillRender', $this); if ($this->hasWidgets()) { $template = $GLOBALS['template_factory']->open('sidebar/sidebar'); $template->widgets = $this->widgets; $template->image = $this->getImage(); $template->title = $this->getTitle(); $template->avatar = $this->context_avatar; $content = $template->render(); } NotificationCenter::postNotification('SidebarDidRender', $this); return $content; }
<?php # Lifter002: TEST # Lifter007: TEST /** * admin_search_form.inc.php - Suche fuer die Verwaltungsseiten von Stud.IP. * * @author Stefan Suchi <*****@*****.**> * @author Ralf Stockmann <*****@*****.**> * @author Cornelis Kater <*****@*****.**> * @copyright 2001 * @license GPL2 or any later version */ if (!Institute::findCurrent()) { $template = $GLOBALS['template_factory']->open('admin/institute_search.php'); $template->set_layout('layouts/base.php'); $template->institutes = Institute::getMyInstitutes($GLOBALS['user']->id); echo $template->render(); page_close(); die; }
/** * This function "selects" an Einrichtung to work with it * * Note: Stud.IP treats Einrichtungen like Veranstaltungen, yu can see this * especially if you look at the variable names.... * * The following variables will bet set: * $SessionSeminar Einrichtung id<br> * $SessSemName[0] Einrichtung name<br> * $SessSemName[1] Einrichtung id<br> * $SessSemName["art"] Einrichtung type in alphanumeric form<br> * $SessSemName["art_num"] Einrichtung type in numeric form<br> * $SessSemName["art_generic"] Einrichtung generic type in alhanumeric form (self description)<br> * $SessSemName["class"] Einrichtung class (sem or inst, in this function always inst)<br> * $SessSemName["header_line"] the header-line to use on every page of the Einrichtung<br> * * @param string $inst_id the id of the Veranstaltung * * @return boolean true if successful * */ function selectInst($inst_id) { global $SessionSeminar, $SessSemName, $INST_TYPE, $SemUserStatus, $rechte, $perm, $auth; closeObject(); if (!get_config('ENABLE_FREE_ACCESS') && !$perm->have_perm('user')) { // redirect to login page if user is not logged in $auth->login_if($auth->auth["uid"] == "nobody"); throw new AccessDeniedException(); } $SessionSeminar = $inst_id; $institute = Institute::findCurrent(); if ($institute) { if (!($SemUserStatus = $perm->get_studip_perm($institute["Institut_id"]))) { $SemUserStatus = 'nobody'; } $rechte = $perm->have_studip_perm("tutor", $institute["Institut_id"]); $SessionSeminar = $institute["Institut_id"]; $SessSemName[0] = $institute["Name"]; $SessSemName[1] = $institute["Institut_id"]; $SessSemName["art_generic"] = _("Einrichtung"); $SessSemName["art"] = $INST_TYPE[$row["type"]]["name"]; if (!$SessSemName["art"]) { $SessSemName["art"] = $SessSemName["art_generic"]; } $SessSemName["class"] = "inst"; $SessSemName["is_fak"] = $institute["is_fak"]; $SessSemName["art_num"] = $institute["type"]; $SessSemName["fak"] = $institute["fakultaets_id"]; $SessSemName["header_line"] = $institute->getFullname(); $_SESSION['SessionSeminar'] =& $SessionSeminar; $_SESSION['SessSemName'] =& $SessSemName; URLHelper::addLinkParam('cid', $SessionSeminar); return true; } else { $SessionSeminar = null; return false; } }