当前位置: 首页>>代码示例>>PHP>>正文


PHP Modules::getLocalModules方法代码示例

本文整理汇总了PHP中Modules::getLocalModules方法的典型用法代码示例。如果您正苦于以下问题:PHP Modules::getLocalModules方法的具体用法?PHP Modules::getLocalModules怎么用?PHP Modules::getLocalModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Modules的用法示例。


在下文中一共展示了Modules::getLocalModules方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: courseToJSON

 private function courseToJSON($course)
 {
     $json = array();
     $json['course_id'] = $course->id;
     $json['number'] = $course->VeranstaltungsNummer;
     $json['title'] = $course->Name;
     $json['subtitle'] = $course->Untertitel;
     $json['type'] = $course->status;
     $json['description'] = $course->Beschreibung;
     $json['location'] = $course->Ort;
     // lecturers
     foreach ($course->getMembersWithStatus('dozent') as $lecturer) {
         $url = $this->urlf('/user/%s', array(htmlReady($lecturer->user_id)));
         $json['lecturers'][$url] = User::getMiniUser($this, $lecturer->user);
     }
     // other members
     foreach (words("user autor tutor dozent") as $status) {
         $json['members'][$status] = $this->urlf('/course/%s/members?status=%s', array($course->id, $status));
         $json['members'][$status . '_count'] = $course->countMembersWithStatus($status);
     }
     foreach (words("start_semester end_semester") as $key) {
         $json[$key] = $course->{$key} ? $this->urlf('/semester/%s', array(htmlReady($course->{$key}->id))) : null;
     }
     $modules = new \Modules();
     $activated = $modules->getLocalModules($course->id, 'sem');
     $json['modules'] = array();
     foreach (array('forum' => 'forum_categories', 'documents' => 'files', 'wiki' => 'wiki') as $module => $uri) {
         if ($activated[$module]) {
             $json['modules'][$module] = $this->urlf('/course/%s/%s', array(htmlReady($course->id), $uri));
         }
     }
     return $json;
 }
开发者ID:ratbird,项目名称:hope,代码行数:33,代码来源:Course.php

示例2: tabularasa_action

 /**
  * TODO: Caching
  * @param string $type
  * @param string $sem
  */
 public function tabularasa_action($sem = 'all', $timestamp = null)
 {
     NotificationCenter::postNotification('OverviewWillClear', $GLOBALS['user']->id);
     $timestamp = $timestamp ?: time();
     $deputies_enabled = Config::get()->DEPUTIES_ENABLE;
     $semesters = MyRealmModel::getSelectedSemesters($sem);
     $min_sem_key = min($semesters);
     $max_sem_key = max($semesters);
     $courses = MyRealmModel::getCourses($min_sem_key, $max_sem_key, compact('deputies_enabled'));
     $courses = $courses->toArray('seminar_id modules status');
     $modules = new Modules();
     foreach ($courses as $index => $course) {
         $courses[$index]['modules'] = $modules->getLocalModules($course['seminar_id'], 'sem', $course['modules'], $course['status']);
         $courses[$index]['obj_type'] = 'sem';
         MyRealmModel::setObjectVisits($courses[$index], $course['seminar_id'], $GLOBALS['user']->id, $timestamp);
     }
     NotificationCenter::postNotification('OverviewDidClear', $GLOBALS['user']->id);
     $this->flash['tabularasa'] = $timestamp;
     $this->redirect('my_courses/index');
 }
开发者ID:ratbird,项目名称:hope,代码行数:25,代码来源:my_courses.php

示例3: array


