Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     $top = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array('view' => 'tiles'), "presenting/overview"));
     $top->setImage(Icon::create($this->getPluginURL() . "/assets/topicon.svg"));
     $overview = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "presenting/overview"));
     $top->addSubNavigation("presenting", $overview);
     $overview->addSubNavigation("overview", new AutoNavigation(_('Übersicht'), PluginEngine::getURL($this, array(), "presenting/overview")));
     $overview->addSubNavigation("all", new AutoNavigation(_('Alle Plugins'), PluginEngine::getURL($this, array(), "presenting/all")));
     $overview->addSubNavigation("tools", new AutoNavigation(_('Tools'), PluginEngine::getURL($this, array(), "tools/sidebar_graphics_generator")));
     if ($GLOBALS['perm']->have_perm("autor")) {
         $top->addSubNavigation("myplugins", new Navigation(_("Meine Plugins"), PluginEngine::getURL($this, array(), "myplugins/overview")));
     }
     if ($GLOBALS['perm']->have_perm("user")) {
         $last_visit = UserConfig::get($GLOBALS['user']->id)->getValue("last_pluginmarket_visit");
         if ($last_visit) {
             $badge_number = MarketPlugin::countBySql("publiclyvisible = 1 AND approved = 1 AND published > ?", array($last_visit));
             if ($badge_number > 0) {
                 $top->setBadgeNumber($badge_number);
             }
         }
     }
     if ($GLOBALS['perm']->have_perm("root")) {
         $approving = new Navigation(_("Qualitätssicherung"), PluginEngine::getURL($this, array(), "approving/overview"));
         $top->addSubNavigation("approving", $approving);
     }
     Navigation::addItem("/pluginmarket", $top);
     $loginlink = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "presenting/overview"));
     $loginlink->setDescription(_("Laden Sie hier Plugins für Ihr Stud.IP herunter"));
     Navigation::addItem("/login/pluginmarket", $loginlink);
     NotificationCenter::addObserver($this, "triggerFollowingStudips", "PluginReleaseDidUpdateCode");
 }
Exemplo n.º 2
0
 /**
  * Initialize the subnavigation of this item. This method
  * is called once before the first item is added or removed.
  */
 public function initSubNavigation()
 {
     parent::initSubNavigation();
     // browse courses
     $navigation = new Navigation(_('Veranstaltungen'), 'dispatch.php/search/courses');
     $navigation->addSubNavigation('all', new Navigation(_('Alle'), 'dispatch.php/search/courses?reset_all=TRUE', array('view' => 'all')));
     foreach ($GLOBALS['SEM_CLASS'] as $key => $val) {
         $navigation->addSubNavigation($key, new Navigation($val['name'], 'dispatch.php/search/courses?reset_all=TRUE&cmd=qs', array('view' => $key)));
     }
     $this->addSubNavigation('courses', $navigation);
     // search archive
     $navigation = new Navigation(_('Archiv'), 'archiv.php');
     $this->addSubNavigation('archive', $navigation);
     // search users
     $navigation = new Navigation(_('Personen'), 'browse.php');
     $this->addSubNavigation('users', $navigation);
     // browse institutes
     $navigation = new Navigation(_('Einrichtungen'), 'institut_browse.php');
     $this->addSubNavigation('institutes', $navigation);
     // browse resources
     if (get_config('RESOURCES_ENABLE')) {
         $navigation = new Navigation(_('Ressourcen'), 'resources.php', array('view' => 'search', 'reset' => 'TRUE'));
         $this->addSubNavigation('resources', $navigation);
     }
 }
Exemplo n.º 3
0
 /**
  * Initialize the subnavigation of this item. This method
  * is called once before the first item is added or removed.
  */
 public function initSubNavigation()
 {
     global $perm;
     parent::initSubNavigation();
     // online list
     $navigation = new Navigation(_('Wer ist online?'), 'dispatch.php/online');
     $this->addSubNavigation('online', $navigation);
     // contacts
     $navigation = new Navigation(_('Kontakte'), 'dispatch.php/contact');
     $this->addSubNavigation('contacts', $navigation);
     // study groups
     if (get_config('STUDYGROUPS_ENABLE')) {
         $navigation = new Navigation(_('Studiengruppen'));
         $navigation->addSubNavigation('browse', new Navigation(_('Studiengruppensuche'), 'dispatch.php/studygroup/browse'));
         $navigation->addSubNavigation('new', new Navigation(_('Neue Studiengruppe anlegen'), 'dispatch.php/course/wizard?studygroup=1'));
         if (Config::get()->MY_COURSES_ENABLE_STUDYGROUPS) {
             $navigation->addSubNavigation('index', new Navigation(_('Meine Studiengruppen'), 'dispatch.php/my_studygroups'));
         }
         $this->addSubNavigation('studygroups', $navigation);
     }
     // ranking
     if (get_config('SCORE_ENABLE')) {
         $navigation = new Navigation(_('Rangliste'), 'dispatch.php/score');
         $this->addSubNavigation('score', $navigation);
     }
 }
Exemplo n.º 4
0
 /**
  * Initialize the subnavigation of this item. This method
  * is called once before the first item is added or removed.
  */
 public function initSubNavigation()
 {
     global $user, $perm;
     parent::initSubNavigation();
     $sem_create_perm = in_array(get_config('SEM_CREATE_PERM'), array('root', 'admin', 'dozent')) ? get_config('SEM_CREATE_PERM') : 'dozent';
     // my courses
     if (is_object($user) && $user->id != 'nobody') {
         if ($perm->have_perm('admin')) {
             $navigation = new Navigation(_('Administration'));
         } else {
             $navigation = new Navigation(_('Meine Veranstaltungen'));
         }
         $navigation->addSubNavigation('list', new Navigation($perm->have_perm('admin') ? _('Veranstaltungsadministration') : _('Aktuelle Veranstaltungen'), 'dispatch.php/my_courses'));
         if ($perm->have_perm('admin')) {
             if ($GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT != 'all') {
                 $navigation->addSubNavigation('schedule', new Navigation(_('Veranstaltungs-Stundenplan'), 'dispatch.php/calendar/instschedule?cid=' . $GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT));
             }
         } else {
             $navigation->addSubNavigation('archive', new Navigation(_('Archivierte Veranstaltungen'), 'dispatch.php/my_courses/archive'));
         }
         $this->addSubNavigation('my_courses', $navigation);
         if (Config::get()->MY_COURSES_ENABLE_STUDYGROUPS && !$GLOBALS['perm']->have_perm('admin')) {
             $navigation = new Navigation(_('Meine Studiengruppen'), 'dispatch.php/my_studygroups');
             $navigation->addSubNavigation('index', new Navigation(_('Meine Studiengruppen'), 'dispatch.php/my_studygroups'));
             $navigation->addSubNavigation('all', new Navigation(_('Studiengruppensuche'), 'dispatch.php/studygroup/browse'));
             $navigation->addSubNavigation('new', new Navigation(_('Neue Studiengruppe anlegen'), 'dispatch.php/course/wizard?studygroup=1'));
             $this->addSubNavigation('my_studygroups', $navigation);
         }
         if (!$perm->have_perm('admin')) {
             $navigation = new Navigation(_('Meine Einrichtungen'), 'dispatch.php/my_institutes');
             $this->addSubNavigation('my_institutes', $navigation);
         }
     }
 }
Exemplo n.º 5
0
 function getTabNavigation($course_id)
 {
     $navigation = new Navigation(_('Dateien'));
     $navigation->setImage(Icon::create('files', 'info_alt'));
     $navigation->setActiveImage(Icon::create('files', 'info'));
     $navigation->addSubNavigation('tree', new Navigation(_('Ordneransicht'), "folder.php?cmd=tree"));
     $navigation->addSubNavigation('all', new Navigation(_('Alle Dateien'), "folder.php?cmd=all"));
     return array('files' => $navigation);
 }
