public function index_action() { $this->prelim_discussion = vorbesprechung($this->course->id); $this->title = $this->course->getFullname(); $this->course_domains = UserDomain::getUserDomainsForSeminar($this->course->id); $this->sem = new Seminar($this->course); if ($studienmodulmanagement = PluginEngine::getPlugin('StudienmodulManagement')) { foreach ($this->course->study_areas->filter(function ($m) { return $m->isModule(); }) as $module) { $this->studymodules[] = array('nav' => $studienmodulmanagement->getModuleInfoNavigation($module->id, $this->course->start_semester->id), 'title' => $studienmodulmanagement->getModuleTitle($module->id, $this->course->start_semester->id)); } } // Retrive display of sem_tree if (Config::get()->COURSE_SEM_TREE_DISPLAY) { $this->studyAreaTree = StudipStudyArea::backwards($this->course->study_areas); } else { $this->study_areas = $this->course->study_areas->filter(function ($m) { return !$m->isModule(); }); } if (Request::isXhr()) { $this->set_layout(null); $this->response->add_header('Content-Type', 'text/html;charset=Windows-1252'); header('X-Title: ' . $this->title); } else { PageLayout::setHelpKeyword("Basis.InVeranstaltungDetails"); PageLayout::setTitle($this->title . " - " . _("Details")); PageLayout::addSqueezePackage('admission'); PageLayout::addSqueezePackage('enrolment'); if ($GLOBALS['SessionSeminar'] == $this->course->id) { Navigation::activateItem('/course/main/details'); SkipLinks::addIndex(Navigation::getItem('/course/main/details')->getTitle(), 'main_content', 100); } else { $sidebarlink = true; $enrolment_info = $this->sem->getEnrolmentInfo($GLOBALS['user']->id); } $sidebar = Sidebar::Get(); if ($sidebarlink) { $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id)); } $sidebar->setTitle(_('Details')); $links = new ActionsWidget(); $links->addLink(_("Drucken"), URLHelper::getScriptLink("dispatch.php/course/details/index/" . $this->course->id), Icon::create('print', 'clickable'), array('class' => 'print_action', 'target' => '_blank')); if ($enrolment_info['enrolment_allowed'] && $sidebarlink) { if (in_array($enrolment_info['cause'], words('member root courseadmin'))) { $abo_msg = _("direkt zur Veranstaltung"); } else { $abo_msg = _("Zugang zur Veranstaltung"); } $links->addLink($abo_msg, URLHelper::getScriptLink("dispatch.php/course/enrolment/apply/" . $this->course->id), Icon::create('door-enter', 'clickable'), array('data-dialog' => '')); } if (Config::get()->SCHEDULE_ENABLE && !$GLOBALS['perm']->have_studip_perm("user", $this->course->id) && !$GLOBALS['perm']->have_perm('admin') && $this->sem->getMetaDateCount()) { $query = "SELECT COUNT(*) FROM schedule_seminare WHERE seminar_id = ? AND user_id = ?"; if (!DBManager::Get()->fetchColumn($query, array($this->course->id, $GLOBALS['user']->id))) { $links->addLink(_("Nur im Stundenplan vormerken"), URLHelper::getLink("dispatch.php/calendar/schedule/addvirtual/" . $this->course->id), Icon::create('info', 'clickable')); } } if ($this->send_from_search_page) { $links->addLink(_("Zurück zur letzten Auswahl"), URLHelper::getLink($this->send_from_search_page), Icon::create('link-intern', 'clickable')); } if ($links->hasElements()) { $sidebar->addWidget($links); } $sidebar->setImage('sidebar/seminar-sidebar.png'); $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id)); $sidebar = Sidebar::Get(); $sidebar->setImage('sidebar/seminar-sidebar.png'); $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id)); if ($enrolment_info['description']) { PageLayout::postMessage(MessageBox::info($enrolment_info['description'])); } } }
public function getAncestorTree($id) { $result = array(); $node = StudipStudyArea::find($id); $root = StudipStudyArea::backwards(array($node)); $result = $this->buildPartialSemTree($root); return json_encode($result); }