//.........这里部分代码省略.........
                         $errors[] = _("Bitte Gruppennamen angeben");
                         //... if so, test if this is not taken by another group
                     } else {
                         $query = "SELECT 1 FROM seminare WHERE name = ? AND Seminar_id != ?";
                         $statement = DBManager::get()->prepare($query);
                         $statement->execute(array(Request::get('groupname'), $id));
                         if ($statement->fetchColumn()) {
                             $errors[] = _("Eine Veranstaltung/Studiengruppe mit diesem Namen existiert bereits. Bitte wählen Sie einen anderen Namen");
                         }
                     }
                     if (count($errors)) {
                         $this->flash['errors'] = $errors;
                         $this->flash['edit'] = true;
                         // Everything seems fine, let's update the studygroup
                     } else {
                         $sem->name = Request::get('groupname');
                         // seminar-class quotes itself
                         $sem->description = Request::get('groupdescription');
                         // seminar-class quotes itself
                         $sem->read_level = 1;
                         $sem->write_level = 1;
                         $sem->visible = 1;
                         if (Request::get('groupaccess') == 'all') {
                             $sem->admission_prelim = 0;
                         } else {
                             $sem->admission_prelim = 1;
                             if (Config::get()->STUDYGROUPS_INVISIBLE_ALLOWED && Request::get('groupaccess') == 'invisible') {
                                 $sem->visible = 0;
                             }
                             $sem->admission_prelim_txt = _("Die ModeratorInnen der Studiengruppe können Ihren Aufnahmewunsch bestätigen oder ablehnen. Erst nach Bestätigung erhalten Sie vollen Zugriff auf die Gruppe.");
                         }
                         // get the current bitmask
                         $mods = new Modules();
                         $admin_mods = new AdminModules();
                         $bitmask = $sem->modules;
                         // de-/activate modules
                         $available_modules = StudygroupModel::getInstalledModules();
                         $orig_modules = $mods->getLocalModules($sem->id, "sem");
                         $active_plugins = Request::getArray("groupplugin");
                         $deactivate_modules = array();
                         foreach (array_keys($available_modules) as $key) {
                             $module_name = $sem_class->getSlotModule($key);
                             if (!$module_name || $module_name && ($sem_class->isModuleMandatory($module_name) || !$sem_class->isModuleAllowed($module_name))) {
                                 continue;
                             }
                             if (!$module_name) {
                                 $module_name = $key;
                             }
                             if ($active_plugins[$module_name]) {
                                 // activate modules
                                 $mods->setBit($bitmask, $mods->registered_modules[$key]["id"]);
                                 if (!$orig_modules[$key]) {
                                     $methodActivate = "module" . ucfirst($key) . "Activate";
                                     if (method_exists($admin_mods, $methodActivate)) {
                                         $admin_mods->{$methodActivate}($sem->id);
                                         $studip_module = $sem_class->getModule($key);
                                         if (is_a($studip_module, "StandardPlugin")) {
                                             PluginManager::getInstance()->setPluginActivated($studip_module->getPluginId(), $id, true);
                                         }
                                     }
                                 }
                             } else {
                                 // prepare for deactivation
                                 // (user will have to confirm)
                                 if ($orig_modules[$key]) {
                                     $deactivate_modules[] = $key;
                                 }
                             }
                         }
                         $this->flash['deactivate_modules'] = $deactivate_modules;
                         $sem->modules = $bitmask;
                         $sem->store();
                         // de-/activate plugins
                         $available_plugins = StudygroupModel::getInstalledPlugins();
                         $plugin_manager = PluginManager::getInstance();
                         $deactivate_plugins = array();
                         foreach ($available_plugins as $key => $name) {
                             $plugin = $plugin_manager->getPlugin($key);
                             $plugin_id = $plugin->getPluginId();
                             if ($active_plugins[$key] && $name && $sem_class->isModuleAllowed($key)) {
                                 $plugin_manager->setPluginActivated($plugin_id, $id, true);
                             } else {
                                 if ($plugin_manager->isPluginActivated($plugin_id, $id) && !$sem_class->isSlotModule($key)) {
                                     $deactivate_plugins[$plugin_id] = $key;
                                 }
                             }
                         }
                         $this->flash['deactivate_plugins'] = $deactivate_plugins;
                     }
                 }
             }
         }
     }
     if (!$this->flash['errors'] && !$deactivate_modules && !$deactivate_plugins) {
         // Everything seems fine
         $this->flash['success'] = _("Die Änderungen wurden erfolgreich übernommen.");
     }
     // let's go to the studygroup
     $this->redirect('course/studygroup/edit/' . $id);
 }