Exemplo n.º 6
0
 /**
  * Initialize the subnavigation of this item. This method
  * is called once before the first item is added or removed.
  */
 public function initSubNavigation()
 {
     parent::initSubNavigation();
     $messages = new Navigation(_('Nachrichten'), 'dispatch.php/messages/overview');
     $inbox = new Navigation(_('Eingang'), 'dispatch.php/messages/overview');
     $messages->addSubNavigation('inbox', $inbox);
     $messages->addSubNavigation('sent', new Navigation(_('Gesendet'), 'dispatch.php/messages/sent'));
     $this->addSubNavigation('messages', $messages);
 }
Exemplo n.º 7
0
 function getTabNavigation($course_id)
 {
     if (get_config('WIKI_ENABLE')) {
         $navigation = new Navigation(_('Wiki'));
         $navigation->setImage(Icon::create('wiki', 'info_alt'));
         $navigation->setActiveImage(Icon::create('wiki', 'info'));
         $navigation->addSubNavigation('show', new Navigation(_('WikiWikiWeb'), 'wiki.php?view=show'));
         $navigation->addSubNavigation('listnew', new Navigation(_('Neue Seiten'), 'wiki.php?view=listnew'));
         $navigation->addSubNavigation('listall', new Navigation(_('Alle Seiten'), 'wiki.php?view=listall'));
         return array('wiki' => $navigation);
     } else {
         return null;
     }
 }
Exemplo n.º 8
0
 function getTabNavigation($course_id)
 {
     // cmd und open_close_id mit durchziehen, damit geöffnete Termine geöffnet bleiben
     $req = Request::getInstance();
     $openItem = '';
     if (isset($req['cmd']) && isset($req['open_close_id'])) {
         $openItem = '&cmd=' . $req['cmd'] . '&open_close_id=' . $req['open_close_id'];
     }
     $navigation = new Navigation(_('Ablaufplan'));
     $navigation->setImage(Icon::create('schedule', 'info_alt'));
     $navigation->setActiveImage(Icon::create('schedule', 'info'));
     $navigation->addSubNavigation('dates', new Navigation(_('Termine'), "dispatch.php/course/dates"));
     $navigation->addSubNavigation('topics', new Navigation(_('Themen'), "dispatch.php/course/topics"));
     return array('schedule' => $navigation);
 }
Exemplo n.º 9
0
 function getTabNavigation($course_id)
 {
     #$navigation = new AutoNavigation(_('Teilnehmende'));
     $navigation = new Navigation(_('Teilnehmende'));
     $navigation->setImage(Icon::create('persons', 'info_alt'));
     $navigation->setActiveImage(Icon::create('persons', 'info'));
     $navigation->addSubNavigation('view', new Navigation(_('Teilnehmende'), 'dispatch.php/course/members'));
     if (Course::find($course_id)->aux_lock_rule) {
         $navigation->addSubNavigation('additional', new Navigation(_('Zusatzangaben'), 'dispatch.php/course/members/additional'));
     }
     $navigation->addSubNavigation('view_groups', new Navigation(_('Funktionen / Gruppen'), 'statusgruppen.php?view=statusgruppe_sem'));
     if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id) && !LockRules::check($course_id, 'groups')) {
         $navigation->addSubNavigation('edit_groups', new Navigation(_('Funktionen / Gruppen verwalten'), 'admin_statusgruppe.php?new_sem=TRUE&range_id=' . $course_id));
     }
     return array('members' => $navigation);
 }
Exemplo n.º 10
0
 function getTabNavigation($course_id)
 {
     if (get_config('RESOURCES_ENABLE') && checkAvailableResources($course_id)) {
         $navigation = new Navigation(_('Ressourcen'), 'resources.php?view=openobject_main&view_mode=oobj');
         $navigation->setImage(Icon::create('resources', 'info_alt'));
         $navigation->setActiveImage(Icon::create('resources', 'info'));
         $navigation->addSubNavigation('overview', new Navigation(_('Übersicht'), 'resources.php?view=openobject_main'));
         $navigation->addSubNavigation('group_schedule', new Navigation(_('Übersicht Belegung'), 'resources.php?view=openobject_group_schedule'));
         $navigation->addSubNavigation('view_details', new Navigation(_('Details'), 'resources.php?view=openobject_details'));
         $navigation->addSubNavigation('view_schedule', new Navigation(_('Belegung'), 'resources.php?view=openobject_schedule'));
         $navigation->addSubNavigation('edit_assign', new Navigation(_('Belegungen bearbeiten'), 'resources.php?view=openobject_assign'));
         return array('resources' => $navigation);
     } else {
         return null;
     }
 }
Exemplo n.º 11
0
 public function testNavigation()
 {
     $navigation = new Navigation('test');
     $nav1 = new Navigation('foo', NULL);
     $nav2 = new Navigation('bar', 'bar.php');
     $nav3 = new Navigation('baz', 'baz.php');
     $nav4 = new Navigation('egg', 'egg.php');
     $this->assertNull($navigation->getURL());
     $this->assertEquals(array(), $navigation->getSubNavigation());
     $navigation->addSubNavigation('a1', $nav1);
     $navigation->addSubNavigation('a2', $nav2);
     $navigation->addSubNavigation('a3', $nav3);
     $nav2->addSubNavigation('b1', $nav4);
     $this->assertFalse($navigation->isActive());
     $this->assertEquals('bar.php', $navigation->getURL());
     $this->assertEquals(array('a1' => $nav1, 'a2' => $nav2, 'a3' => $nav3), $navigation->getSubNavigation());
     $nav4->setActive(true);
     $this->assertTrue($navigation->isActive());
     $this->assertSame($navigation->activeSubNavigation(), $nav2);
     $this->assertSame($nav2->activeSubNavigation(), $nav4);
     $navigation->removeSubNavigation('a3');
     $navigation->insertSubNavigation('a3', $nav3, 'a2');
     $navigation->removeSubNavigation('a1');
     $nav2->insertSubNavigation('a1', $nav1, '');
     $this->assertEquals('baz.php', $navigation->getURL());
     $this->assertEquals(array('a3' => $nav3, 'a2' => $nav2), $navigation->getSubNavigation());
     $this->assertEquals(array('b1' => $nav4, 'a1' => $nav1), $nav2->getSubNavigation());
 }
Exemplo n.º 12
0
 function getTabNavigation($course_id)
 {
     if (get_config('LITERATURE_ENABLE')) {
         $object_type = get_object_type($course_id);
         $navigation = new Navigation(_('Literatur'));
         $navigation->setImage(Icon::create('literature', 'info_alt'));
         $navigation->setActiveImage(Icon::create('literature', 'info'));
         $navigation->addSubNavigation('view', new Navigation(_('Literatur'), "dispatch.php/course/literature?view=literatur_" . $object_type));
         if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id)) {
             $navigation->addSubNavigation('edit', new Navigation(_('Literatur bearbeiten'), 'dispatch.php/literature/edit_list?view=literatur_' . $object_type . '&new_' . $object_type . '=TRUE&_range_id=' . $course_id));
             $navigation->addSubNavigation('search', new Navigation(_('Literatur suchen'), 'dispatch.php/literature/search?return_range=' . $course_id));
         }
         return array('literature' => $navigation);
     } else {
         return null;
     }
 }
