/**
  * Initialize a new instance of the plugin.
  */
 function __construct()
 {
     parent::__construct();
     if (Config::get()->WYSIWYG && is_object($GLOBALS['user'])) {
         if (strpos($_SERVER['REQUEST_URI'], 'dispatch.php/settings/general') !== false) {
             if (Request::submitted('forced_language')) {
                 $GLOBALS['user']->cfg->store('WYSIWYG_DISABLE', Request::submitted('wysiwyg_user_config'));
             }
             $snippet = '
             <tr>
                 <td>
                     <label for="wysiwyg_user_config">
                         WYSIWYG Editor ausschalten<br>
                         <dfn id="cookie_auth_token_description">
                             Mit dieser Einstellung können Sie den Stud.IP WYSIWYG Editor ausschalten. Dadurch müssen Sie ggf. Texte in HTML schreiben.
                         </dfn>
                     </label>
                 </td>
                 <td>
                     <input type="checkbox" value="1" aria-describedby="wysiwyg_user_config" id="wysiwyg_user_config" name="wysiwyg_user_config" ' . ($GLOBALS['user']->cfg->WYSIWYG_DISABLE ? 'checked' : '') . '>
                 </td>
             </tr>';
             $snippet = jsready($snippet, 'script-double');
             PageLayout::addHeadElement('script', array('type' => 'text/javascript'), "jQuery(function (\$) {\$('#main_content tbody tr').first().after('{$snippet}');});");
         }
         if (!(Config::get()->WYSIWYG = !$GLOBALS['user']->cfg->WYSIWYG_DISABLE)) {
             $old_packages = array_flip(PageLayout::getSqueezePackages());
             unset($old_packages['wysiwyg']);
             call_user_func_array('PageLayout::setSqueezePackages', array_values(array_flip($old_packages)));
         }
     }
 }
 function __construct()
 {
     parent::__construct();
     if (is_object($GLOBALS['perm']) && $GLOBALS['perm']->have_perm('admin')) {
         $navigation = new Navigation(_("Veranstaltungs-Vervielfältiger"), PluginEngine::getUrl($this, array(), 'index'));
         Navigation::insertItem('/start/replicator', $navigation, 'search');
     }
 }
Exemple #3
0
 /**
  * This method dispatches all actions.
  *
  * @param string $unconsumed_path  part of the dispatch path that was not consumed
  */
 public function perform($unconsumed_path)
 {
     $this->setupAutoload();
     // Add JS and StyleSheet to header
     PageLayout::addScript($this->getPluginURL() . '/javascript/forum.js');
     PageLayout::addStylesheet($this->getPluginURL() . '/stylesheets/forum.css');
     parent::perform($unconsumed_path);
 }
 function perform($unconsumed_path)
 {
     try {
         parent::perform($unconsumed_path);
     } catch (Exception $exception) {
         if ($exception instanceof Trails_Exception) {
             $status = $exception->getCode();
         } else {
             $status = 500;
         }
         header('HTTP/1.1 ' . $status . ' ' . $exception->getMessage());
         $this->render_json(array('status' => (int) $status, 'message' => $exception->getMessage()));
     }
 }
 function __construct()
 {
     parent::__construct();
     $this->me = strtolower(__CLASS__);
 }
Exemple #6
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');
     			}
     		}
                      * 
                      */
 }