开发者ID:ratbird,项目名称:hope,代码行数:101,代码来源:studygroup.php

示例4: checkObjectModule

/**
 * This function checks, if given old style module "wiki","scm" (not "CoreWiki") etc.
 * is allowed in this stud.ip-object.
 *
 * @global array $SessSemName
 *
 * @param string $module the module to check for
 *
 * @return void
 */
function checkObjectModule($module)
{
    global $SessSemName;
    if ($SessSemName[1]) {
        $modules = new Modules();
        $local_modules = $modules->getLocalModules($SessSemName[1], $SessSemName['class']);
        $checkslot = $module;
        if ($SessSemName['class'] == 'sem' && $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$SessSemName['art_num']]['class']]) {
            $sem_class = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$SessSemName['art_num']]['class']];
            $new_module_name = "Core" . ucfirst($module);
            $mandatory = false;
            foreach (SemClass::getSlots() as $slot) {
                if ($sem_class->getSlotModule($slot) === $new_module_name) {
                    $checkslot = $slot;
                    if ($sem_class->isModuleMandatory($new_module_name)) {
                        $mandatory = true;
                    }
                }
            }
        }
        if (!$local_modules[$checkslot] && !$mandatory) {
            throw new CheckObjectException(sprintf(_('Das Inhaltselement "%s" ist f�r dieses Objekt leider nicht verf�gbar.'), ucfirst($module)));
        }
    }
}
开发者ID:ratbird,项目名称:hope,代码行数:35,代码来源:functions.php

