public function __construct()
 {
     parent::__construct();
     if (false) {
         //Suche ersetzen
         if (Navigation::hasItem("/search")) {
             $nav = Navigation::getItem("/search");
             $nav->setURL(PluginEngine::getURL($this, array(), "search"));
             foreach ($nav->getSubNavigation() as $name => $nav_object) {
                 $nav->removeSubNavigation($name);
             }
             $tab = new AutoNavigation(_("Suche"), PluginEngine::getURL($this, array(), "search"));
             $nav->addSubNavigation('search', $tab);
         }
     } else {
         //Suche erweitern
         if (Navigation::hasItem("/search")) {
             $nav = Navigation::getItem("/search");
             $nav->setURL(PluginEngine::getURL($this, array(), "search"));
             $tab = new AutoNavigation(_("Suche"), PluginEngine::getURL($this, array(), "search"));
             $nav->addSubNavigation('search', $tab);
         }
     }
     //Observer definieren:
     NotificationCenter::addObserver($this, "show_user_avatar", "WillDisplaySearchResultItem");
     NotificationCenter::addObserver($this, "show_seminar_avatar", "WillDisplaySearchResultItem");
     NotificationCenter::addObserver($this, "show_document_avatar", "WillDisplaySearchResultItem");
     NotificationCenter::addObserver($this, "add_calculator", "LastAlteringOfSearchResults");
     NotificationCenter::addObserver($this, "filter_study_areas", "GlobalSearchFilter");
 }
Ejemplo n.º 2
0
 private function sortCourseNavigation()
 {
     global $perm;
     $restNavigation = array();
     $newNavigation = Navigation::getItem('/course');
     foreach (Navigation::getItem('/course') as $key => $tab) {
         $block = SeminarTab::findOneBySQL('seminar_id = ? AND tab IN (?) ORDER BY position ASC', array($this->getSeminarId(), $key));
         if ($block) {
             $tab->setTitle($block->getValue('title'));
             if ($block->getValue('tn_visible') == true || $perm->have_studip_perm('dozent', Request::get('cid'))) {
                 $subNavigations[$block->getValue('position')][$key] = $tab;
             }
         } else {
             //keine Info bezüglich Reihenfolge also hinten dran
             //greift bei neu aktivierten Navigationselementen
             $restNavigation[$key] = $tab;
         }
         $newNavigation->removeSubNavigation($key);
     }
     ksort($subNavigations);
     foreach ($subNavigations as $subNavs) {
         foreach ($subNavs as $key => $subNav) {
             $newNavigation->addSubNavigation($key, $subNav);
         }
     }
     if (count($restNavigation) > 0) {
         foreach ($restNavigation as $key => $restNav) {
             $newNavigation->addSubNavigation($key, $restNav);
         }
     }
     Navigation::addItem('/course', $newNavigation);
 }