Exemplo n.º 13
0
 function getTabNavigation($course_id)
 {
     $object_type = get_object_type($course_id, array('sem', 'inst'));
     if ($object_type === 'sem') {
         $course = Course::find($course_id);
         $sem_class = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$course->status]['class']] ?: SemClass::getDefaultSemClass();
     } else {
         $institute = Institute::find($course_id);
         $sem_class = SemClass::getDefaultInstituteClass($institute->type);
     }
     $navigation = new Navigation(_('Übersicht'));
     $navigation->setImage(Icon::create('seminar', 'info_alt'));
     $navigation->setActiveImage(Icon::create('seminar', 'info'));
     if ($object_type !== 'sem') {
         $navigation->addSubNavigation('info', new Navigation(_('Kurzinfo'), 'dispatch.php/institute/overview'));
         $navigation->addSubNavigation('courses', new Navigation(_('Veranstaltungen'), 'show_bereich.php?level=s&id=' . $course_id));
         $navigation->addSubNavigation('schedule', new Navigation(_('Veranstaltungs-Stundenplan'), 'dispatch.php/calendar/instschedule?cid=' . $course_id));
         if ($GLOBALS['perm']->have_studip_perm('admin', $course_id)) {
             $navigation->addSubNavigation('admin', new Navigation(_('Administration der Einrichtung'), 'dispatch.php/institute/basicdata/index?new_inst=TRUE'));
         }
     } else {
         $navigation->addSubNavigation('info', new Navigation(_('Kurzinfo'), 'dispatch.php/course/overview'));
         if (!$sem_class['studygroup_mode']) {
             $navigation->addSubNavigation('details', new Navigation(_('Details'), 'dispatch.php/course/details/'));
         }
         if (!$course->admission_binding && in_array($GLOBALS['perm']->get_studip_perm($course_id), array('user', 'autor'))) {
             $navigation->addSubNavigation('leave', new Navigation(_('Austragen aus der Veranstaltung'), 'dispatch.php/my_courses/decline/' . $course_id . '?cmd=suppose_to_kill'));
         }
     }
     return array('main' => $navigation);
 }
Exemplo n.º 14
0
 function getTabNavigation($course_id)
 {
     if (get_config('ELEARNING_INTERFACE_ENABLE')) {
         $navigation = new Navigation(_('Lernmodule'));
         $navigation->setImage(Icon::create('learnmodule', 'info_alt'));
         $navigation->setActiveImage(Icon::create('learnmodule', 'info'));
         if (ObjectConnections::isConnected($course_id)) {
             $elearning_nav = new Navigation(_('Lernmodule dieser Veranstaltung'), 'dispatch.php/course/elearning/show?seminar_id=' . $course_id);
             if ($sem_class == 'inst') {
                 $elearning_nav->setTitle(_('Lernmodule dieser Einrichtung'));
             }
             $navigation->addSubNavigation('show', $elearning_nav);
         }
         if ($GLOBALS['perm']->have_studip_perm('tutor', $_SESSION['SessionSeminar'])) {
             $navigation->addSubNavigation('edit', new Navigation(_('Lernmodule hinzufügen / entfernen'), 'dispatch.php/course/elearning/edit?seminar_id=' . $course_id));
         }
         return array('elearning' => $navigation);
     } else {
         return null;
     }
 }
Exemplo n.º 15
0
 public function getTabNavigation($course_id)
 {
     if (!$this->isActivated($course_id)) {
         return;
     }
     $this->setupAutoload();
     $navigation = new Navigation(_('Forum'), PluginEngine::getURL($this, array(), 'index'));
     $navigation->setImage(Icon::create('forum', 'info_alt'));
     // add main third-level navigation-item
     $navigation->addSubNavigation('index', new Navigation(_('Übersicht'), PluginEngine::getURL($this, array(), 'index')));
     if (ForumPerm::has('fav_entry', $course_id)) {
         $navigation->addSubNavigation('newest', new Navigation(_("Neue Beiträge"), PluginEngine::getURL($this, array(), 'index/newest')));
         $navigation->addSubNavigation('latest', new Navigation(_("Letzte Beiträge"), PluginEngine::getURL($this, array(), 'index/latest')));
         $navigation->addSubNavigation('favorites', new Navigation(_('Gemerkte Beiträge'), PluginEngine::getURL($this, array(), 'index/favorites')));
         // mass-administrate the forum
         if (ForumPerm::has('admin', $course_id)) {
             $navigation->addSubNavigation('admin', new Navigation(_('Administration'), PluginEngine::getURL($this, array(), 'admin')));
         }
     }
     return array('forum2' => $navigation);
 }
Exemplo n.º 16
0
 private function setupNavigation()
 {
     global $perm;
     $cid = $this->getContext();
     if (Request::isXhr() || Navigation::hasItem('/course/cliqr') || !$this->isActivated($cid) || !$perm->have_studip_perm("tutor", $cid)) {
         return;
     }
     # /course/cliqr -> plugins.php/cliqrplugin/questions
     $url = PluginEngine::getURL('cliqrplugin', compact('cid'), 'questions', true);
     $navigation = new Navigation(_('Cliqr'), $url);
     $navigation->setImage(Assets::image_path('icons/16/white/test.png'));
     $navigation->setActiveImage(Assets::image_path('icons/16/black/test.png'));
     # /course/cliqr/index -> plugins.php/cliqrplugin/questions#index
     $navigation->addSubNavigation("index", new Navigation(_("Fragen"), $url . '#index'));
     # /course/cliqr/new -> plugins.php/cliqrplugin/questions#new
     $navigation->addSubNavigation("new", new Navigation(_("Frage erstellen"), $url . '#new'));
     # /course/cliqr/help -> plugins.php/cliqrplugin/help
     $url = PluginEngine::getURL('cliqrplugin', compact('cid'), 'help', true);
     $navigation->addSubNavigation("help", new Navigation(_("Methodische Informationen"), $url));
     Navigation::addItem('/course/cliqr', $navigation);
 }
Exemplo n.º 17
0
 function getTabNavigation($course_id)
 {
     if ($GLOBALS['perm']->have_studip_perm('dozent', $course_id)) {
         $navigation = new Navigation(_('Verwaltung'));
         $navigation->setImage(Icon::create('admin', 'info_alt'));
         $navigation->setActiveImage(Icon::create('admin', 'info'));
         $navigation->addSubNavigation('main', new Navigation(_('Verwaltung'), 'dispatch.php/course/studygroup/edit/' . $course_id));
         $navigation->addSubNavigation('avatar', new Navigation(_('Infobild'), 'dispatch.php/course/avatar/update/' . $course_id));
         if (!$GLOBALS['perm']->have_perm('admin')) {
             if (get_config('VOTE_ENABLE')) {
                 $item = new Navigation(_('Umfragen und Tests'), 'admin_vote.php?view=vote_sem');
                 $item->setDescription(_('Erstellen und bearbeiten Sie einfache Umfragen und Tests.'));
                 $navigation->addSubNavigation('vote', $item);
                 $item = new Navigation(_('Evaluationen'), 'admin_evaluation.php?view=eval_sem');
                 $item->setDescription(_('Richten Sie fragebogenbasierte Umfragen und Lehrevaluationen ein.'));
                 $navigation->addSubNavigation('evaluation', $item);
             }
         }
         return array('admin' => $navigation);
     } else {
         return array();
     }
 }
Exemplo n.º 18
0
 function getTabNavigation($course_id)
 {
     if (get_config('SCM_ENABLE')) {
         $temp = StudipScmEntry::findByRange_id($course_id, 'ORDER BY position ASC');
         $scms = SimpleORMapCollection::createFromArray($temp);
         $navigation = new Navigation($scms->first()->tab_name ?: _('Informationen'));
         $navigation->setImage(Icon::create('infopage', 'info_alt'));
         $navigation->setActiveImage(Icon::create('infopage', 'info'));
         foreach ($scms as $scm) {
             $scm_link = 'dispatch.php/course/scm/' . $scm->id;
             $nav = new Navigation($scm['tab_name'], $scm_link);
             $navigation->addSubNavigation($scm->id, $nav);
         }
         return array('scm' => $navigation);
     } else {
         return null;
     }
 }