示例5: getCourses

 /**
  * Returns all courses matching set criteria.
  *
  * @param Array $params Additional parameters
  * @return Array of courses
  */
 private function getCourses($params = array())
 {
     // Init
     if ($GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT === "all") {
         $inst = new SimpleCollection($this->insts);
         $inst->filter(function ($a) use(&$inst_ids) {
             $inst_ids[] = $a->Institut_id;
         });
     } else {
         $institut = new Institute($GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT);
         $inst_ids[] = $GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT;
         if ($institut->isFaculty()) {
             foreach ($institut->sub_institutes->pluck("Institut_id") as $institut_id) {
                 $inst_ids[] = $institut_id;
             }
         }
     }
     $filter = AdminCourseFilter::get(true);
     $filter->where("sem_classes.studygroup_mode = '0'");
     if (is_object($this->semester)) {
         $filter->filterBySemester($this->semester->getId());
     }
     if ($params['typeFilter'] && $params['typeFilter'] !== "all") {
         list($class_filter, $type_filter) = explode('_', $params['typeFilter']);
         if (!$type_filter && !empty($GLOBALS['SEM_CLASS'][$class_filter])) {
             $type_filter = array_keys($GLOBALS['SEM_CLASS'][$class_filter]->getSemTypes());
         }
         $filter->filterByType($type_filter);
     }
     if ($GLOBALS['user']->cfg->ADMIN_COURSES_SEARCHTEXT) {
         $filter->filterBySearchString($GLOBALS['user']->cfg->ADMIN_COURSES_SEARCHTEXT);
     }
     if ($GLOBALS['user']->cfg->ADMIN_COURSES_TEACHERFILTER && $GLOBALS['user']->cfg->ADMIN_COURSES_TEACHERFILTER !== "all") {
         $filter->filterByDozent($GLOBALS['user']->cfg->ADMIN_COURSES_TEACHERFILTER);
     }
     $filter->filterByInstitute($inst_ids);
     if ($params['sortby'] === "status") {
         $filter->orderBy(sprintf('sem_classes.name %s, sem_types.name %s, VeranstaltungsNummer', $params['sortFlag'], $params['sortFlag'], $params['sortFlag']), $params['sortFlag']);
     } elseif ($params['sortby'] === 'completion') {
         $filter->orderBy('is_complete', $params['sortFlag']);
     } elseif ($params['sortby']) {
         $filter->orderBy($params['sortby'], $params['sortFlag']);
     }
     $filter->storeSettings();
     $this->count_courses = $filter->countCourses();
     if ($this->count_courses && $this->count_courses <= $filter->max_show_courses) {
         $courses = $filter->getCourses();
     } else {
         return array();
     }
     if (in_array('contents', $params['view_filter'])) {
         $sem_types = SemType::getTypes();
         $modules = new Modules();
     }
     $seminars = array_map('reset', $courses);
     if (!empty($seminars)) {
         foreach ($seminars as $seminar_id => $seminar) {
             $dozenten = $this->getTeacher($seminar_id);
             $seminars[$seminar_id]['dozenten'] = $dozenten;
             if (in_array('teachers', $params['view_filter'])) {
                 if (SeminarCategories::getByTypeId($seminar['status'])->only_inst_user) {
                     $search_template = "user_inst_not_already_in_sem";
                 } else {
                     $search_template = "user_not_already_in_sem";
                 }
                 $sem_helper = new Seminar(Course::buildExisting($seminar));
                 $dozentUserSearch = new PermissionSearch($search_template, sprintf(_("%s suchen"), get_title_for_status('dozent', 1, $seminar['status'])), "user_id", array('permission' => 'dozent', 'seminar_id' => $this->course_id, 'sem_perm' => 'dozent', 'institute' => $sem_helper->getInstitutes()));
                 $seminars[$seminar_id]['teacher_search'] = MultiPersonSearch::get("add_member_dozent" . $seminar_id)->setTitle(_('Mehrere Lehrende hinzufügen'))->setSearchObject($dozentUserSearch)->setDefaultSelectedUser(array_keys($dozenten))->setDataDialogStatus(Request::isXhr())->setExecuteURL(URLHelper::getLink('dispatch.php/course/basicdata/add_member/' . $seminar_id, array('from' => 'admin/courses')));
             }
             if (in_array('contents', $params['view_filter'])) {
                 $seminars[$seminar_id]['sem_class'] = $sem_types[$seminar['status']]->getClass();
                 $seminars[$seminar_id]['modules'] = $modules->getLocalModules($seminar_id, 'sem', $seminar['modules'], $seminar['status']);
                 $seminars[$seminar_id]['navigation'] = MyRealmModel::getAdditionalNavigations($seminar_id, $seminars[$seminar_id], $seminars[$seminar_id]['sem_class'], $GLOBALS['user']->id);
             }
             if ($this->selected_action == 17) {
                 $seminars[$seminar_id]['admission_locked'] = false;
                 if ($seminar['course_set']) {
                     $set = new CourseSet($seminar['course_set']);
                     if (!is_null($set) && $set->hasAdmissionRule('LockedAdmission')) {
                         $seminars[$seminar_id]['admission_locked'] = 'locked';
                     } else {
                         $seminars[$seminar_id]['admission_locked'] = 'disable';
                     }
                     unset($set);
                 }
             }
         }
     }
     return $seminars;
 }
开发者ID:ratbird,项目名称:hope,代码行数:96,代码来源:courses.php