Ejemplo n.º 3
0
 /**
  * show the administration page for mass-editing forum-entries
  */
 function index_action()
 {
     ForumPerm::check('admin', $this->getId());
     $nav = Navigation::getItem('course/forum2');
     $nav->setImage(Icon::create('forum', 'info'));
     Navigation::activateItem('course/forum2/admin');
     $list = ForumEntry::getList('flat', $this->getId());
     // sort by cat
     $new_list = array();
     // iterate over all categories and add the belonging areas to them
     foreach ($categories = ForumCat::getListWithAreas($this->getId(), false) as $category) {
         if ($category['topic_id']) {
             $new_list[$category['category_id']][$category['topic_id']] = $list['list'][$category['topic_id']];
             unset($list['list'][$category['topic_id']]);
         } else {
             if (ForumPerm::has('add_area', $this->seminar_id)) {
                 $new_list[$category['category_id']] = array();
             }
         }
         $this->categories[$category['category_id']] = $category['entry_name'];
     }
     if (!empty($list['list'])) {
         // append the remaining entries to the standard category
         $new_list[$this->getId()] = array_merge((array) $new_list[$this->getId()], $list['list']);
     }
     $this->list = $new_list;
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
     if ($GLOBALS['perm']->have_perm("root")) {
         $processes = FleximportProcess::findBySQL("1=1 ORDER BY name ASC");
         $navigation = new Navigation($this->getDisplayName());
         $navigation->setURL(PluginEngine::getURL($this, array(), 'import/overview' . (count($processes) ? "/" . $processes[0]['process_id'] : "")));
         Navigation::addItem('/start/fleximport', $navigation);
         Navigation::addItem('/fleximport', $navigation);
         if (count($processes)) {
             foreach ($processes as $process) {
                 $navigation = new Navigation($process['name'], PluginEngine::getURL($this, array(), 'import/overview/' . $process->getId()));
                 Navigation::addItem('/fleximport/process_' . $process->getId(), $navigation);
             }
         } else {
             $navigation = new Navigation(_("Import"), PluginEngine::getURL($this, array(), 'import/overview'));
             Navigation::addItem('/fleximport/overview', $navigation);
         }
         $navigation = new Navigation(_("Konfiguration"), PluginEngine::getURL($this, array(), 'config/overview'));
         Navigation::addItem('/fleximport/config', $navigation);
         if (FleximportConfig::get("DISPLAY_AT_HEADER")) {
             if (is_numeric(FleximportConfig::get("DISPLAY_AT_HEADER"))) {
                 Navigation::getItem('/fleximport')->setImage(version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4", ">=") ? Icon::create("install", "navigation") : Assets::image_path("icons/lightblue/install.svg"));
             } else {
                 Navigation::getItem('/fleximport')->setImage(version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4", ">=") ? Icon::create(FleximportConfig::get("DISPLAY_AT_HEADER"), "navigation") : FleximportConfig::get("DISPLAY_AT_HEADER"));
             }
         }
     }
 }
Ejemplo n.º 5
0
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setTitle(_('Studiengruppen suchen'));
     Navigation::activateItem('/community/studygroups/browse');
     PageLayout::setHelpKeyword('Basis.SuchenStudiengruppen');
     // add skip link
     SkipLinks::addIndex(Navigation::getItem('/community/studygroups/browse')->getTitle(), 'layout_content', 100);
     Sidebar::get()->setImage('sidebar/studygroup-sidebar.png');
 }
Ejemplo n.º 6
0
 public function configuration_action()
 {
     $template_factory = new Flexi_TemplateFactory(__DIR__ . '/templates');
     $template = $template_factory->open('edit');
     $template->links = Navigation::getItem('/start');
     $template->config = WidgetHelper::getWidgetUserConfig($GLOBALS['user']->id, 'QUICK_SELECTION');
     $template->plugin = $this;
     header('X-Title: ' . _('Schnellzugriff konfigurieren'));
     echo studip_utf8encode($template->render());
 }
Ejemplo n.º 7
0
 public function index_action()
 {
     global $perm;
     $this->courseadmin = $perm->have_studip_perm('tutor', $this->course_id);
     //Tabs und zugehörige Einstellung laden
     $position = 100;
     foreach (Navigation::getItem('course') as $key => $tab) {
         //systemtabs anlegen/abfragen
         $query = "SELECT title FROM `system_tabs` WHERE tab IN (:key)";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array('key' => $key));
         $orig_title = $statement->fetchAll(PDO::FETCH_ASSOC);
         //Spezialfall Reiter die nur TN sehen (zB Courseware Fortschrittsübersicht)
         if ($key == 'mooc_courseware') {
             $query2 = "SELECT title FROM `system_tabs` WHERE tab IN (:key)";
             $statement2 = DBManager::get()->prepare($query2);
             $statement2->execute(array('key' => 'mooc_progress'));
             $orig_title2 = $statement2->fetchAll(PDO::FETCH_ASSOC);
             if (!$orig_title2[0]) {
                 $values2 = array('id' => md5('mooc_progress'), 'tab' => 'mooc_progress', 'title' => 'Fortschrittsübersicht');
                 $query2 = "INSERT INTO `system_tabs` (`id`, `tab`, `title`) VALUES (:id, :tab, :title)";
                 $statement2 = DBManager::get()->prepare($query2);
                 $statement2->execute($values2);
                 $orig_title2[0]['title'] = "Fortschrittsübersicht";
             }
             $block = SeminarTab::findOneBySQL('seminar_id = ? AND tab IN (?) ORDER BY position ASC', array($this->course_id, 'mooc_progress'));
             if ($block) {
                 $this->tabs[] = array('tab' => $block->getValue('tab'), 'title' => $block->getValue('title'), 'position' => $block->getValue('position'), 'orig_title' => $orig_title2[0]['title'], 'visible' => $block->getValue('tn_visible') ? 'checked' : '');
             } else {
                 $this->tabs[] = array('tab' => 'mooc_progress', 'title' => 'Fortschrittsübersicht', 'position' => $position, 'orig_title' => $orig_title2[0]['title'], 'visible' => 'checked');
             }
             $position++;
         }
         //Ende Sonderfall
         if (!$orig_title[0]) {
             $values = array('id' => md5($key), 'tab' => $key, 'title' => $tab->getTitle());
             $query = "INSERT INTO `system_tabs` (`id`, `tab`, `title`) VALUES (:id, :tab, :title)";
             $statement = DBManager::get()->prepare($query);
             $statement->execute($values);
             $orig_title[0]['title'] = $tab->getTitle();
         }
         if (!in_array($tab->getTitle(), $this->ignore_tabs)) {
             $block = SeminarTab::findOneBySQL('seminar_id = ? AND tab IN (?) ORDER BY position ASC', array($this->course_id, $key));
             if ($block && !in_array($key, $this->ignore_tabs)) {
                 $this->tabs[] = array('tab' => $block->getValue('tab'), 'title' => $block->getValue('title'), 'position' => $block->getValue('position'), 'orig_title' => $orig_title[0]['title'], 'visible' => $block->getValue('tn_visible') ? 'checked' : '');
             } else {
                 if (!in_array($key, $this->ignore_tabs)) {
                     $this->tabs[] = array('tab' => $key, 'title' => $tab->getTitle(), 'position' => $position, 'orig_title' => $orig_title[0]['title'], 'visible' => 'checked');
                 }
             }
             $position++;
         }
     }
     $this->tabs = $this->array_sort($this->tabs, 'position', SORT_ASC);
 }
Ejemplo n.º 8
0
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     global $perm;
     checkObject();
     checkObjectModule("participants");
     $this->course_id = $_SESSION['SessSemName'][1];
     $this->course_title = $_SESSION['SessSemName'][0];
     $this->user_id = $GLOBALS['auth']->auth['uid'];
     // Check dozent-perms
     if ($perm->have_studip_perm('dozent', $this->course_id)) {
         $this->is_dozent = true;
     }
     // Check tutor-perms
     if ($perm->have_studip_perm('tutor', $this->course_id)) {
         $this->is_tutor = true;
     }
     // Check autor-perms
     if ($perm->have_studip_perm('autor', $this->course_id)) {
         $this->is_autor = true;
     }
     if ($this->is_tutor) {
         PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenTeilnehmer");
     } else {
         PageLayout::setHelpKeyword("Basis.InVeranstaltungTeilnehmer");
     }
     // Check lock rules
     $this->dozent_is_locked = LockRules::Check($this->course_id, 'dozent');
     $this->tutor_is_locked = LockRules::Check($this->course_id, 'tutor');
     $this->is_locked = LockRules::Check($this->course_id, 'participants');
     // Layoutsettings
     PageLayout::setTitle(sprintf('%s - %s', Course::findCurrent()->getFullname(), _("Teilnehmende")));
     PageLayout::addScript('members.js');
     SkipLinks::addIndex(Navigation::getItem('/course/members')->getTitle(), 'main_content', 100);
     object_set_visit_module('participants');
     $this->last_visitdate = object_get_visit($this->course_id, 'participants');
     // Check perms and set the last visit date
     if (!$this->is_tutor) {
         $this->last_visitdate = time() + 10;
     }
     // Get the max-page-value for the pagination
     $this->max_per_page = Config::get()->ENTRIES_PER_PAGE;
     $this->status_groups = array('dozent' => get_title_for_status('dozent', 2), 'tutor' => get_title_for_status('tutor', 2), 'autor' => get_title_for_status('autor', 2), 'user' => get_title_for_status('user', 2), 'accepted' => get_title_for_status('accepted', 2), 'awaiting' => _("Wartende Personen"), 'claiming' => _("Wartende Personen"));
     // StatusGroups for the view
     $this->decoratedStatusGroups = array('dozent' => get_title_for_status('dozent', 1), 'autor' => get_title_for_status('autor', 1), 'tutor' => get_title_for_status('tutor', 1), 'user' => get_title_for_status('user', 1));
     //check for admission / waiting list
     update_admission($this->course_id);
     // Create new MembersModel, to get additionanl informations to a given Seminar
     $this->members = new MembersModel($this->course_id, $this->course_title);
     $this->members->checkUserVisibility();
     // Set default sidebar image
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/person-sidebar.png');
 }