Exemplo n.º 19
0
 /**
  * Constructor of Plugin : adds Navigation and collects information for javascript-update.
  */
 public function __construct()
 {
     parent::__construct();
     if (UpdateInformation::isCollecting()) {
         $data = Request::getArray("page_info");
         if (stripos(Request::get("page"), "plugins.php/blubber") !== false && isset($data['Blubber'])) {
             $output = array();
             switch ($data['Blubber']['stream']) {
                 case "global":
                     $stream = BlubberStream::getGlobalStream();
                     break;
                 case "course":
                     $stream = BlubberStream::getCourseStream($data['Blubber']['context_id']);
                     break;
                 case "profile":
                     $stream = BlubberStream::getProfileStream($data['Blubber']['context_id']);
                     break;
                 case "thread":
                     $stream = BlubberStream::getThreadStream($data['Blubber']['context_id']);
                     break;
                 case "custom":
                     $stream = new BlubberStream($data['Blubber']['context_id']);
                     break;
             }
             $last_check = $data['Blubber']['last_check'] ? $data['Blubber']['last_check'] : time() - 5 * 60;
             $new_postings = $stream->fetchNewPostings($last_check);
             $factory = new Flexi_TemplateFactory($this->getPluginPath() . "/views");
             foreach ($new_postings as $new_posting) {
                 if ($new_posting['root_id'] === $new_posting['topic_id']) {
                     $thread = $new_posting;
                     $template = $factory->open("streams/thread.php");
                     $template->set_attribute('thread', $new_posting);
                 } else {
                     $thread = new BlubberPosting($new_posting['root_id']);
                     $template = $factory->open("streams/comment.php");
                     $template->set_attribute('posting', $new_posting);
                 }
                 BlubberPosting::$course_hashes = $thread['user_id'] !== $thread['Seminar_id'] ? $thread['Seminar_id'] : false;
                 $template->set_attribute("course_id", $data['Blubber']['seminar_id']);
                 $output['postings'][] = array('posting_id' => $new_posting['topic_id'], 'discussion_time' => $new_posting['discussion_time'], 'mkdate' => $new_posting['mkdate'], 'root_id' => $new_posting['root_id'], 'content' => $template->render());
             }
             UpdateInformation::setInformation("Blubber.getNewPosts", $output);
             //Events-Queue:
             $db = DBManager::get();
             $events = $db->query("SELECT event_type, item_id " . "FROM blubber_events_queue " . "WHERE mkdate >= " . $db->quote($last_check) . " " . "ORDER BY mkdate ASC " . "")->fetchAll(PDO::FETCH_ASSOC);
             UpdateInformation::setInformation("Blubber.blubberEvents", $events);
             $db->exec("DELETE FROM blubber_events_queue " . "WHERE mkdate < UNIX_TIMESTAMP() - 60 * 60 * 6 " . "");
         }
     }
     if (Navigation::hasItem("/community")) {
         $nav = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "streams/global"));
         $nav->addSubNavigation("global", new AutoNavigation(_("Globaler Stream"), PluginEngine::getURL($this, array(), "streams/global")));
         foreach (BlubberStream::findMine() as $stream) {
             $url = PluginEngine::getURL($this, array(), "streams/custom/" . $stream->getId());
             $nav->addSubNavigation($stream->getId(), new AutoNavigation($stream['name'], $url));
             if ($stream['defaultstream']) {
                 $nav->setURL($url);
             }
         }
         $nav->addSubNavigation("add", new AutoNavigation(_("Neuen Stream erstellen"), PluginEngine::getURL($this, array(), "streams/edit")));
         Navigation::insertItem("/community/blubber", $nav, "online");
         Navigation::getItem("/community")->setURL($nav->getURL());
     }
     if (Navigation::hasItem("/profile") && $this->isActivated(get_userid(Request::username('username', $GLOBALS['auth']->auth['uname'])), 'user')) {
         $nav = new AutoNavigation(_("Blubber"), PluginEngine::getURL($this, array('user_id' => get_userid(Request::get("username"))), "streams/profile"));
         Navigation::addItem("/profile/blubber", $nav);
     }
 }
Exemplo n.º 20
0
 /**
  * Initialize the subnavigation of this item. This method
  * is called once before the first item is added or removed.
  */
 public function initSubNavigation()
 {
     global $user, $perm;
     parent::initSubNavigation();
     $username = Request::username('username', $user->username);
     $current_user = $username == $user->username ? $user : User::findByUsername($username);
     // profile
     $navigation = new Navigation(_('Profil'), 'dispatch.php/profile/index');
     $this->addSubNavigation('index', $navigation);
     if ($perm->have_profile_perm('user', $current_user->user_id)) {
         // avatar
         $navigation = new Navigation(_('Bild'), 'dispatch.php/settings/avatar');
         $this->addSubNavigation('avatar', $navigation);
         // profile data
         $navigation = new Navigation(_('Nutzerdaten'));
         $navigation->addSubNavigation('profile', new Navigation(_('Grunddaten'), 'dispatch.php/settings/account'));
         if (($perm->get_profile_perm($current_user->user_id) == 'user' || $perm->have_perm('root') && Config::get()->ALLOW_ADMIN_USERACCESS) && !StudipAuthAbstract::CheckField('auth_user_md5.password', $current_user->auth_plugin) && !LockRules::check($current_user->user_id, 'password')) {
             $navigation->addSubNavigation('password', new Navigation(_('Passwort ändern'), 'dispatch.php/settings/password'));
         }
         $navigation->addSubNavigation('details', new Navigation(_('Weitere Daten'), 'dispatch.php/settings/details'));
         if (!in_array($current_user->perms, words('user admin root'))) {
             $navigation->addSubNavigation('studies', new Navigation(_('Studiendaten'), 'dispatch.php/settings/studies'));
         }
         if ($current_user->perms != 'root') {
             if (count(UserDomain::getUserDomains())) {
                 $navigation->addSubNavigation('userdomains', new Navigation(_('Nutzerdomänen'), 'dispatch.php/settings/userdomains'));
             }
             if ($perm->is_staff_member($current_user->user_id)) {
                 $navigation->addSubNavigation('statusgruppen', new Navigation(_('Einrichtungsdaten'), 'dispatch.php/settings/statusgruppen'));
             }
         }
         $this->addSubNavigation('edit', $navigation);
         if ($perm->have_perm('autor')) {
             $navigation = new Navigation(_('Einstellungen'));
             $navigation->addSubNavigation('general', new Navigation(_('Allgemeines'), 'dispatch.php/settings/general'));
             $navigation->addSubNavigation('privacy', new Navigation(_('Privatsphäre'), 'dispatch.php/settings/privacy'));
             $navigation->addSubNavigation('messaging', new Navigation(_('Nachrichten'), 'dispatch.php/settings/messaging'));
             if (get_config('CALENDAR_ENABLE')) {
                 $navigation->addSubNavigation('calendar_new', new Navigation(_('Terminkalender'), 'dispatch.php/settings/calendar'));
             }
             if (!$perm->have_perm('admin') and get_config('MAIL_NOTIFICATION_ENABLE')) {
                 $navigation->addSubNavigation('notification', new Navigation(_('Benachrichtigung'), 'dispatch.php/settings/notification'));
             }
             if (isDefaultDeputyActivated() && $perm->get_perm() == 'dozent') {
                 $navigation->addSubNavigation('deputies', new Navigation(_('Standardvertretung'), 'dispatch.php/settings/deputies'));
             }
             if (Config::Get()->API_ENABLED) {
                 $navigation->addSubNavigation('api', new Navigation(_('API-Berechtigungen'), 'dispatch.php/api/authorizations'));
             }
             $this->addSubNavigation('settings', $navigation);
         }
         // user defined sections
         $navigation = new Navigation(_('Kategorien'), 'dispatch.php/settings/categories');
         $this->addSubNavigation('categories', $navigation);
     }
     // user documents page
     if (Config::get()->PERSONALDOCUMENT_ENABLE && ($perm->have_profile_perm('user', $current_user->user_id) || Config::get()->PERSONALDOCUMENT_OPEN_ACCESS)) {
         $title = _('Meine Dateien');
         if (Config::get()->PERSONALDOCUMENT_OPEN_ACCESS && $current_user->id !== $user->id) {
             $title = _('Dateibereich');
         }
         $navigation = new Navigation($title, 'dispatch.php/document/files');
         $this->addSubNavigation('files', $navigation);
     }
 }
