Exemple #1
0
function startpage_redirect($page_code)
{
    switch ($page_code) {
        case 1:
        case 2:
            $jump_page = "dispatch.php/my_courses";
            break;
        case 3:
            $jump_page = "dispatch.php/calendar/schedule";
            break;
        case 4:
            $jump_page = "dispatch.php/contact";
            break;
        case 5:
            $jump_page = "dispatch.php/calendar/single";
            break;
        case 6:
            // redirect to global blubberstream
            // or no redirection if blubber isn't active
            if (PluginEngine::getPlugin("Blubber")) {
                $jump_page = "plugins.php/blubber/streams/global";
            }
            break;
    }
    page_close();
    header("location: {$jump_page}");
    exit;
}
 /**
 * constructor
 *
 * @access public
 */
 function StudipSemTreeViewAdmin($start_item_id = "root"){
     $this->start_item_id = ($start_item_id) ? $start_item_id : "root";
     $this->root_content = $GLOBALS['UNI_INFO'];
     parent::TreeView("StudipSemTree"); //calling the baseclass constructor
     $this->studienmodulmanagement = PluginEngine::getPlugin('StudienmodulManagement');
     URLHelper::bindLinkParam("_marked_item", $this->marked_item);
     $this->marked_sem =& $_SESSION['_marked_sem'];
     $this->parseCommand();
 }
 /**
  * constructor
  *
  * @access public
  */
 function StudipSemTreeViewSimple($start_item_id = "root", $sem_number = false, $sem_status, $visible_only = false)
 {
     $this->start_item_id = $start_item_id ? $start_item_id : "root";
     $this->root_content = $GLOBALS['UNI_INFO'];
     $args = null;
     if ($sem_number !== false) {
         $args['sem_number'] = $sem_number;
     }
     if ($sem_status !== false) {
         $args['sem_status'] = $sem_status;
     }
     $args['visible_only'] = $visible_only;
     $this->tree = TreeAbstract::GetInstance("StudipSemTree", $args);
     $this->tree->enable_lonely_sem = false;
     if (!$this->tree->tree_data[$this->start_item_id]) {
         $this->start_item_id = "root";
     }
     $this->studienmodulmanagement = PluginEngine::getPlugin('StudienmodulManagement');
 }
Exemple #4
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']));
         }
     }
 }
Exemple #5
0
 private function deleteContent($plugmodlist)
 {
     $name = Request::Get('name');
     foreach ($plugmodlist as $key => $val) {
         if (array_key_exists($name, $val)) {
             if ($val[$name]['type'] == 'plugin') {
                 $class = PluginEngine::getPlugin(get_class($val[$name]['object']));
                 $displayname = $class->getPluginName();
             } elseif ($val[$name]['type'] == 'modul') {
                 if ($this->sem_class) {
                     $class = $this->sem_class->getModule($this->sem_class->getSlotModule($val[$name]['modulkey']));
                     $displayname = $val[$name]['object']['name'];
                 }
             }
         }
     }
     if (Request::submitted('check')) {
         if (method_exists($class, 'deleteContent')) {
             $class->deleteContent();
         } else {
             PageLayout::postMessage(MessageBox::info(_("Das Plugin/Modul enthält keine Funktion zum Löschen der Inhalte.")));
         }
     } else {
         PageLayout::postMessage(MessageBox::info(sprintf(_("Sie beabsichtigen die Inhalte von %s zu löschen."), $displayname) . "<br>" . _("Wollen Sie die Inhalte wirklich löschen?") . "<br>" . LinkButton::createAccept(_('Ja'), URLHelper::getURL("?deleteContent=true&check=true&name=" . $name)) . LinkButton::createCancel(_('Nein'))));
     }
 }
Exemple #6
0
 /**
  * returns an instance of the module of a given slotname or pluginclassname
  * @param string $slot_or_plugin
  * @return StudipModule | null
  */
 public function getModule($slot_or_plugin)
 {
     $module = $this->getSlotModule($slot_or_plugin);
     if ($module && $this->isModuleAllowed($module)) {
         if (in_array($module, self::$core_modules)) {
             return new $module();
         }
         if ($module) {
             return PluginEngine::getPlugin($module);
         }
     }
 }
Exemple #7
0
 */
require '../lib/bootstrap.php';
# set base url for URLHelper class
URLHelper::setBaseUrl($CANONICAL_RELATIVE_PATH_STUDIP);
# initialize Stud.IP-Session
page_open(array('sess' => 'Seminar_Session', 'auth' => 'Seminar_Default_Auth', 'perm' => 'Seminar_Perm', 'user' => 'Seminar_User'));
try {
    require_once 'lib/seminar_open.php';
    # get plugin class from request
    $dispatch_to = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
    list($plugin_class, $unconsumed) = PluginEngine::routeRequest($dispatch_to);
    # retrieve corresponding plugin info
    $plugin_manager = PluginManager::getInstance();
    $plugin_info = $plugin_manager->getPluginInfo($plugin_class);
    # create an instance of the queried plugin
    $plugin = PluginEngine::getPlugin($plugin_class);
    # user is not permitted, show login screen
    if (is_null($plugin)) {
        # TODO (mlunzena) should not getPlugin throw this exception?
        throw new AccessDeniedException(_('Sie besitzen keine Rechte zum Aufruf dieses Plugins.'));
    }
    // set default page title
    PageLayout::setTitle($plugin->getPluginName());
    if (is_callable(array($plugin, 'initialize'))) {
        $plugin->initialize();
    }
    # let the show begin
    $plugin->perform($unconsumed);
} catch (AccessDeniedException $ade) {
    global $auth;
    $auth->login_if($auth->auth["uid"] == "nobody");
 /**
  * returns a HTML snippet for the info icon if this study area is a module
  * and if there is a compatible plugin available
  *
  * @param string $semester_id
  * @return string
  */
 function getModuleInfoHTML($semester_id = '')
 {
     $ret = '';
     if ($this->isModule() && ($plugin = PluginEngine::getPlugin('StudienmodulManagement'))) {
         $nav = $plugin->getModuleInfoNavigation($this->getID(), $semester_id);
         if ($nav->isVisible(true)) {
             $ret = '<a class="module-info" href="' . URLHelper::getLink($nav->getURL()) . '">';
             $ret .= $nav->getImage()->asImg($nav->getLinkAttributes);
             $ret .= '<span>' . htmlready($nav->getTitle()) . '</span>';
             $ret .= '</a>';
         }
     }
     return $ret;
 }