Ejemplo n.º 9
0
 /**
  * The only method, loads the navigation object and displays it.
  */
 public function index_action()
 {
     PageLayout::setTitle(_('Sitemap'));
     foreach (Navigation::getItem('/start') as $nav) {
         $nav->setEnabled(false);
     }
     $this->navigation = Navigation::getItem('/');
     $this->quicklinks = Navigation::getItem('/links');
     $this->footer = Navigation::getItem('/footer');
     // Add sidebar
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/admin-sidebar.png');
     $info = new InfoboxWidget();
     $info->setTitle(_('Hinweise'));
     $info->addElement(new WidgetElement(_('Auf dieser Seite finden Sie eine Übersicht über alle verfügbaren Seiten.')));
     $sidebar->addWidget($info);
 }
Ejemplo n.º 10
0
 /**
  * Returns the current navigation as an array.
  *
  * @return Array containing the navigation
  */
 public static function getNavigationArray()
 {
     $navigation = array();
     foreach (Navigation::getItem('/')->getSubNavigation() as $path => $nav) {
         if (!$nav->isVisible(true)) {
             continue;
         }
         $image = $nav->getImage();
         $image_src = $image ? $image->asImagePath() : false;
         $item = array('icon' => $image_src ? self::getAssetsURL($image_src) : false, 'title' => $nav->getTitle(), 'url' => self::getURL($nav->getURL()), 'active' => $nav->isActive());
         if ($nav->getSubnavigation()) {
             $item['children'] = self::getChildren($nav, $path);
         }
         $navigation[$path] = $item;
     }
     return $navigation;
 }
Ejemplo n.º 11
0
 function before_filter(&$action, &$args)
 {
     global $SEM_TYPE, $SEM_CLASS;
     parent::before_filter($action, $args);
     checkObject();
     $this->course = Course::findCurrent();
     if (!$this->course) {
         throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
     }
     $this->course_id = $this->course->id;
     PageLayout::setHelpKeyword("Basis.InVeranstaltungKurzinfo");
     PageLayout::setTitle($GLOBALS['SessSemName']["header_line"] . " - " . _("Kurzinfo"));
     Navigation::activateItem('/course/main/info');
     // add skip link
     SkipLinks::addIndex(Navigation::getItem('/course/main/info')->getTitle(), 'main_content', 100);
     $this->sem = Seminar::getInstance($this->course_id);
     $sem_class = $this->sem->getSemClass();
     $this->studygroup_mode = $sem_class["studygroup_mode"];
 }
Ejemplo n.º 12
0
 function show_action()
 {
     $this->url_params = array();
     if (Request::get('from')) {
         $this->url_params['from'] = Request::get('from');
     }
     if (Request::get('open_node')) {
         $this->url_params['open_node'] = Request::get('open_node');
     }
     if (!Request::isXhr()) {
         Navigation::activateItem('course/admin/study_areas');
         $sidebar = Sidebar::get();
         $sidebar->setImage('sidebar/admin-sidebar.png');
         if ($this->course) {
             $links = new ActionsWidget();
             foreach (Navigation::getItem('/course/admin/main') as $nav) {
                 if ($nav->isVisible(true)) {
                     $image = $nav->getImage();
                     $links->addLink($nav->getTitle(), URLHelper::getLink($nav->getURL(), array('studip_ticket' => Seminar_Session::get_ticket())), $image);
                 }
             }
             $sidebar->addWidget($links);
             // Entry list for admin upwards.
             if ($GLOBALS['perm']->have_studip_perm("admin", $GLOBALS['SessionSeminar'])) {
                 $list = new SelectorWidget();
                 $list->setUrl("?#admin_top_links");
                 $list->setSelectParameterName("cid");
                 foreach (AdminCourseFilter::get()->getCoursesForAdminWidget() as $seminar) {
                     $list->addElement(new SelectElement($seminar['Seminar_id'], $seminar['Name']), 'select-' . $seminar['Seminar_id']);
                 }
                 $list->setSelection($this->course->id);
                 $sidebar->addWidget($list);
             }
         }
     }
     if (Request::get('open_node')) {
         $this->values['StudyAreasWizardStep']['open_node'] = Request::get('open_node');
     }
     $this->tree = $this->step->getStepTemplate($this->values, 0, 0);
 }