Exemplo n.º 21
0
 function getTabNavigation($course_id)
 {
     $sem_create_perm = in_array(get_config('SEM_CREATE_PERM'), array('root', 'admin', 'dozent')) ? get_config('SEM_CREATE_PERM') : 'dozent';
     if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id)) {
         $navigation = new Navigation(_('Verwaltung'));
         $navigation->setImage(Icon::create('admin', 'info_alt'));
         $navigation->setActiveImage(Icon::create('admin', 'info'));
         $main = new Navigation(_('Verwaltung'), 'dispatch.php/course/management');
         $navigation->addSubNavigation('main', $main);
         if ($GLOBALS['SessSemName']['class'] !== "inst") {
             $item = new Navigation(_('Grunddaten'), 'dispatch.php/course/basicdata/view/' . $course_id);
             $item->setImage(Icon::create('edit', 'clickable'));
             $item->setDescription(_('Bearbeiten der Grundeinstellungen dieser Veranstaltung.'));
             $navigation->addSubNavigation('details', $item);
             $item = new Navigation(_('Infobild'), 'dispatch.php/course/avatar/update/' . $course_id);
             $item->setImage(Icon::create('file-pic', 'clickable'));
             $item->setDescription(_('Infobild dieser Veranstaltung bearbeiten oder löschen.'));
             $navigation->addSubNavigation('avatar', $item);
             $item = new Navigation(_('Studienbereiche'), 'dispatch.php/course/study_areas/show/' . $course_id);
             $item->setImage(Icon::create('module', 'clickable'));
             $item->setDescription(_('Zuordnung dieser Veranstaltung zu Studienbereichen für die Darstellung im Verzeichnis aller Veranstaltungen.'));
             $navigation->addSubNavigation('study_areas', $item);
             $item = new Navigation(_('Zeiten/Räume'), 'dispatch.php/course/timesrooms');
             $item->setImage(Icon::create('date', 'clickable'));
             $item->setDescription(_('Regelmäßige Veranstaltungszeiten, Einzeltermine und Ortsangaben ändern.'));
             $navigation->addSubNavigation('dates', $item);
             if (get_config('RESOURCES_ENABLE') && get_config('RESOURCES_ALLOW_ROOM_REQUESTS')) {
                 $item = new Navigation(_('Raumanfragen'), 'dispatch.php/course/room_requests/index/' . $course_id);
                 $item->setImage(Icon::create('resources', 'clickable'));
                 $item->setDescription(_('Raumanfragen zu Veranstaltungszeiten verwalten.'));
                 $navigation->addSubNavigation('room_requests', $item);
             }
             $item = new Navigation(_('Zugangsberechtigungen'), 'dispatch.php/course/admission');
             $item->setImage(Icon::create('lock-locked', 'clickable'));
             $item->setDescription(_('Zugangsbeschränkungen, Anmeldeverfahren oder einen Passwortschutz für diese Veranstaltung einrichten.'));
             $navigation->addSubNavigation('admission', $item);
             $item = new AutoNavigation(_('Zusatzangaben'), 'dispatch.php/admin/additional');
             $item->setImage(Icon::create('add', 'clickable'));
             $item->setDescription(_('Vorlagen zur Erhebung weiterer Angaben von Teilnehmenden auswählen.'));
             $navigation->addSubNavigation('additional_data', $item);
             if ($GLOBALS['perm']->have_perm($sem_create_perm)) {
                 if (!LockRules::check($course_id, 'seminar_copy')) {
                     $item = new Navigation(_('Veranstaltung kopieren'), 'dispatch.php/course/wizard/copy/' . $course_id);
                     $item->setImage(Icon::create('seminar+add', 'clickable'));
                     $main->addSubNavigation('copy', $item);
                 }
                 if (get_config('ALLOW_DOZENT_ARCHIV') || $GLOBALS['perm']->have_perm('admin')) {
                     $item = new Navigation(_('Veranstaltung archivieren'), 'archiv_assi.php');
                     $item->setImage(Icon::create('seminar+remove', 'clickable'));
                     $main->addSubNavigation('archive', $item);
                 }
                 if ((get_config('ALLOW_DOZENT_VISIBILITY') || $GLOBALS['perm']->have_perm('admin')) && !LockRules::Check($course_id, 'seminar_visibility')) {
                     $is_visible = Course::findCurrent()->visible;
                     $item = new Navigation(_('Sichtbarkeit ändern') . ' (' . ($is_visible ? _('sichtbar') : _('unsichtbar')) . ')', 'dispatch.php/course/management/change_visibility');
                     $item->setImage(Icon::create('visibility-' . ($is_visible ? 'visible' : 'invisible'), 'clickable'));
                     $main->addSubNavigation('visibility', $item);
                 }
                 if ($GLOBALS['perm']->have_perm('admin')) {
                     $is_locked = Course::findCurrent()->lock_rule;
                     $item = new Navigation(_('Sperrebene ändern') . ' (' . ($is_locked ? _('gesperrt') : _('nicht gesperrt')) . ')', 'dispatch.php/course/management/lock');
                     $item->setImage(Icon::create('lock-' . ($is_locked ? 'locked' : 'unlocked'), 'clickable'), ['data-dialog' => 'size=auto']);
                     $main->addSubNavigation('lock', $item);
                 }
             }
             // show entry for simulated participant view
             if (in_array($GLOBALS['perm']->get_studip_perm($course_id), words('tutor dozent'))) {
                 $item = new Navigation('Studierendenansicht simulieren', 'dispatch.php/course/change_view?cid=' . Request::option('cid'));
                 $item->setDescription(_('Hier können Sie sich die Veranstaltung aus der Sicht von Studierenden sehen.'));
                 $item->setImage(Icon::create('visibility-invisible', 'clickable'));
                 $main->addSubNavigation('change_view', $item);
             }
         }
         // endif modules only seminars
         if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id)) {
             if (get_config('VOTE_ENABLE')) {
                 $item = new Navigation(_('Umfragen und Tests'), 'admin_vote.php?view=vote_sem');
                 $item->setImage(Icon::create('vote', 'clickable'));
                 $item->setDescription(_('Erstellen und bearbeiten von einfachen Umfragen und Tests.'));
                 $navigation->addSubNavigation('vote', $item);
                 $item = new Navigation(_('Evaluationen'), 'admin_evaluation.php?view=eval_sem');
                 $item->setImage(Icon::create('evaluation', 'clickable'));
                 $item->setDescription(_('Richten Sie fragebogenbasierte Umfragen und Lehrevaluationen ein.'));
                 $navigation->addSubNavigation('evaluation', $item);
             }
         }
         return array('admin' => $navigation);
     } else {
         return array();
     }
 }