示例6: getSlotModule

 /**
  * returns StudipModule object for given slot, null when deactivated or not available
  *
  * @param string $slot
  * @return StudipModule
  */
 public function getSlotModule($slot)
 {
     $m = new Modules();
     $activated_slots = array_filter($m->getLocalModules($this->id, 'sem', $this->modules, $this->status));
     if (isset($activated_slots[$slot])) {
         $module = $this->getSemClass()->getSlotModule($slot);
         if (is_subclass_of($module, 'StudIPPlugin')) {
             return PluginManager::getInstance()->getPlugin($module);
         } else {
             return new $module();
         }
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:19,代码来源:Seminar.class.php

示例7: store_action


//.........这里部分代码省略.........
     $institute->type = Request::int('type', $institute->type);
     $institute->lit_plugin_name = Request::get('lit_plugin_name', $institute->lit_plugin_name);
     $institute->lock_rule = Request::option('lock_rule', $institute->lock_rule);
     // Do we have all necessary data?
     if (!$institute->name) {
         PageLayout::postMessage(MessageBox::error(_('Bitte geben Sie eine Bezeichnung für die Einrichtung ein!')));
         return $this->redirect('institute/basicdata/index/' . $i_id);
     }
     if ($create_institute) {
         $institute->id = $institute->getNewId();
         // Is the user allowed to create new faculties
         if (!$institute->fakultaets_id && !$GLOBALS['perm']->have_perm('root')) {
             PageLayout::postMessage(MessageBox::error(_('Sie haben nicht die Berechtigung, neue Fakultäten zu erstellen')));
             return $this->redirect('institute/basicdata/index/new');
         }
         // Is the user allowed to create new institutes
         if (!$GLOBALS['perm']->have_perm('root') && !($GLOBALS['perm']->is_fak_admin() && get_config('INST_FAK_ADMIN_PERMS') !== 'none')) {
             PageLayout::postMessage(MessageBox::error(_('Sie haben nicht die Berechtigung, um neue Einrichtungen zu erstellen!')));
             return $this->redirect('institute/basicdata/index/new');
         }
         // Does an institute with the given name already exist in the given faculty?
         if ($institute->fakultaets_id && Institute::findOneBySQL('Name = ? AND fakultaets_id = ?', array($institute->name, $institute->fakultaets_id)) !== null) {
             $message = sprintf(_('Die Einrichtung "%s" existiert bereits innerhalb der angegebenen Fakultät!'), $institute->name);
             PageLayout::postMessage(MessageBox::error($message));
             return $this->redirect('institute/basicdata/index/new');
         }
         // Does a faculty with the given name already exist
         if (!$institute->fakultaets_id && Institute::findOneBySQL('Name = ? AND fakultaets_id = Institut_id', array($institute->name)) !== null) {
             $message = sprintf(_('Die Fakultät "%s" existiert bereits!'), $institute->name);
             PageLayout::postMessage(MessageBox::error($message));
             return $this->redirect('institute/basicdata/index/new');
         }
         // Initialize modules
         $modules = new Modules();
         $institute->modules = $modules->getDefaultBinValue('', 'inst', $institute->type);
         // Declare faculty status if neccessary
         if (!$institute->fakultaets_id) {
             $institute->fakultaets_id = $institute->getId();
         }
     } else {
         // Is the user allowed to change the institute/faculty?
         if (!$GLOBALS['perm']->have_studip_perm('admin', $institute->id)) {
             PageLayout::postMessage(MessageBox::error(_('Sie haben nicht die Berechtigung diese Einrichtung zu verändern!')));
             return $this->redirect('institute/basicdata/index/' . $institute->id);
         }
         // Save datafields
         $datafields = Request::getArray('datafields');
         $invalidEntries = array();
         $datafields_stored = 0;
         foreach (DataFieldEntry::getDataFieldEntries($institute->id, 'inst') as $entry) {
             if (isset($datafields[$entry->getId()])) {
                 $valueBefore = $entry->getValue();
                 $entry->setValueFromSubmit($datafields[$entry->getId()]);
                 if ($valueBefore != $entry->getValue()) {
                     if ($entry->isValid()) {
                         $datafields_stored += 1;
                         $entry->store();
                     } else {
                         $invalidEntries[] = $entry->getId();
                     }
                 }
             }
         }
         // If any errors occured while updating the datafields, report them
         if (count($invalidEntries) > 0) {
             $this->flash['invalid_entries'] = $invalidEntries;
             PageLayout::postMessage(MessageBox::error(_('ungültige Eingaben (s.u.) wurden nicht gespeichert')));
         }
     }
     // Try to store the institute, report any errors
     if ($institute->isDirty() && !$institute->store()) {
         if ($institute->isNew()) {
             PageLayout::postMessage(MessageBox::error(_('Die Einrichtung konnte nicht angelegt werden.')));
         } else {
             PageLayout::postMessage(MessageBox::error(_('Die Änderungen konnten nicht gespeichert werden.')));
         }
         return $this->redirect('institute/basicdata/index/' . $i_id);
     }
     if ($create_institute) {
         // Log creation of institute
         log_event('INST_CREATE', $institute->id, null, null, '');
         // logging
         // Further initialize modules (the modules class setup is in
         // no way expensive, so it can be constructed twice, don't worry)
         $modules = new Modules();
         $module_list = $modules->getLocalModules($institute->id, 'inst', $institute->modules, $institute->type);
         if (isset($module_list['documents'])) {
             create_folder(_('Allgemeiner Dateiordner'), _('Ablage für allgemeine Ordner und Dokumente der Einrichtung'), $institute->id, 7, $institute->id);
         }
         // Report success
         $message = sprintf(_('Die Einrichtung "%s" wurde erfolgreich angelegt.'), $institute->name);
         PageLayout::postMessage(MessageBox::success($message));
         openInst($institute->id);
     } else {
         // Report success
         $message = sprintf(_('Die Änderung der Einrichtung "%s" wurde erfolgreich gespeichert.'), htmlReady($institute->name));
         PageLayout::postMessage(MessageBox::success($message));
     }
     $this->redirect('institute/basicdata/index/' . $institute->id, array('cid' => $institute->id));
 }
开发者ID:ratbird,项目名称:hope,代码行数:101,代码来源:basicdata.php

示例8: initSubNavigation

 /**
  * Initialize the subnavigation of this item. This method
  * is called once before the first item is added or removed.
  */
 public function initSubNavigation()
 {
     global $SEM_CLASS, $SEM_TYPE;
     global $SessSemName, $user;
     parent::initSubNavigation();
     // list of used modules
     $Modules = new Modules();
     $modules = $Modules->getLocalModules($SessSemName[1], $SessSemName['class'], false, $SessSemName['art_num']);
     if ($SessSemName['class'] === 'sem') {
         $sem_class = $SEM_CLASS[$SEM_TYPE[$SessSemName['art_num']]['class']] ?: SemClass::getDefaultSemClass();
     } else {
         $sem_class = SemClass::getDefaultInstituteClass($SessSemName['art_num']);
     }
     // general information
     if (($modules['overview'] || $sem_class->isSlotMandatory("overview")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("overview"))) {
         foreach ($sem_class->getNavigationForSlot("overview") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
     }
     // admin area
     if (($modules['admin'] || $sem_class->isSlotMandatory("admin")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("admin"))) {
         foreach ($sem_class->getNavigationForSlot("admin") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
     }
     // forum
     if (($modules['forum'] || $sem_class->isSlotMandatory("forum")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("forum"))) {
         foreach ($sem_class->getNavigationForSlot("forum") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
     }
     // participants
     if ($user->id != 'nobody') {
         if ($modules['personal']) {
             $navigation = new Navigation(_('Personal'));
             $navigation->setImage(Icon::create('persons', 'info_alt'));
             $navigation->setActiveImage(Icon::create('persons', 'info'));
             $navigation->addSubNavigation('view', new Navigation(_('MitarbeiterInnen'), 'dispatch.php/institute/members'));
             if ($GLOBALS['perm']->have_studip_perm('tutor', $_SESSION['SessionSeminar']) && $GLOBALS['perm']->have_perm('admin')) {
                 $navigation->addSubNavigation('edit_groups', new Navigation(_('Funktionen / Gruppen verwalten'), 'dispatch.php/admin/statusgroups'));
             }
             $this->addSubNavigation('faculty', $navigation);
         }
         if (($modules['participants'] || $sem_class->isSlotMandatory("participants")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("participants"))) {
             foreach ($sem_class->getNavigationForSlot("participants") as $nav_name => $navigation) {
                 if ($nav_name && is_a($navigation, "Navigation")) {
                     $this->addSubNavigation($nav_name, $navigation);
                 }
             }
         }
     }
     // files
     if (($modules['documents'] || $sem_class->isSlotMandatory("documents")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("documents"))) {
         foreach ($sem_class->getNavigationForSlot("documents") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
     }
     // schedule
     if (($modules['schedule'] || $sem_class->isSlotMandatory("schedule")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("schedule"))) {
         foreach ($sem_class->getNavigationForSlot("schedule") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
     }
     // information page
     if (($modules['scm'] || $sem_class->isSlotMandatory("scm")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("scm"))) {
         foreach ($sem_class->getNavigationForSlot("scm") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
     }
     // literature
     if (($modules['literature'] || $sem_class->isSlotMandatory("literature")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("literature"))) {
         foreach ($sem_class->getNavigationForSlot("literature") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
     }
     // wiki
     if (($modules['wiki'] || $sem_class->isSlotMandatory("wiki")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("wiki"))) {
         foreach ($sem_class->getNavigationForSlot("wiki") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
//.........这里部分代码省略.........
开发者ID:ratbird,项目名称:hope,代码行数:101,代码来源:CourseNavigation.php

示例9: getStudygroups

 public static function getStudygroups()
 {
     $courses = array();
     $modules = new Modules();
     $studygroups = User::findCurrent()->course_memberships->filter(function ($c) {
         return $c->course->getSemClass()->offsetGet('studygroup_mode');
     })->toGroupedArray('seminar_id');
     $param_array = 'name seminar_id visible veranstaltungsnummer start_time duration_time status visible ';
     $param_array .= 'chdate admission_binding modules admission_prelim';
     $courses = Course::findAndMapMany(function ($course) use($param_array, $studygroups, $modules) {
         $ret = $course->toArray($param_array);
         $ret['sem_class'] = $course->getSemClass();
         $ret['start_semester'] = $course->start_semester->name;
         $ret['end_semester'] = $course->end_semester->name;
         $ret['obj_type'] = 'sem';
         $ret['last_visitdate'] = object_get_visit($course->id, 'sem', 'last');
         $ret['visitdate'] = object_get_visit($course->id, 'sem', '');
         $ret['user_status'] = $studygroups[$course->id]['status'];
         $ret['gruppe'] = $studygroups[$course->id]['gruppe'];
         $ret['modules'] = $modules->getLocalModules($course->id, 'sem', $course->modules, $course->status);
         MyRealmModel::getObjectValues($ret);
         return $ret;
     }, array_keys($studygroups));
     return $courses;
 }
开发者ID:ratbird,项目名称:hope,代码行数:25,代码来源:my_realm.php

示例10: explode

    object_set_visit($course_id, "sem");
}
// 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);
    $new_query = preg_replace('/[^:0-9a-z+_\\-.#?&=\\/]/i', '', $new_query);
    header('Location: ' . URLHelper::getURL($new_query, array('cid' => $course_id)));
    die;
}
$sem_class = Seminar::getInstance($course_id)->getSemClass();
if ($sem_class->getSlotModule("overview")) {
    foreach ($sem_class->getNavigationForSlot("overview") as $nav) {
        header('Location: ' . URLHelper::getURL($nav->getURL()));
        die;
    }
} else {
    $Modules = new Modules();
    $course_modules = $Modules->getLocalModules($course_id);
    if (!$course_modules['overview'] && !$sem_class->isSlotMandatory("overview")) {
        //Keine Übersichtsseite. Anstatt eines Fehler wird der Nutzer zum ersten
        //Reiter der Veranstaltung weiter geleitet.
        if (Navigation::hasItem("/course")) {
            foreach (Navigation::getItem("/course")->getSubNavigation() as $navigation) {
                header('Location: ' . URLHelper::getURL($navigation->getURL()));
                die;
            }
        }
    }
}
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:seminar_main.php


注:本文中的Modules::getLocalModules方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。