Ejemplo n.º 13
0
<script>
jQuery(function ($) {
    STUDIP.Dialog.fromURL('<?php 
echo $controller->url_for('messages/read/' . $message_id);
?>
');
});
</script>
<? endif; ?>

<?php 
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/mail-sidebar.png');
$actions = new ActionsWidget();
$actions->addLink(_("Neue Nachricht schreiben"), $controller->url_for('messages/write'), Icon::create('mail+add', 'clickable'), array('data-dialog' => 'width=650;height=600'));
if (Navigation::getItem('/messaging/messages/inbox')->isActive() && $messages) {
    $actions->addLink(_('Alle als gelesen markieren'), $controller->url_for('messages/overview', array('read_all' => 1)), Icon::create('accept', 'clickable'));
}
$actions->addLink(_('Ausgewählte Nachrichten löschen'), "#", Icon::create('trash', 'clickable'), array('onclick' => "if (window.confirm('Wirklich %s Nachrichten löschen?'.toLocaleString().replace('%s', jQuery('#bulk tbody :checked').length))) { jQuery('#bulk').submit(); } return false;"));
$sidebar->addWidget($actions);
$search = new SearchWidget(URLHelper::getLink('?'));
$search->addNeedle(_('Nachrichten durchsuchen'), 'search', true);
$search->addFilter(_('Betreff'), 'search_subject');
$search->addFilter(_('Inhalt'), 'search_content');
$search->addFilter(_('Autor/-in'), 'search_autor');
$sidebar->addWidget($search);
$folderwidget = new ViewsWidget();
$folderwidget->forceRendering();
$folderwidget->title = _('Schlagworte');
$folderwidget->id = 'messages-tags';
$folderwidget->addLink(_("Alle Nachrichten"), URLHelper::getURL("?"), null, array('class' => "tag"))->setActive(!Request::submitted("tag"));
Ejemplo n.º 14
0
 public function index_action()
 {
     $this->prelim_discussion = vorbesprechung($this->course->id);
     $this->title = $this->course->getFullname();
     $this->course_domains = UserDomain::getUserDomainsForSeminar($this->course->id);
     $this->sem = new Seminar($this->course);
     if ($studienmodulmanagement = PluginEngine::getPlugin('StudienmodulManagement')) {
         foreach ($this->course->study_areas->filter(function ($m) {
             return $m->isModule();
         }) as $module) {
             $this->studymodules[] = array('nav' => $studienmodulmanagement->getModuleInfoNavigation($module->id, $this->course->start_semester->id), 'title' => $studienmodulmanagement->getModuleTitle($module->id, $this->course->start_semester->id));
         }
     }
     // Retrive display of sem_tree
     if (Config::get()->COURSE_SEM_TREE_DISPLAY) {
         $this->studyAreaTree = StudipStudyArea::backwards($this->course->study_areas);
     } else {
         $this->study_areas = $this->course->study_areas->filter(function ($m) {
             return !$m->isModule();
         });
     }
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('Content-Type', 'text/html;charset=Windows-1252');
         header('X-Title: ' . $this->title);
     } else {
         PageLayout::setHelpKeyword("Basis.InVeranstaltungDetails");
         PageLayout::setTitle($this->title . " - " . _("Details"));
         PageLayout::addSqueezePackage('admission');
         PageLayout::addSqueezePackage('enrolment');
         if ($GLOBALS['SessionSeminar'] == $this->course->id) {
             Navigation::activateItem('/course/main/details');
             SkipLinks::addIndex(Navigation::getItem('/course/main/details')->getTitle(), 'main_content', 100);
         } else {
             $sidebarlink = true;
             $enrolment_info = $this->sem->getEnrolmentInfo($GLOBALS['user']->id);
         }
         $sidebar = Sidebar::Get();
         if ($sidebarlink) {
             $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
         }
         $sidebar->setTitle(_('Details'));
         $links = new ActionsWidget();
         $links->addLink(_("Drucken"), URLHelper::getScriptLink("dispatch.php/course/details/index/" . $this->course->id), Icon::create('print', 'clickable'), array('class' => 'print_action', 'target' => '_blank'));
         if ($enrolment_info['enrolment_allowed'] && $sidebarlink) {
             if (in_array($enrolment_info['cause'], words('member root courseadmin'))) {
                 $abo_msg = _("direkt zur Veranstaltung");
             } else {
                 $abo_msg = _("Zugang zur Veranstaltung");
             }
             $links->addLink($abo_msg, URLHelper::getScriptLink("dispatch.php/course/enrolment/apply/" . $this->course->id), Icon::create('door-enter', 'clickable'), array('data-dialog' => ''));
         }
         if (Config::get()->SCHEDULE_ENABLE && !$GLOBALS['perm']->have_studip_perm("user", $this->course->id) && !$GLOBALS['perm']->have_perm('admin') && $this->sem->getMetaDateCount()) {
             $query = "SELECT COUNT(*) FROM schedule_seminare WHERE seminar_id = ? AND user_id = ?";
             if (!DBManager::Get()->fetchColumn($query, array($this->course->id, $GLOBALS['user']->id))) {
                 $links->addLink(_("Nur im Stundenplan vormerken"), URLHelper::getLink("dispatch.php/calendar/schedule/addvirtual/" . $this->course->id), Icon::create('info', 'clickable'));
             }
         }
         if ($this->send_from_search_page) {
             $links->addLink(_("Zurück zur letzten Auswahl"), URLHelper::getLink($this->send_from_search_page), Icon::create('link-intern', 'clickable'));
         }
         if ($links->hasElements()) {
             $sidebar->addWidget($links);
         }
         $sidebar->setImage('sidebar/seminar-sidebar.png');
         $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
         $sidebar = Sidebar::Get();
         $sidebar->setImage('sidebar/seminar-sidebar.png');
         $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
         if ($enrolment_info['description']) {
             PageLayout::postMessage(MessageBox::info($enrolment_info['description']));
         }
     }
 }
Ejemplo n.º 15
0
?>
" type="audio/ogg">
                    <source src="<?php 
echo Assets::url('sounds/blubb.mp3');
?>
" type="audio/mpeg">
                </audio>
                <? endif ?>
            </li>
            <? endif ?>
            <? if (isset($search_semester_nr)) : ?>
            <li>
                        </li>
            <? endif ?>
            <? if (Navigation::hasItem('/links')) : ?>
            <? foreach (Navigation::getItem('/links') as $nav) : ?>
                <? if ($nav->isVisible()) : ?>
                    <li <? if ($nav->isActive()) echo 'class="active"'; ?>>
                    <a
                    <? if (is_internal_url($url = $nav->getURL())) : ?>
                        href="<?php 
echo URLHelper::getLink($url, $link_params);
?>
"
                    <? else : ?>
                        href="<?php 
echo htmlReady($url);
?>
" target="_blank"
                    <? endif ?>
                    <? if ($nav->getDescription()): ?>