Exemplo n.º 22
0
 /**
  * Initialize the subnavigation of this item. This method
  * is called once before the first item is added or removed.
  */
 public function initSubNavigation()
 {
     global $perm, $auth;
     $username = $auth->auth['uname'];
     parent::initSubNavigation();
     if (!$perm->have_perm('user')) {
         return;
     }
     $sem_create_perm = in_array(get_config('SEM_CREATE_PERM'), array('root', 'admin', 'dozent')) ? get_config('SEM_CREATE_PERM') : 'dozent';
     // my courses
     if ($perm->have_perm('root')) {
         $navigation = new Navigation(_('Veranstaltungsübersicht'), 'dispatch.php/search/courses');
     } else {
         if ($perm->have_perm('admin')) {
             $navigation = new Navigation(_('Veranstaltungen an meinen Einrichtungen'), 'dispatch.php/my_courses');
         } else {
             $navigation = new Navigation(_('Meine Veranstaltungen'), 'dispatch.php/my_courses');
             if (!$perm->have_perm('dozent')) {
                 $navigation->addSubNavigation('browse', new Navigation(_('Veranstaltung hinzufügen'), 'dispatch.php/search/courses'));
                 if ($perm->have_perm('autor') && get_config('STUDYGROUPS_ENABLE')) {
                     $navigation->addSubNavigation('new_studygroup', new Navigation(_('Studiengruppe anlegen'), 'dispatch.php/course/wizard?studygroup=1'));
                 }
             } else {
                 if ($perm->have_perm($sem_create_perm)) {
                     $navigation->addSubNavigation('new_course', new Navigation(_('Neue Veranstaltung anlegen'), 'dispatch.php/course/wizard'));
                 }
                 if (get_config('STUDYGROUPS_ENABLE')) {
                     $navigation->addSubNavigation('new_studygroup', new Navigation(_('Studiengruppe anlegen'), 'dispatch.php/course/wizard?studygroup=1'));
                 }
             }
         }
     }
     $this->addSubNavigation('my_courses', $navigation);
     // course administration
     if ($perm->have_perm('admin')) {
         $navigation = new Navigation(_('Verwaltung von Veranstaltungen'), 'dispatch.php/my_courses');
         if ($perm->have_perm($sem_create_perm)) {
             $navigation->addSubNavigation('new_course', new Navigation(_('Neue Veranstaltung anlegen'), 'dispatch.php/course/wizard'));
         }
         if (get_config('STUDYGROUPS_ENABLE')) {
             $navigation->addSubNavigation('new_studygroup', new Navigation(_('Studiengruppe anlegen'), 'dispatch.php/course/wizard?studygroup=1'));
         }
         $this->addSubNavigation('admin_course', $navigation);
     }
     // insitute administration
     if ($perm->have_perm('admin')) {
         $navigation = new Navigation(_('Verwaltung von Einrichtungen'), 'dispatch.php/institute/basicdata/index?list=TRUE');
         $this->addSubNavigation('admin_inst', $navigation);
     }
     // user administration
     if ($perm->have_perm('root')) {
         $navigation = new Navigation(_('Verwaltung globaler Einstellungen'), 'admin_range_tree.php');
         $this->addSubNavigation('admin_user', $navigation);
     } else {
         if ($perm->have_perm('admin') && !get_config('RESTRICTED_USER_MANAGEMENT')) {
             $navigation = new Navigation(_('Globale Benutzerverwaltung'), 'dispatch.php/admin/user/');
             $this->addSubNavigation('admin_user', $navigation);
         }
     }
     // plugin and role administration
     if ($perm->have_perm('root')) {
         $navigation = new Navigation(_('Verwaltung von Plugins'), 'dispatch.php/admin/plugin');
         $navigation->addSubNavigation('admin_roles', new Navigation(_('Verwaltung von Rollen'), 'dispatch.php/admin/role'));
         $this->addSubNavigation('admin_plugins', $navigation);
     }
     // administration of ressources
     if ($perm->have_perm('admin')) {
         if (get_config('RESOURCES_ENABLE')) {
             $navigation = new Navigation(_('Verwaltung von Ressourcen'));
             $navigation->addSubNavigation('hierarchy', new Navigation(_('Struktur'), 'resources.php#a', array('view' => 'resources')));
             if ($perm->have_perm('admin') && get_config('RESOURCES_ALLOW_ROOM_REQUESTS')) {
                 if (getGlobalPerms($GLOBALS['user']->id) !== 'admin') {
                     $resList = new ResourcesUserRoomsList($GLOBALS['user']->id, false, false);
                     $show_roomplanning = $resList->roomsExist();
                 } else {
                     $show_roomplanning = true;
                 }
                 if ($show_roomplanning) {
                     $navigation->addSubNavigation('start_planning', new Navigation(_('Raumplanung'), 'resources.php?cancel_edit_request_x=1', array('view' => 'requests_start')));
                 }
             }
             if (getGlobalPerms($GLOBALS['user']->id) == 'admin') {
                 $navigation->addSubNavigation('edit_types', new Navigation(_('Anpassen'), 'resources.php', array('view' => 'edit_types')));
             }
             $this->addSubNavigation('ressources', $navigation);
         }
     }
     // messaging
     $navigation = new Navigation(_('Nachrichten'));
     $navigation->addSubNavigation('in', new Navigation(_('Posteingang'), 'dispatch.php/messages/overview'));
     $navigation->addSubNavigation('out', new Navigation(_('Gesendet'), 'dispatch.php/messages/sent'));
     $this->addSubNavigation('messaging', $navigation);
     // community
     $navigation = new Navigation(_('Community'));
     $navigation->addSubNavigation('online', new Navigation(_('Wer ist online?'), 'dispatch.php/online'));
     $navigation->addSubNavigation('contacts', new Navigation(_('Meine Kontakte'), 'dispatch.php/contact'));
     // study groups
     if (get_config('STUDYGROUPS_ENABLE')) {
         $navigation->addSubNavigation('browse', new Navigation(_('Studiengruppen'), 'dispatch.php/studygroup/browse'));
     }
     // ranking
     if (get_config('SCORE_ENABLE')) {
         $navigation->addSubNavigation('score', new Navigation(_('Rangliste'), 'dispatch.php/score'));
         $this->addSubNavigation('community', $navigation);
     }
     // calendar / home page
     if (!$perm->have_perm('admin')) {
         $navigation = new Navigation(_('Mein Profil'), 'dispatch.php/profile');
         if ($perm->have_perm('autor')) {
             $navigation->addSubNavigation('settings', new Navigation(_('Einstellungen'), 'dispatch.php/settings/general'));
         }
         $this->addSubNavigation('profile', $navigation);
         $navigation = new Navigation(_('Mein Planer'));
         if (get_config('CALENDAR_ENABLE')) {
             $navigation->addSubNavigation('calendar', new Navigation(_('Terminkalender'), 'dispatch.php/calendar/single'));
         }
         if (get_config('SCHEDULE_ENABLE')) {
             $navigation->addSubNavigation('schedule', new Navigation(_('Stundenplan'), 'dispatch.php/calendar/schedule'));
         }
         $this->addSubNavigation('planner', $navigation);
     }
     // global search
     $navigation = new Navigation(_('Suchen'), 'dispatch.php/search/courses');
     $navigation->addSubNavigation('user', new Navigation(_('Personensuche'), 'browse.php'));
     $navigation->addSubNavigation('course', new Navigation(_('Veranstaltungssuche'), 'dispatch.php/search/courses'));
     $this->addSubNavigation('search', $navigation);
     // tools
     $navigation = new Navigation(_('Tools'));
     $navigation->addSubNavigation('news', new Navigation(_('Ankündigungen'), 'dispatch.php/news/admin_news'));
     if (get_config('VOTE_ENABLE')) {
         $navigation->addSubNavigation('vote', new Navigation(_('Umfragen und Tests'), 'admin_vote.php', array('page' => 'overview', 'showrangeID' => $username)));
         $navigation->addSubNavigation('evaluation', new Navigation(_('Evaluationen'), 'admin_evaluation.php', array('rangeID' => $username)));
     }
     // literature
     if (get_config('LITERATURE_ENABLE')) {
         $navigation->addSubNavigation('literature', new Navigation(_('Literatur'), 'dispatch.php/literature/edit_list.php', array('_range_id' => 'self')));
     }
     // elearning
     if (get_config('ELEARNING_INTERFACE_ENABLE')) {
         $navigation->addSubNavigation('elearning', new Navigation(_('Lernmodule'), 'dispatch.php/elearning/my_accounts'));
     }
     // export
     if (get_config('EXPORT_ENABLE') && $perm->have_perm('tutor')) {
         $navigation->addSubNavigation('export', new Navigation(_('Export'), 'export.php'));
     }
     $this->addSubNavigation('tools', $navigation);
     // external help
     $navigation = new Navigation(_('Hilfe'), format_help_url('Basis.Allgemeines'));
     $navigation->addSubNavigation('intro', new Navigation(_('Schnelleinstieg'), format_help_url('Basis.SchnellEinstiegKomplett')));
     $this->addSubNavigation('help', $navigation);
 }