Ejemplo n.º 16
0
 * "Ich will unsichtbar sein" angezeigt.
 *
 * Bei Nutzung dieser Funktion unbedingt die Texte unter locale/de/LC_HELP/visibility_decision.php bzw.
 * locale/en/LC_HELP/visibility_decision.php an die lokalen Verhältnisse anpassen!
 */
if ($GLOBALS['USER_VISIBILITY_CHECK'] && is_object($GLOBALS['user']) && $GLOBALS['user']->id != 'nobody') {
    require_once 'lib/user_visible.inc.php';
    first_decision($GLOBALS['user']->id);
}
if (PageLayout::isHeaderEnabled()) {
    $header_template = $GLOBALS['template_factory']->open('header');
    $header_template->current_page = PageLayout::getTitle();
    $header_template->link_params = array_fill_keys(array_keys(URLHelper::getLinkParams()), NULL);
    if (is_object($GLOBALS['user']) && $GLOBALS['user']->id != 'nobody') {
        // only mark course if user is logged in and free access enabled
        if (get_config('ENABLE_FREE_ACCESS') && Navigation::hasItem('/course') && Navigation::getItem('/course')->isActive()) {
            // indicate to the template that this course is publicly visible
            // need to handle institutes separately (always visible)
            if ($GLOBALS['SessSemName']['class'] == 'inst') {
                $header_template->public_hint = _('öffentliche Einrichtung');
            } else {
                if (Course::findCurrent()->lesezugriff == 0) {
                    $header_template->public_hint = _('öffentliche Veranstaltung');
                }
            }
        }
        if ($GLOBALS['user']->cfg->getValue('ACCESSKEY_ENABLE')) {
            $header_template->accesskey_enabled = true;
        }
        // fetch semester for quick search box in the link bar
        $semester_data = SemesterData::GetSemesterArray();
Ejemplo n.º 17
0
if (Request::submitted('download_selected')) {
    $download_ids = Request::optionArray('download_ids');
    if (count($download_ids)  > 0) {
        $zip_file_id = createSelectedZip($download_ids, true, true);
        if($zip_file_id){
            $zip_name = prepareFilename($SessSemName[0].'-'._("Dokumente").'.zip');
            header('Location: ' . getDownloadLink( $zip_file_id, $zip_name, 4));
            page_close();
            die;
        }
    }
}

    // add skip links
    SkipLinks::addIndex(Navigation::getItem('/course/files/all')->getTitle(), 'main_content', 100);
    SkipLinks::addIndex(Navigation::getItem('/course/files/tree')->getTitle(), 'main_content', 100);
$folder_tree = TreeAbstract::GetInstance('StudipDocumentTree', array('range_id' => $SessSemName[1]));

$question = $msg = '';

if($zip_file_id === false){
    $msg = 'error§'
    . sprintf(_("Der Zip Download ist fehlgeschlagen. Bitte beachten Sie das Limit von maximal %s Dateien und die maximale Größe der zu zippenden Dateien von %s MB."),
    (int)Config::GetInstance()->getValue('ZIP_DOWNLOAD_MAX_FILES'),
    (int)Config::GetInstance()->getValue('ZIP_DOWNLOAD_MAX_SIZE') )
    . '§';
}

//obskuren id+_?_ string zerpflücken
if (strpos($open, "_") !== false){
    list($open_id, $open_cmd) = explode('_', $open);
Ejemplo n.º 18
0
 /**
  * show search results
  * 
  * @param int $page show entries on submitted page
  */
 function search_action($page = null)
 {
     ForumPerm::check('search', $this->getId());
     $nav = Navigation::getItem('course/forum2');
     $nav->setImage(Icon::create('forum', 'info'));
     Navigation::activateItem('course/forum2/index');
     // set page to which we shall jump
     if ($page) {
         ForumHelpers::setPage($page);
     }
     $this->section = 'search';
     $this->topic_id = $this->getId();
     $this->show_full_path = true;
     // parse filter-options
     foreach (array('search_title', 'search_content', 'search_author') as $option) {
         $this->options[$option] = Request::option($option);
     }
     $this->searchfor = Request::get('searchfor');
     if (strlen($this->searchfor) < 3) {
         $this->flash['messages'] = array('error' => _('Ihr Suchbegriff muss mindestens 3 Zeichen lang sein und darf nur Buchstaben und Zahlen enthalten!'));
     } else {
         // get search-results
         $list = ForumEntry::getSearchResults($this->getId(), $this->searchfor, $this->options);
         $this->postings = $list['list'];
         $this->number_of_entries = $list['count'];
         $this->highlight = $list['highlight'];
         if (empty($this->postings)) {
             $this->flash['messages'] = array('info' => _('Es wurden keine Beiträge gefunden, die zu Ihren Suchkriterien passen!'));
         }
     }
     // set default layout
     $layout = $GLOBALS['template_factory']->open('layouts/base');
     $this->set_layout($layout);
     // exploit the visitdate for this view
     $this->visitdate = ForumVisit::getLastVisit($this->getId());
     $this->render_action('index');
 }
Ejemplo n.º 19
0
 /**
  * Displays a single thread.
  * @param string $thread_id
  */
 public function thread_action($thread_id)
 {
     $this->thread = new BlubberPosting($thread_id);
     if ($this->thread['context_type'] === "private") {
         if (!in_array($GLOBALS['user']->id, $this->thread->getRelatedUsers())) {
             throw new AccessDeniedException("Kein Zugriff auf diesen Blubb.");
         }
     } elseif ($this->thread['context_type'] === "course") {
         if (!$GLOBALS['perm']->have_studip_perm("user", $this->thread['Seminar_id'])) {
             throw new AccessDeniedException("Kein Zugriff auf diesen Blubb.");
         }
     }
     if ($this->thread['context_type'] === "course") {
         PageLayout::setTitle($GLOBALS['SessSemName']["header_line"] . " - " . $this->plugin->getDisplayTitle());
     } elseif ($this->thread['context_type'] === "public") {
         PageLayout::setTitle(get_fullname($this->thread['user_id']) . " - Blubber");
     } elseif ($this->thread['context_type'] === "private") {
         PageLayout::setTitle(_("Privater Blubber"));
     }
     if ($this->thread['context_type'] === "course") {
         Navigation::getItem("/course/blubberforum")->setImage(Icon::create('blubber', 'info'));
         Navigation::activateItem('/course/blubberforum');
     } elseif ($this->thread['context_type'] === "public") {
         if (Navigation::hasItem('/profile')) {
             Navigation::activateItem('/profile/blubber');
         }
     } else {
         if (Navigation::hasItem('/community/blubber')) {
             Navigation::activateItem('/community/blubber');
         }
     }
     $this->course_id = $_SESSION['SessionSeminar'];
     $this->single_thread = true;
     BlubberPosting::$course_hashes = $this->thread['user_id'] !== $this->thread['Seminar_id'] ? $this->thread['Seminar_id'] : false;
 }
Ejemplo n.º 20
0
    // Entry list for admin upwards.
    if ($GLOBALS['perm']->have_studip_perm("admin", $GLOBALS['SessionSeminar'])) {
        $list = new SelectorWidget();
        $list->setUrl("?#admin_top_links");
        $list->setSelectParameterName("cid");
        foreach (AdminCourseFilter::get()->getCoursesForAdminWidget() as $seminar) {
            $list->addElement(new SelectElement($seminar['Seminar_id'], $seminar['Name']), 'select-' . $seminar['Seminar_id']);
        }
        $list->setSelection($this->course_id);
        $sidebar->addWidget($list);
    }
}
?>

<ul class="boxed-grid">
<? foreach (Navigation::getItem('/course/admin') as $name => $nav): ?>
    <? if ($nav->isVisible() && $name != 'main'): ?>
        <li>
            <a href="<?php 
echo URLHelper::getLink($nav->getURL());
?>
">
                <h3>
                    <? if ($nav->getImage()): ?>
                        <?php 
echo $nav->getImage()->asImg(false, $nav->getLinkAttributes());
?>
                    <? endif; ?>
                    <?php 
echo htmlReady($nav->getTitle());
?>
Ejemplo n.º 21
0
 /**
  * Returns the base navigation object (not its path) for the tabs.
  * May return NULL if tab display is disabled.
  */
 public static function getTabNavigation()
 {
     if (self::$tab_navigation === false) {
         self::$tab_navigation = Navigation::hasItem('/') ? Navigation::getItem('/')->activeSubNavigation() : null;
     }
     return self::$tab_navigation;
 }
Ejemplo n.º 22
0
            $sidebar->addWidget($widget);
        }

        if ($view_mode !== 'no_nav') {
            if ($SessSemName['class'] === 'sem') {
                $navigation = new Navigation(_('Zurück zur Veranstaltung'), 'seminar_main.php');
                Navigation::getItem('/resources/objects')->addSubNavigation('back', $navigation);
            }
            if ($SessSemName['class'] === 'inst') {
                $navigation = new Navigation(_('Zurück zur Einrichtung'), 'dispatch.php/institute/overview');
                Navigation::getItem('/resources/objects')->addSubNavigation('back', $navigation);
            }
        }

        $navigation = new Navigation(_('Zur Ressourcensuche'), 'resources.php?view=search&quick_view_mode=' . $view_mode);
        Navigation::getItem('/resources/objects')->addSubNavigation('search', $navigation);

        $widget = new ExportWidget();
        $widget->addLink(_('Druckansicht'),
                         URLHelper::getLink('?view=view_sem_schedule&print_view=1'), Icon::create('print', 'clickable'),
                         array('target' => '_blank'));
        $sidebar->addWidget($widget);
    break;
    case 'view_group_schedule':
        $room_groups = RoomGroups::GetInstance();
        PageLayout::setTitle(_('Belegungszeiten einer Raumgruppe pro Semester ausgeben:') . ' ' . $room_groups->getGroupName($_SESSION['resources_data']['actual_room_group']));
        Navigation::activateItem('/resources/view/group_schedule');

        $widget = new ExportWidget();
        $widget->addLink(_('Druckansicht'),
                         URLHelper::getLink('?view=view_group_schedule&print_view=1'), Icon::create('print', 'clickable'),
Ejemplo n.º 23
0
 /**
  * Returns the formatted list of skip links
  *
  * @return string the formatted list of skip links
  */
 public static function getHTML()
 {
     $html = '';
     if (UserConfig::get($GLOBALS['user']->id)->getValue('SKIPLINKS_ENABLE') && $GLOBALS['auth']->is_authenticated() && sizeof(self::$links)) {
         Navigation::addItem('/skiplinks', new Navigation(''));
         uasort(self::$links, create_function('$a, $b', 'return $a["position"] > $b["position"];'));
         $i = 1;
         $position = 0;
         $overwriteable = false;
         foreach (self::$links as $link) {
             $navigation = new Navigation($link['name'], $link['url']);
             $path = '/skiplinks/' . $i++;
             Navigation::addItem($path, $navigation);
             $position = $link['position'];
             $overwriteable = $link['overwriteable'];
         }
         $navigation = Navigation::getItem('/skiplinks');
         $html = $GLOBALS['template_factory']->render('skiplinks', compact('navigation'));
     }
     return $html;
 }
Ejemplo n.º 24
0
 public function __construct()
 {
     global $perm;
     parent::__construct();
     if (UpdateInformation::isCollecting()) {
         $data = Request::getArray("page_info");
         if (stripos(Request::get("page"), "plugins.php/blubber") !== false) {
             $output = array();
             $context_id = $data['Blubber']['context_id'];
             $stream = $data['Blubber']['stream'];
             $last_check = $data['Blubber']['last_check'] ? $data['Blubber']['last_check'] : time() - 5 * 60;
             $parameter = array('since' => $last_check);
             if ($stream === "thread") {
                 $parameter['thread'] = $context_id;
             }
             if ($stream === "course") {
                 $parameter['seminar_id'] = $context_id;
             }
             if ($stream === "profile") {
                 $parameter['user_id'] = $context_id;
             }
             if ($data['Blubber']['search']) {
                 $parameter['search'] = $data['Blubber']['search'];
             }
             $new_postings = ForumPosting::getPostings($parameter);
             $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("forum/thread.php");
                     $template->set_attribute('thread', $new_posting);
                 } else {
                     $thread = new ForumPosting($new_posting['root_id']);
                     $template = $factory->open("forum/comment.php");
                     $template->set_attribute('posting', $new_posting);
                 }
                 ForumPosting::$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'], '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("/course") && $this->isActivated() && version_compare($GLOBALS['SOFTWARE_VERSION'], "2.4") <= 0) {
         $tab = new AutoNavigation($this->getDisplayTitle(), PluginEngine::getLink($this, array(), "forum/forum"));
         $tab->setImage($this->getPluginURL() . "/assets/images/blubber_white.png");
         Navigation::addItem("/course/blubberforum", $tab);
     }
     if (Navigation::hasItem("/community")) {
         $nav = new AutoNavigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "forum/globalstream"));
         Navigation::insertItem("/community/blubber", $nav, "online");
         Navigation::getItem("/community")->setURL(PluginEngine::getURL($this, array(), "forum/globalstream"));
     }
     if (Navigation::hasItem("/profile")) {
         $nav = new AutoNavigation(_("Blubber"), PluginEngine::getURL($this, array('user_id' => get_userid(Request::get("username"))), "forum/profile"));
         Navigation::addItem("/profile/blubber", $nav);
     }
 }
Ejemplo n.º 25
0
 public function __construct()
 {
     parent::__construct();
     // instantiate patching template factory
     $GLOBALS['template_factory'] = new VHS\PatchTemplateFactory($GLOBALS['template_factory'], realpath($this->getPluginPath() . '/templates'));
     global $perm;
     $username = Request::get('username', $auth->auth['uname']);
     PageLayout::addStylesheet($this->getPluginUrl() . '/css/startseite.css');
     PageLayout::addStylesheet($this->getPluginUrl() . '/css/courseware.css');
     //falls Mooc.IP aktiviert ist, Icon aus der Kopfzeile ausblenden
     if (Navigation::hasItem('/mooc')) {
         Navigation::removeItem('/mooc');
     }
     if (!$perm->have_perm('admin') && $perm->get_perm() != 'nobody') {
         if (Navigation::hasItem('/search')) {
             Navigation::removeItem('/search');
         }
         if (Navigation::hasItem('/tools')) {
             if (!$perm->have_perm('dozent')) {
                 if (Navigation::hasItem('/tools/elearning')) {
                     Navigation::removeItem('/tools/elearning');
                 }
                 if (Navigation::hasItem('/tools/evaluation')) {
                     Navigation::removeItem('/tools/evaluation');
                 }
             }
         }
         /**		
         			if (Navigation::hasItem('/course/main/courses')){
         			//	Navigation::removeItem('/course/main/courses');
         			}
         			
         			if (Navigation::hasItem('/course/main/schedule')){
         			//	Navigation::removeItem('/course/main/schedule');
         			}
         		**/
         if (Navigation::hasItem('/tools')) {
             Navigation::getItem('/tools')->setImage(NULL);
         }
         if (Navigation::hasItem('/tools/rss')) {
             Navigation::removeItem('/tools/rss');
         }
         if (Navigation::hasItem('/tools/literature')) {
             Navigation::removeItem('/tools/literature');
         }
         if (Navigation::hasItem('/profile/edit/study_data')) {
             Navigation::removeItem('/profile/edit/study_data');
         }
         if (Navigation::hasItem('/start/search')) {
             Navigation::removeItem('/start/search');
         }
         if (Navigation::hasItem('/browse')) {
             $stmt = DBManager::get()->prepare("SELECT su.seminar_id FROM seminar_user su\n\t\t\t\t\tWHERE su.user_id = ?");
             $stmt->execute(array($GLOBALS['user']->id));
             $count = $stmt->rowCount();
             if ($count == 1) {
                 $result = $stmt->fetch();
                 Navigation::getItem('/browse')->setURL("/seminar_main.php?auswahl=" . $result['seminar_id']);
                 Navigation::getItem('/browse')->setTitle("Mein Kurs");
             }
             if ($count == 0 && !$perm->have_perm('tutor')) {
                 Navigation::removeItem('/browse');
             }
         }
         if (Navigation::hasItem('/course')) {
             $stmt = DBManager::get()->prepare("SELECT su.seminar_id FROM seminar_user su\n\t\t\t\t\tWHERE su.user_id = ?");
             $stmt->execute(array($GLOBALS['user']->id));
             $count = $stmt->rowCount();
             if ($count == 1) {
                 $result = $stmt->fetch();
                 Navigation::getItem('/course')->setURL("/seminar_main.php?auswahl=" . $result['seminar_id']);
                 Navigation::getItem('/course')->setTitle("Mein Kurs");
             }
         }
         if (Navigation::hasItem('/start/my_courses')) {
             if (Navigation::hasItem('/start/my_courses/browse')) {
                 Navigation::removeItem('/start/my_courses/browse');
             }
             if (Navigation::hasItem('/start/my_courses/new_studygroup')) {
                 Navigation::removeItem('/start/my_courses/new_studygroup');
             }
             if (Navigation::hasItem('/start/tools')) {
                 Navigation::removeItem('/start/tools');
             }
             $stmt = DBManager::get()->prepare("SELECT su.seminar_id FROM seminar_user su\n\t\t\t\t\tWHERE su.user_id = ?");
             $stmt->execute(array($GLOBALS['user']->id));
             $count = $stmt->rowCount();
             if ($count == 1) {
                 $result = $stmt->fetch();
                 Navigation::getItem('/start/my_courses')->setURL("/seminar_main.php?auswahl=" . $result['seminar_id']);
                 Navigation::getItem('/start/my_courses')->setTitle("Mein Kurs");
             }
             if ($count == 0) {
                 Navigation::removeItem('/start/my_courses');
             }
             if ($count > 1) {
                 Navigation::getItem('/start/my_courses')->setTitle("Kurse");
             }
         }
         if (Navigation::hasItem('/start/community/browse')) {
             Navigation::removeItem('/start/community/browse');
         }
         if (Navigation::hasItem('/start/community/score')) {
             Navigation::removeItem('/start/community/score');
         }
     }
     //Aus irgendeinem Grund wird das hier immer aufgerufen und oben geht er auch bei 'nobody' in die if-Schleife
     /**if ($my_about->auth_user['perms'] == 'nobody'){
     			if (Navigation::hasItem('/course/main/courses')){
     				Navigation::removeItem('/course/main/courses');
     			}
     			
     			if (Navigation::hasItem('/course/main/schedule')){
     				Navigation::removeItem('/course/main/schedule');
     			}
     		}
                      * 
                      */
 }