Exemplo n.º 23
0
 /**
  * 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);
             }
         }
     }
     // resources
     if (($modules['resources'] || $sem_class->isSlotMandatory("resources")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("resources"))) {
         foreach ($sem_class->getNavigationForSlot("resources") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
     }
     // calendar
     if (($modules['calendar'] || $sem_class->isSlotMandatory("calendar")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("calendar"))) {
         foreach ($sem_class->getNavigationForSlot("calendar") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
     }
     // content modules
     if (($modules['elearning_interface'] || $sem_class->isSlotMandatory("elearning_interface")) && $sem_class->isModuleAllowed($sem_class->getSlotModule("elearning_interface"))) {
         foreach ($sem_class->getNavigationForSlot("elearning_interface") as $nav_name => $navigation) {
             if ($nav_name && is_a($navigation, "Navigation")) {
                 $this->addSubNavigation($nav_name, $navigation);
             }
         }
     }
     //plugins
     $standard_plugins = PluginManager::getInstance()->getPlugins("StandardPlugin", $_SESSION['SessionSeminar']);
     foreach ($standard_plugins as $plugin) {
         if (!$sem_class->isSlotModule(get_class($plugin))) {
             foreach ($sem_class->getNavigationForSlot(get_class($plugin)) as $nav_name => $navigation) {
                 if ($nav_name && is_a($navigation, "Navigation")) {
                     $this->addSubNavigation($nav_name, $navigation);
                 }
             }
         }
     }
 }
Exemplo n.º 24
0
 /**
  * Initialize the subnavigation of this item. This method
  * is called once before the first item is added or removed.
  */
 public function initSubNavigation()
 {
     global $perm, $user;
     parent::initSubNavigation();
     // top navigation (toolbar)
     $this->addSubNavigation('start', new StartNavigation());
     // if the user is not logged in, he will see the free courses, otherwise
     // the my courses page will be shown.
     if (is_object($user) && $user->id != 'nobody' || get_config('ENABLE_FREE_ACCESS')) {
         $this->addSubNavigation('browse', new BrowseNavigation());
     }
     // if a course is selected, the navigation for it will be loaded, but
     // it will not be shown in the main toolbar
     if ($_SESSION['SessionSeminar']) {
         $this->addSubNavigation('course', new CourseNavigation());
     }
     if (is_object($user) && $user->id != 'nobody') {
         // internal message system
         $this->addSubNavigation('messaging', new MessagingNavigation());
         // community page
         $this->addSubNavigation('community', new CommunityNavigation());
         // user profile page
         $this->addSubNavigation('profile', new ProfileNavigation());
         // calendar and schedule page
         $this->addSubNavigation('calendar', new CalendarNavigation());
         // search page
         $this->addSubNavigation('search', new SearchNavigation());
     }
     // tools page
     if (is_object($user) && $perm->have_perm('autor')) {
         $this->addSubNavigation('tools', new ToolsNavigation());
     }
     // admin page
     if (is_object($user) && $perm->have_perm('admin')) {
         $this->addSubNavigation('admin', new AdminNavigation());
     }
     // resource managment, if it is enabled
     if (get_config('RESOURCES_ENABLE')) {
         //TODO: suboptimal, es sollte eine ResourcesNavigation geben
         $navigation = new Navigation(_('Ressourcen'), 'resources.php', array('view' => 'resources'));
         if (is_object($user) && $perm->have_perm('admin')) {
             $navigation->setImage(Icon::create('resources', 'navigation', ["title" => _('Zur Ressourcenverwaltung')]));
         }
         $this->addSubNavigation('resources', $navigation);
     }
     // quick links
     $links = new Navigation('Links');
     // login / logout
     if (is_object($user) && $user->id != 'nobody') {
         $links->addSubNavigation('logout', new Navigation(_('Logout'), 'logout.php'));
     } else {
         if (in_array('CAS', $GLOBALS['STUDIP_AUTH_PLUGIN'])) {
             $links->addSubNavigation('login_cas', new Navigation(_('Login CAS'), Request::url(), array('again' => 'yes', 'sso' => 'cas')));
         }
         if (in_array('Shib', $GLOBALS['STUDIP_AUTH_PLUGIN'])) {
             $links->addSubNavigation('login_shib', new Navigation(_('Login Shibboleth'), Request::url(), array('again' => 'yes', 'sso' => 'shib')));
         }
         $links->addSubNavigation('login', new Navigation(_('Login'), Request::url(), array('again' => 'yes')));
     }
     $this->addSubNavigation('links', $links);
     // footer links
     $this->addSubNavigation('footer', new FooterNavigation(_('Footer')));
     // login page
     $this->addSubNavigation('login', new LoginNavigation(_('Login')));
 }
Exemplo n.º 25
0
        $navigation->addSubNavigation('schedule', $view_nav);

        if (!$_SESSION['resources_data']['requests_working_on']) {
            $edit_nav->setEnabled(false);
            $list_nav->setEnabled(false);
            $view_nav->setEnabled(false);
        }

        $resources_nav->addSubNavigation('room_requests', $navigation);
    }
}

// Reiter "Anpassen": Grundlegende Einstellungen fuer alle Ressourcen Admins
if ((getGlobalPerms($user->id) == 'admin') || ($perm->have_perm('root'))) {
    $navigation = new Navigation(_('Anpassen'));
    $navigation->addSubNavigation('edit_types', new Navigation(_('Typen verwalten'), 'resources.php', array('view' => 'edit_types')));
    $navigation->addSubNavigation('edit_properties', new Navigation(_('Eigenschaften verwalten'), 'resources.php', array('view' => 'edit_properties')));
    $navigation->addSubNavigation('edit_settings', new Navigation(_('globale Einstellungen verwalten'), 'resources.php', array('view' => 'edit_settings')));

    if ($perm->have_perm('root')) {
        $navigation->addSubNavigation('edit_perms', new Navigation(_('globale Rechte verwalten'), 'resources.php', array('view' => 'edit_perms')));
    }

    $resources_nav->addSubNavigation('settings', $navigation);
}