Ejemplo n.º 26
0
 /**
  * Returns a breadcrumb path of the currently active navigation.
  *
  * @return Array List of currently active navigation items.
  */
 private function getBreadCrumbs($navigation = null)
 {
     if ($navigation === null) {
         $navigation = Navigation::getItem('/');
     }
     $breadcrumbs = array();
     foreach ($navigation as $idx => $nav) {
         if ($nav->isActive()) {
             $breadcrumbs[$idx] = $nav;
             if ($nav->activeSubnavigation()) {
                 $breadcrumbs = array_merge($breadcrumbs, $this->getBreadCrumbs($nav));
             }
         }
     }
     return $breadcrumbs;
 }
Ejemplo n.º 27
0
# Lifter010: TODO
?>
<!-- Startseite (nicht eingeloggt) -->
<? if ($logout) : ?>
    <?php 
echo MessageBox::success(_("Sie sind nun aus dem System abgemeldet."), array($GLOBALS['UNI_LOGOUT_ADD']));
?>
<? endif; ?>

<div class="index_main">
    <nav>
        <h1><?php 
echo htmlReady($GLOBALS['UNI_NAME_CLEAN']);
?>
</h1>
        <? foreach (Navigation::getItem('/login') as $key => $nav) : ?>
            <? if ($nav->isVisible()) : ?>
                <? list($name, $title) = explode(' - ', $nav->getTitle()) ?>
                <div class="login_link">
                    <? if (is_internal_url($url = $nav->getURL())) : ?>
                        <a href="<?php 
echo URLHelper::getLink($url);
?>
">
                    <? else : ?>
                        <a href="<?php 
echo htmlReady($url);
?>
" target="_blank">
                    <? endif ?>
                    <? SkipLinks::addLink($name, $url) ?>
Ejemplo n.º 28
0
            <?php 
echo sprintf('%u db queries', DBManager::get()->query_count);
?>
            /
            <?php 
echo relsize(memory_get_peak_usage(true), false);
?>
 mem
        ]
    <? endif; ?>
    </div>
<? endif; ?>

<? if (Navigation::hasItem('/footer')) : ?>
    <ul>
    <? foreach (Navigation::getItem('/footer') as $nav): ?>
        <? if ($nav->isVisible()): ?>
            <li>
            <a
            <? if (is_internal_url($url = $nav->getURL())) : ?>
                href="<?php 
echo URLHelper::getLink($url, $header_template->link_params);
?>
"
            <? else: ?>
                href="<?php 
echo htmlReady($url);
?>
" target="_blank"
            <? endif ?>
            ><?php 
Ejemplo n.º 29
0
 public function thread_action($thread_id)
 {
     PageLayout::addHeadElement("script", array('src' => $this->assets_url . "/javascripts/autoresize.jquery.min.js"), "");
     PageLayout::addHeadElement("script", array('src' => $this->assets_url . "/javascripts/blubberforum.js"), "");
     PageLayout::addHeadElement("script", array('src' => $this->assets_url . "/javascripts/formdata.js"), "");
     $this->thread = new ForumPosting($thread_id);
     if ($this->thread['context_type'] === "course") {
         PageLayout::setTitle($GLOBALS['SessSemName']["header_line"] . " - " . $this->plugin->getDisplayTitle());
     } elseif ($this->thread['context_type'] === "public") {
         PageLayout::setTitle(get_fullname($this->thread['user_id']) . " - Blubber");
     } elseif ($this->thread['context_type'] === "private") {
         PageLayout::setTitle(_("Privater Blubber"));
     }
     if ($this->thread['context_type'] === "course") {
         Navigation::getItem("/course/blubberforum")->setImage($this->plugin->getPluginURL() . "/assets/images/blubber.png");
         Navigation::activateItem('/course/blubberforum');
     } elseif ($this->thread['context_type'] === "public") {
         Navigation::activateItem('/profile/blubber');
     } else {
         Navigation::activateItem('/community/blubber');
     }
     $this->course_id = $_SESSION['SessionSeminar'];
     $this->single_thread = true;
     ForumPosting::$course_hashes = $thread['user_id'] !== $thread['Seminar_id'] ? $thread['Seminar_id'] : false;
 }
Ejemplo n.º 30
0
            }
        }
    }

    $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["reload"] = TRUE;
    //hmm, zu früh an dieser Stelle. Notwendig?
    //page_close(NULL);
}

//handle values
include ("$RELATIVE_PATH_RESOURCES/lib/evaluate_values.php");
/*****************************************************************************
Navigation aufbauen
/*****************************************************************************/

$resources_nav = Navigation::getItem('/resources');

// Reiter "Uebersicht"
$navigation = new Navigation(_('Übersicht'));
$navigation->addSubNavigation('hierarchy', new Navigation(_('Struktur'), 'resources.php#a', array('view' => 'resources')));

if (get_config('RESOURCES_ENABLE_GROUPING')) {
    $navigation->addSubNavigation('group_schedule_daily', new Navigation(_('Gruppen-Belegungspläne'), 'resources.php', array('view' => 'view_group_schedule_daily')));
    $navigation->addSubNavigation('group_schedule', new Navigation(_('Gruppen-Belegungspläne (Semester)'), 'resources.php', array('view' => 'view_group_schedule')));
}

if (get_config('RESOURCES_ALLOW_CREATE_TOP_LEVEL') || getGlobalPerms($user->id) == 'admin') {
    $navigation->addSubNavigation('create_entry', new Navigation(_('Neue Hierarchieebene erzeugen'), 'resources.php#a', array('view' => 'create_hierarchie')));
}

$resources_nav->addSubNavigation('view', $navigation);