//load content, text, pictures and stuff
include ("$RELATIVE_PATH_RESOURCES/views/page_intros.inc.php");
//save messages from
$pmessages = PageLayout::getMessages();
ob_start();
Exemplo n.º 26
0
 /**
  * Initialize the subnavigation of this item. This method
  * is called once before the first item is added or removed.
  */
 public function initSubNavigation()
 {
     global $SessionSeminar, $SessSemName, $archive_kill, $perm;
     parent::initSubNavigation();
     if ($SessSemName['class'] == 'inst') {
         if (isset($_SESSION['links_admin_data']['referred_from']) && $_SESSION['links_admin_data']['referred_from'] == 'inst') {
             $back_jump = _('zurück zur ausgewählten Einrichtung');
         } else {
             $back_jump = _('zur ausgewählten Einrichtung');
         }
     } else {
         if ($SessSemName['class'] == 'sem') {
             if (isset($_SESSION['links_admin_data']['referred_from']) && $_SESSION['links_admin_data']['referred_from'] == 'sem' && !$archive_kill && !(isset($_SESSION['links_admin_data']['assi']) && $_SESSION['links_admin_data']['assi'])) {
                 $back_jump = _('zurück zur ausgewählten Veranstaltung');
             } else {
                 if (isset($_SESSION['links_admin_data']['referred_from']) && $_SESSION['links_admin_data']['referred_from'] == 'assi' && !$archive_kill) {
                     $back_jump = _('zur neu angelegten Veranstaltung');
                 } else {
                     if (!(isset($_SESSION['links_admin_data']['assi']) && $_SESSION['links_admin_data']['assi'])) {
                         $back_jump = _('zur ausgewählten Veranstaltung');
                     }
                 }
             }
         }
     }
     $sem_create_perm = in_array(Config::get()->SEM_CREATE_PERM, array('root', 'admin', 'dozent')) ? Config::get()->SEM_CREATE_PERM : 'dozent';
     // global config / user administration
     if (!Config::get()->RESTRICTED_USER_MANAGEMENT || $perm->have_perm('root')) {
         $navigation = new Navigation(_('Benutzer'));
         $navigation->setURL('dispatch.php/admin/user/');
         $navigation->addSubNavigation('index', new Navigation(_('Benutzer'), 'dispatch.php/admin/user'));
         if ($perm->have_perm('root')) {
             $navigation->addSubNavigation('user_domains', new Navigation(_('Nutzerdomänen'), 'dispatch.php/admin/domain'));
         }
         $this->addSubNavigation('user', $navigation);
     }
     // institute administration
     $navigation = new Navigation(_('Einrichtungen'));
     $navigation->setURL('dispatch.php/institute/basicdata/index?cid=');
     $navigation->addSubNavigation('details', new Navigation(_('Grunddaten'), 'dispatch.php/institute/basicdata/index'));
     $navigation->addSubNavigation('faculty', new Navigation(_('Mitarbeiter'), 'dispatch.php/institute/members?admin_view=1'));
     $navigation->addSubNavigation('groups', new Navigation(_('Funktionen / Gruppen'), 'dispatch.php/admin/statusgroups?type=inst'));
     if (Config::get()->VOTE_ENABLE) {
         $navigation->addSubNavigation('vote', new Navigation(_('Umfragen und Tests'), 'admin_vote.php?view=vote_inst'));
         $navigation->addSubNavigation('evaluation', new Navigation(_('Evaluationen'), 'admin_evaluation.php?view=eval_inst'));
     }
     $navigation->addSubNavigation('modules', new Navigation(_('Inhaltselemente'), 'dispatch.php/course/plus/index'));
     if (Config::get()->EXTERN_ENABLE) {
         $navigation->addSubNavigation('external', new Navigation(_('Externe Seiten'), 'admin_extern.php?view=extern_inst'));
     }
     if ($perm->have_perm("root") || $perm->is_fak_admin() && Config::get()->INST_FAK_ADMIN_PERMS != 'none') {
         $navigation->addSubNavigation('create', new Navigation(_('Neue Einrichtung anlegen'), 'dispatch.php/institute/basicdata/index?cid=&i_view=new'));
     }
     $this->addSubNavigation('institute', $navigation);
     $navigation = new Navigation(_('Standort'));
     if ($perm->have_perm(Config::get()->RANGE_TREE_ADMIN_PERM ? Config::get()->RANGE_TREE_ADMIN_PERM : 'admin')) {
         $navigation->addSubNavigation('range_tree', new Navigation(_('Einrichtungshierarchie'), 'admin_range_tree.php'));
     }
     if ($perm->have_perm(Config::get()->SEM_TREE_ADMIN_PERM ? Config::get()->SEM_TREE_ADMIN_PERM : 'admin') && $perm->is_fak_admin()) {
         $navigation->addSubNavigation('sem_tree', new Navigation(_('Veranstaltungshierarchie'), 'admin_sem_tree.php'));
     }
     if ($perm->have_perm(Config::get()->LOCK_RULE_ADMIN_PERM ? Config::get()->LOCK_RULE_ADMIN_PERM : 'admin')) {
         $navigation->addSubNavigation('lock_rules', new Navigation(_('Sperrebenen'), 'dispatch.php/admin/lockrules'));
     }
     if ($perm->have_perm('root')) {
         $navigation->addSubNavigation('auto_insert', new Navigation(_('Automatisiertes Eintragen'), 'dispatch.php/admin/autoinsert'));
         if (Config::get()->SEMESTER_ADMINISTRATION_ENABLE) {
             $navigation->addSubNavigation('semester', new Navigation(_('Semester'), 'dispatch.php/admin/semester'));
             $navigation->addSubNavigation('holidays', new Navigation(_('Ferien'), 'dispatch.php/admin/holidays'));
         }
         if (Config::get()->EXTERN_ENABLE) {
             $navigation->addSubNavigation('external', new Navigation(_('Externe Seiten'), 'admin_extern.php?list=TRUE&view=extern_global'));
         }
         $navigation->addSubNavigation('studycourse', new Navigation(_('Studiengänge'), 'dispatch.php/admin/studycourse/profession'));
         $navigation->addSubNavigation('sem_classes', new Navigation(_('Veranstaltungskategorien'), 'dispatch.php/admin/sem_classes/overview'));
     }
     $this->addSubNavigation('locations', $navigation);
     // global config / user administration
     $navigation = new Navigation(_('System'));
     if ($perm->have_perm('root')) {
         $navigation->addSubNavigation('plugins', new Navigation(_('Plugins'), 'dispatch.php/admin/plugin'));
         $navigation->addSubNavigation('roles', new Navigation(_('Rollen'), 'dispatch.php/admin/role'));
         $navigation->addSubNavigation('datafields', new Navigation(_('Datenfelder'), 'dispatch.php/admin/datafields'));
         $navigation->addSubNavigation('configuration', new Navigation(_('Konfiguration'), 'dispatch.php/admin/configuration/configuration'));
         if (Config::get()->BANNER_ADS_ENABLE) {
             $navigation->addSubNavigation('banner', new Navigation(_('Werbebanner'), 'dispatch.php/admin/banner'));
         }
         $navigation->addSubNavigation('coursewizardsteps', new Navigation(_('Anlegeassistent'), 'dispatch.php/admin/coursewizardsteps'));
         $navigation->addSubNavigation('studygroup', new Navigation(_('Studiengruppen'), 'dispatch.php/course/studygroup/globalmodules'));
         if (Config::get()->SMILEYADMIN_ENABLE) {
             $navigation->addSubNavigation('smileys', new Navigation(_('Smileys'), 'dispatch.php/admin/smileys'));
         }
         if (Config::get()->TOURS_ENABLE) {
             $navigation->addSubNavigation('tour', new Navigation(_('Touren'), 'dispatch.php/tour/admin_overview'));
         }
         $navigation->addSubNavigation('help_content', new Navigation(_('Hilfe-Texte'), 'dispatch.php/help_content/admin_overview'));
         if (Config::get()->ELEARNING_INTERFACE_ENABLE) {
             $navigation->addSubNavigation('elearning', new Navigation(_('Lernmodule'), 'admin_elearning_interface.php'));
         }
         if (Config::get()->WEBSERVICES_ENABLE) {
             $navigation->addSubNavigation('webservice_access', new Navigation(_('Webservices'), 'dispatch.php/admin/webservice_access'));
         }
         if (Config::get()->CRONJOBS_ENABLE) {
             $navigation->addSubNavigation('cronjobs', new Navigation(_('Cronjobs'), 'dispatch.php/admin/cronjobs/schedules'));
         }
         if (Config::get()->PERSONALDOCUMENT_ENABLE) {
             $navigation->addSubNavigation('document_area', new Navigation(_('Pers. Dateibereich'), 'dispatch.php/document/administration'));
         }
         $navigation->addSubNavigation('admissionrules', new Navigation(_('Anmelderegeln'), 'dispatch.php/admission/ruleadministration'));
         $navigation->addSubNavigation('api', new Navigation(_('API'), 'dispatch.php/admin/api'));
     }
     if ($perm->have_perm(Config::get()->AUX_RULE_ADMIN_PERM ? Config::get()->AUX_RULE_ADMIN_PERM : 'admin')) {
         $navigation->addSubNavigation('specification', new Navigation(_('Zusatzangaben'), 'dispatch.php/admin/specification'));
     }
     $this->addSubNavigation('config', $navigation);
     // log view
     if ($perm->have_perm('root') && Config::get()->LOG_ENABLE) {
         $navigation = new Navigation(_('Log'));
         $navigation->addSubNavigation('show', new Navigation(_('Log'), 'dispatch.php/event_log/show'));
         $navigation->addSubNavigation('admin', new Navigation(_('Einstellungen'), 'dispatch.php/event_log/admin'));
         $this->addSubNavigation('log', $navigation);
     }
     // link to course
     if ($SessSemName['class'] == 'inst') {
         $navigation = new Navigation($back_jump, 'dispatch.php/institute/overview?auswahl=' . $SessSemName[1]);
         $this->addSubNavigation('back_jump', $navigation);
     } else {
         if ($SessSemName['class'] == 'sem' && !$archive_kill && !(isset($_SESSION['links_admin_data']['assi']) && $_SESSION['links_admin_data']['assi'])) {
             $navigation = new Navigation($back_jump, 'seminar_main.php?auswahl=' . $SessSemName[1]);
             $this->addSubNavigation('back_jump', $navigation);
         }
     }
     // admin plugins
     $navigation = new Navigation(_('Admin-Plugins'));
     $this->addSubNavigation('plugins', $navigation);
 }