コード例 #1
0
 public function actionManage()
 {
     $model = new Sidebar('search');
     $model->unsetAttributes();
     if (isset($_GET['Sidebar'])) {
         $model->attributes = $_GET['Sidebar'];
     }
     $this->render('manage', ['model' => $model]);
 }
コード例 #2
0
ファイル: courseset.php プロジェクト: ratbird/hope
 /**
  * Things to do before every page load.
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // AJAX request, so no page layout.
     if (Request::isXhr()) {
         $this->via_ajax = true;
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
         // Open base layout for normal
     } else {
         $layout = $GLOBALS['template_factory']->open('layouts/base');
         $this->set_layout($layout);
         PageLayout::setTitle(_('Anmeldesets'));
         // Get only own courses if user doesn't have permission to edit institute-wide coursesets.
         $this->onlyOwnCourses = true;
         if ($GLOBALS['perm']->have_perm('admin') || $GLOBALS['perm']->have_perm('dozent') && get_config('ALLOW_DOZENT_COURSESET_ADMIN')) {
             // We have access to institute-wide course sets, so all courses may be assigned.
             $this->onlyOwnCourses = false;
             Navigation::activateItem('/tools/coursesets/sets');
         } else {
             throw new AccessDeniedException();
         }
     }
     PageLayout::addSqueezePackage('admission');
     $this->set_content_type('text/html;charset=windows-1252');
     $views = new ViewsWidget();
     $views->setTitle(_('Aktionen'));
     $views->addLink(_('Anmeldeset anlegen'), $this->url_for('admission/courseset/configure'))->setActive($action == 'configure');
     Sidebar::Get()->addWidget($views);
 }
コード例 #3
0
ファイル: score.php プロジェクト: ratbird/hope
 /**
  * Displays the global ranking list.
  *
  * @param int $page Page of the ranking list to be displayed.
  */
 public function index_action($page = 1)
 {
     $vis_query = get_vis_query('b');
     // Calculate offsets
     $max_per_page = get_config('ENTRIES_PER_PAGE');
     if ($page < 1) {
         $page = 1;
     }
     $offset = max(0, ($page - 1) * $max_per_page);
     // Liste aller die mutig (oder eitel?) genug sind
     $query = "SELECT SQL_CALC_FOUND_ROWS a.user_id,username,score,geschlecht, {$GLOBALS['_fullname_sql']['full']} AS fullname\n                  FROM user_info AS a\n                  LEFT JOIN auth_user_md5 AS b USING (user_id)\n                  WHERE score > 0 AND locked = 0 AND {$vis_query}\n                  ORDER BY score DESC\n                  LIMIT " . (int) $offset . "," . (int) $max_per_page;
     $result = DBManager::get()->fetchAll($query);
     $count = DBManager::get()->fetchColumn("SELECT FOUND_ROWS()");
     $persons = array();
     foreach ($result as $row) {
         $row['is_king'] = StudipKing::is_king($row['user_id'], true);
         $persons[$row['user_id']] = $row;
     }
     $persons = Score::getScoreContent($persons);
     $this->persons = array_values($persons);
     $this->numberOfPersons = $count;
     $this->page = $page;
     $this->offset = $offset;
     $this->max_per_page = $max_per_page;
     $this->current_user = User::findCurrent();
     $this->current_user_score = Score::getMyScore($this->current_user);
     // Set up sidebar and helpbar
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/medal-sidebar.png');
     $actions = new OptionsWidget();
     $actions->addCheckbox(_('Ihren Wert veröffentlichen'), $this->current_user->score, $this->url_for('score/publish'), $this->url_for('score/unpublish'));
     $sidebar->addWidget($actions);
     $helpbar = Helpbar::get();
 }
コード例 #4
0
ファイル: show.php プロジェクト: anantace/SCMTabs
 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     $this->priviledged = $GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1]);
     if (Request::isXhr()) {
         $this->set_content_type('text/html;charset=Windows-1252');
     } else {
         $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     }
     if (!in_array($action, words('index create edit move delete'))) {
         array_unshift($args, $action);
         $action = 'index';
     }
     if (in_array($action, words('create edit move delete')) && !$this->priviledged) {
         throw new AccessDeniedException(_('Sie sind nicht berechtigt, auf diesen Bereich zuzugreifen'));
     }
     if ($GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1])) {
         $widget = new ActionsWidget();
         $widget->addLink(_('Neuen Eintrag anlegen'), $this->url_for('show/create'), 'icons/16/blue/add.png')->asDialog();
         Sidebar::get()->addWidget($widget);
     }
     PageLayout::setHelpKeyword('Basis.Informationsseite');
     /**
             checkObject(); // do we have an open object?
             checkObjectModule('scm');
             object_set_visit_module('scm');
     	 **/
 }
コード例 #5
0
ファイル: lockrules.php プロジェクト: ratbird/hope
 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     global $perm, $template_factory;
     parent::before_filter($action, $args);
     $perm->check(Config::get()->LOCK_RULE_ADMIN_PERM ? Config::get()->LOCK_RULE_ADMIN_PERM : 'admin');
     $layout = $template_factory->open('layouts/base');
     $this->set_layout($layout);
     PageLayout::setTitle(_('Verwaltung der Sperrebenen'));
     Navigation::activateItem('/admin/locations/lock_rules');
     URLHelper::bindLinkParam('lock_rule_type', $this->lock_rule_type);
     if (!$this->lock_rule_type || !$GLOBALS['perm']->have_perm('root')) {
         $this->lock_rule_type = 'sem';
     }
     if ($this->lock_rule_type == 'sem') {
         $this->lock_rule_permissions = $GLOBALS['perm']->have_perm('root') ? array('tutor', 'dozent', 'admin', 'root') : array('tutor', 'dozent');
     } elseif ($this->lock_rule_type == 'inst') {
         $this->lock_rule_permissions = array('admin', 'root');
     } elseif ($this->lock_rule_type == 'user') {
         $this->lock_rule_permissions = array('tutor', 'dozent', 'admin', 'root');
     }
     $this->rule_type_names = array('sem' => _('Veranstaltung'), 'inst' => _('Einrichtung'), 'user' => _('Person'));
     $this->sidebar = Sidebar::Get();
     $this->sidebar->setTitle(_('Sperrebenen'));
     $this->sidebar->setImage('sidebar/lock-sidebar.png');
 }
コード例 #6
0
 public function initialize()
 {
     PageLayout::addSqueezePackage('lightbox');
     $this->addStylesheet('assets/pluginmarket.less');
     PageLayout::addHeadElement('link', array('rel' => 'alternate', 'type' => 'application/rss+xml', 'href' => PluginEngine::getLink($this, array(), 'rss/newest'), 'title' => _('Neueste Plugins')));
     $sidebar = Sidebar::Get();
     $sidebar->setImage('../../' . $this->getPluginPath() . '/assets/sidebar-marketplace.png');
 }
コード例 #7
0
ファイル: authorizations.php プロジェクト: ratbird/hope
 /**
  *
  **/
 public function index_action()
 {
     $this->consumers = RESTAPI\UserPermissions::get($GLOBALS['user']->id)->getConsumers();
     $this->types = array('website' => _('Website'), 'program' => _('Herkömmliches Desktopprogramm'), 'app' => _('Mobile App'));
     $widget = new SidebarWidget();
     $widget->setTitle(_('Informationen'));
     $widget->addElement(new WidgetElement(_('Dies sind die Apps, die Zugriff auf Ihren Account haben.')));
     Sidebar::Get()->addWidget($widget);
 }
コード例 #8
0
ファイル: account.php プロジェクト: ratbird/hope
 /**
  * Set up this controller and define the infobox
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setHelpKeyword('Basis.HomepagePersönlicheDaten');
     PageLayout::setTitle(_('Benutzerkonto bearbeiten'));
     Navigation::activateItem('/profile/edit/profile');
     SkipLinks::addIndex(_('Benutzerkonto bearbeiten'), 'layout_content');
     Sidebar::get()->setImage('sidebar/person-sidebar.png');
 }
コード例 #9
0
ファイル: group.php プロジェクト: ratbird/hope
 protected function createSidebar($active = 'week', $calendar = null)
 {
     parent::createSidebar($active, $calendar);
     $sidebar = Sidebar::Get();
     $actions = new ActionsWidget();
     $actions->addLink(_('Termin anlegen'), $this->url_for('calendar/group/edit'), Icon::create('add', 'clickable'), array('data-dialog' => 'size=auto'));
     $actions->addLink(_('Kalender freigeben'), $this->url_for('calendar/single/manage_access/' . $GLOBALS['user']->id, array('group_filter' => $this->range_id)), Icon::create('community', 'clickable'), array('id' => 'calendar-open-manageaccess', 'data-dialog' => '', 'data-dialogname' => 'manageaccess'));
     $sidebar->addWidget($actions);
 }
コード例 #10
0
ファイル: overview.php プロジェクト: ratbird/hope
 /**
  * show institute overview page
  *
  * @return void
  */
 function index_action()
 {
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage('sidebar/institute-sidebar.png');
     if (get_config('NEWS_RSS_EXPORT_ENABLE') && $this->institute_id) {
         $rss_id = StudipNews::GetRssIdFromRangeId($this->institute_id);
         if ($rss_id) {
             PageLayout::addHeadElement('link', array('rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => 'RSS', 'href' => 'rss.php?id=' . $rss_id));
         }
     }
     URLHelper::bindLinkParam("inst_data", $this->institut_main_data);
     // (un)subscribe to institute
     if (Config::get()->ALLOW_SELFASSIGN_INSTITUTE && $GLOBALS['user']->id !== 'nobody' && !$GLOBALS['perm']->have_perm('admin')) {
         $widget = new ActionsWidget();
         if (!$GLOBALS['perm']->have_studip_perm('user', $this->institute_id)) {
             $url = URLHelper::getLink('dispatch.php/institute/overview', array('follow_inst' => 'on'));
             $widget->addLink(_('Einrichtung abonnieren'), $url);
         } elseif (!$GLOBALS['perm']->have_studip_perm('autor', $this->institute_id)) {
             $url = URLHelper::getLink('dispatch.php/institute/overview', array('follow_inst' => 'off'));
             $widget->addLink(_('Austragen aus der Einrichtung'), $url);
         }
         $this->sidebar->addWidget($widget);
         if (!$GLOBALS['perm']->have_studip_perm('user', $this->institute_id) and Request::option('follow_inst') == 'on') {
             $query = "INSERT IGNORE INTO user_inst\n                          (user_id, Institut_id, inst_perms)\n                          VALUES (?, ?, 'user')";
             $statement = DBManager::get()->prepare($query);
             $statement->execute(array($GLOBALS['user']->user_id, $this->institute_id));
             if ($statement->rowCount() > 0) {
                 log_event('INST_USER_ADD', $this->institute_id, $GLOBALS['user']->user_id, 'user');
                 PageLayout::postMessage(MessageBox::success(_("Sie haben die Einrichtung abonniert.")));
                 header('Location: ' . URLHelper::getURL('', array('cid' => $this->institute_id)));
                 die;
             }
         } elseif (!$GLOBALS['perm']->have_studip_perm('autor', $this->institute_id) and Request::option('follow_inst') == 'off') {
             $query = "DELETE FROM user_inst\n                          WHERE user_id = ?  AND Institut_id = ?";
             $statement = DBManager::get()->prepare($query);
             $statement->execute(array($GLOBALS['user']->user_id, $this->institute_id));
             if ($statement->rowCount() > 0) {
                 log_event('INST_USER_DEL', $this->institute_id, $GLOBALS['user']->user_id, 'user');
                 PageLayout::postMessage(MessageBox::success(_("Sie haben sich aus der Einrichtung ausgetragen.")));
                 header('Location: ' . URLHelper::getURL('', array('cid' => $this->institute_id)));
                 die;
             }
         }
     }
     // Fetch news
     $response = $this->relay('news/display/' . $this->institute_id);
     $this->news = $response->body;
     // Fetch  votes
     if (get_config('VOTE_ENABLE')) {
         $response = $this->relay('questionnaire/widget/' . $this->institute_id . '/institute');
         $this->questionnaires = $response->body;
     }
     // Fetch dates
     $response = $this->relay("calendar/contentbox/display/{$this->institute_id}/1210000");
     $this->dates = $response->body;
 }
コード例 #11
0
ファイル: userdomains.php プロジェクト: ratbird/hope
 /**
  * Set up this controller.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setHelpKeyword('Basis.HomepageNutzerdomänen');
     PageLayout::setTitle(_('Nutzerdomänen bearbeiten'));
     Navigation::activateItem('/profile/edit/userdomains');
     SkipLinks::addIndex(_('Zugeordnete Nutzerdomänen'), 'assigned_userdomains');
     SkipLinks::addIndex(_('Nutzerdomäne auswählen'), 'select_userdomains');
     Sidebar::get()->setImage('sidebar/admin-sidebar.png');
 }
コード例 #12
0
ファイル: studygroup.php プロジェクト: ratbird/hope
 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');
 }
コード例 #13
0
ファイル: elearning.php プロジェクト: ratbird/hope
 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!Config::Get()->ELEARNING_INTERFACE_ENABLE) {
         throw new AccessDeniedException(_('Elearning-Interface ist nicht aktiviert.'));
     } else {
         $this->elearning_active = true;
     }
     PageLayout::setHelpKeyword('Basis.Ilias');
     PageLayout::setTitle($_SESSION['SessSemName']["header_line"] . " - " . _("Lernmodule"));
     checkObject();
     // do we have an open object?
     checkObjectModule('elearning_interface');
     object_set_visit_module('elearning_interface');
     $this->search_key = Request::get('search_key');
     $GLOBALS['search_key'] = $this->search_key;
     $this->cms_select = Request::quoted('cms_select');
     $GLOBALS['cms_select'] = $this->cms_select;
     $this->open_all = Request::get('open_all');
     $this->close_all = Request::get('close_all');
     $this->new_account_cms = Request::get('new_account_cms');
     $this->module_system_type = Request::get('module_system_type');
     $this->module_id = Request::get('module_id');
     $this->module_type = Request::get('module_type');
     $this->anker_target = Request::get('anker_target');
     $this->seminar_id = $_SESSION['SessSemName'][1];
     $this->rechte = $GLOBALS['perm']->have_studip_perm('tutor', $this->seminar_id);
     if (!isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->new_account_cms])) {
         unset($this->new_account_cms);
     }
     if (!isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_select])) {
         unset($this->cms_select);
     }
     if ($this->seminar_id != $_SESSION['elearning_open_close']["id"]) {
         unset($_SESSION['cache_data']);
         unset($_SESSION['elearning_open_close']);
     }
     if ($this->open_all != "") {
         $_SESSION['elearning_open_close']["all open"] = true;
     } elseif ($this->close_all != "") {
         $_SESSION['elearning_open_close']["all open"] = "";
     }
     $_SESSION['elearning_open_close']["type"] = "seminar";
     $_SESSION['elearning_open_close']["id"] = $this->seminar_id;
     if (Request::get('do_open')) {
         $this->anker_target = Request::get('do_open');
         $_SESSION['elearning_open_close'][Request::get('do_open')] = true;
     } elseif (Request::get('do_close')) {
         $this->anker_target = Request::get('do_close');
         $_SESSION['elearning_open_close'][Request::get('do_close')] = false;
     }
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage('sidebar/learnmodule-sidebar.png');
     $this->sidebar->setContextAvatar(CourseAvatar::getAvatar($this->seminar_id));
 }
コード例 #14
0
ファイル: blog.php プロジェクト: googlecode-mirror/s7ncms
 public function __construct()
 {
     parent::__construct();
     $this->head->link->append(url::current_site('feed'));
     if (config::get('blog.enable_tagcloud') === 'yes') {
         $tags = ORM::factory('blog_post')->tags();
         if (!empty($tags)) {
             Sidebar::instance()->add('Tagcloud', array('tags' => $tags));
         }
     }
 }
コード例 #15
0
ファイル: questionnaire.php プロジェクト: ratbird/hope
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (Navigation::hasItem("/tools/questionnaire")) {
         Navigation::activateItem("/tools/questionnaire");
     }
     Sidebar::Get()->setImage(Assets::image_path("sidebar/evaluation-sidebar.png"));
     PageLayout::setTitle(_("Fragebögen"));
     class_exists("Test");
     //trigger autoloading
 }
コード例 #16
0
ファイル: my_studygroups.php プロジェクト: ratbird/hope
 public function set_sidebar()
 {
     $sidebar = Sidebar::Get();
     $sidebar->setImage('sidebar/studygroup-sidebar.png');
     $sidebar->setTitle(_('Meine Studiengruppen'));
     if (count($this->studygroups) > 0) {
         $setting_widget = new ActionsWidget();
         $setting_widget->setTitle(_("Aktionen"));
         $setting_widget->addLink(_('Farbgruppierung ändern'), URLHelper::getLink('dispatch.php/my_courses/groups/all/true'), Icon::create('group4', 'clickable'), array('data-dialog' => 'buttons=true'));
         $sidebar->addWidget($setting_widget);
     }
 }
コード例 #17
0
ファイル: Contratos.php プロジェクト: adrisonluz/syschool
 public function __construct()
 {
     parent::__construct();
     $this->setTitle('Aline Rosa | Contratos');
     $this->setSector('Contratos');
     $this->dados['sector'] = $this->getSector();
     $this->setModel('Contrato', 'contrato_model');
     //$this->load->model('Model', '', TRUE);
     $this->dados['url'] = $this->url;
     $this->dados['current'] = 'contratos';
     $sidebar = new Sidebar();
     $sidebar->setSidebar('Novo Aluno', base_url('alunos/cadastro'));
     $sidebar->setSidebar('Contratos', base_url('contratos/listar'));
     //$sidebar->setSidebar('Logs', base_url('logs/listar'));
     $sidebar->setSubmenu('Financeiro', base_url('relatorios/financeiro'));
     $sidebar->setSubmenu('Horarios', base_url('relatorios/horarios'));
     $sidebar->setSidebar('Relatórios', '#', $sidebar->getSubmenu());
     $sidebar->setSidebar('Lixeira', base_url('lixeira/contratos'));
     $sidebar->setSidebar('Logs', base_url('logs/contratos'));
     $this->dados['sidebar'] = $sidebar->getSidebar();
 }
コード例 #18
0
ファイル: statusgruppen.php プロジェクト: ratbird/hope
 /**
  * Set up this controller and define the infobox
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     if ($action === 'verify') {
         $action = 'index';
     }
     parent::before_filter($action, $args);
     require_once 'lib/statusgruppe.inc.php';
     PageLayout::setHelpKeyword('Basis.HomepageUniversitäreDaten');
     PageLayout::setTitle(_('Einrichtungsdaten bearbeiten'));
     Navigation::activateItem('/profile/edit/statusgruppen');
     SkipLinks::addIndex(_('Einrichtungsdaten bearbeiten'), 'layout_content', 100);
     Sidebar::get()->setImage('sidebar/group-sidebar.png');
 }
コード例 #19
0
ファイル: Template.php プロジェクト: tagmeo/framework
 public function __construct()
 {
     add_filter('body_class', function (array $classes) {
         if (is_single() || is_page() && !is_front_page()) {
             if (!in_array(basename(get_permalink()), $classes)) {
                 $classes[] = basename(get_permalink());
             }
         }
         if (Sidebar::displaySidebar()) {
             $classes[] = 'sidebar-primary';
         }
         return $classes;
     }, 10, 1);
 }
コード例 #20
0
ファイル: admission.php プロジェクト: ratbird/hope
 /**
  * Shows the current restrictions for course participation.
  */
 function index_action()
 {
     URLHelper::addLinkParam('return_to_dialog', Request::isDialog());
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage("sidebar/seminar-sidebar.png");
     if ($GLOBALS['perm']->have_perm('admin')) {
         $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);
         $this->sidebar->addWidget($list);
     }
     $this->all_domains = UserDomain::getUserDomains();
     $this->seminar_domains = array_map(function ($d) {
         return $d->getId();
     }, UserDomain::getUserDomainsForSeminar($this->course_id));
     $this->current_courseset = CourseSet::getSetForCourse($this->course_id);
     $this->activated_admission_rules = AdmissionRule::getAvailableAdmissionRules();
     if (!$this->current_courseset) {
         $available_coursesets = new SimpleCollection();
         foreach (CourseSet::getCoursesetsByInstituteId($this->course->institut_id) as $cs) {
             $cs = new CourseSet($cs['set_id']);
             if ($cs->isUserAllowedToAssignCourse($this->user_id, $this->course_id)) {
                 $available_coursesets[] = array('id' => $cs->getId(), 'name' => $cs->getName(), 'chdate' => $cs->chdate, 'my_own' => $cs->getUserId() === $GLOBALS['user']->id);
             }
         }
         foreach (CourseSet::getglobalCoursesets() as $cs) {
             $cs = new CourseSet($cs['set_id']);
             if ($cs->isUserAllowedToAssignCourse($this->user_id, $this->course_id)) {
                 $available_coursesets[] = array('id' => $cs->getId(), 'name' => $cs->getName(), 'chdate' => $cs->chdate, 'my_own' => $cs->getUserId() === $GLOBALS['user']->id);
             }
         }
         $available_coursesets = $available_coursesets->findBy('chdate', strtotime('-1 year'), '>');
         $available_coursesets->orderBy('name');
         $this->available_coursesets = $available_coursesets;
         PageLayout::postMessage(MessageBox::info(_("Für diese Veranstaltung sind keine Anmelderegeln festgelegt. Die Veranstaltung ist damit für alle Nutzer zugänglich.")));
     } else {
         if ($this->current_courseset->isSeatDistributionEnabled() && !$this->course->admission_turnout) {
             PageLayout::postMessage(MessageBox::info(_("Diese Veranstaltung ist teilnahmebeschränkt, aber die maximale Teilnehmeranzahl ist nicht gesetzt.")));
         }
     }
     $lockdata = LockRules::getObjectRule($this->course_id);
     if ($lockdata['description'] && LockRules::CheckLockRulePermission($this->course_id, $lockdata['permission'])) {
         PageLayout::postMessage(MessageBox::info(formatLinks($lockdata['description'])));
     }
 }
コード例 #21
0
ファイル: notification.php プロジェクト: ratbird/hope
 /**
  * Set up this controller and define the infobox
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  * @throws AccessDeniedException if notifications are not globally enabled
  *                               or if the user has no access to these
  *                               notifications (admin or root accounts).
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!get_config('MAIL_NOTIFICATION_ENABLE')) {
         $message = _('Die Benachrichtigungsfunktion wurde in den Systemeinstellungen nicht freigeschaltet.');
         throw new AccessDeniedException($message);
     }
     if (!$GLOBALS['auth']->is_authenticated() || $GLOBALS['perm']->have_perm('admin')) {
         throw new AccessDeniedException();
     }
     PageLayout::setHelpKeyword('Basis.MyStudIPBenachrichtigung');
     PageLayout::setTitle(_('Benachrichtigung über neue Inhalte anpassen'));
     Navigation::activateItem('/profile/settings/notification');
     SkipLinks::addIndex(_('Benachrichtigung über neue Inhalte anpassen'), 'layout_content', 100);
     Sidebar::get()->setImage('sidebar/seminar-sidebar.png');
 }
コード例 #22
0
ファイル: Sidebar.php プロジェクト: masteruser20/Blog
 private function setSideMenuItems($_data = null, $additionalItems = false)
 {
     self::$data['SideMenu'] = [];
     self::$isMenuItemsSet = true;
     if ($_data == null || $_data != null && $additionalItems) {
         self::$data['SideMenu'] = ['O mnie' => basename(__DIR__) . '/views/o-mnie', 'Formularz' => $this->config()['url'] . 'form', 'Kategorie' => $this->getAllCategories(), 'Gra w oczko' => $this->config()['url'] . 'oczko', 'Google' => 'http://www.google.pl'];
         if ($this->isAdmin()) {
             self::$data['SideMenu']['Panel Administracyjny'] = ['Użytkownicy' => $this->config()['url'] . 'administrator/users', 'Kategorie' => $this->config()['url'] . 'administrator/categories'];
         }
         if (!$additionalItems) {
             return;
         }
     }
     foreach ($_data as $key => $item) {
         self::$data['SideMenu'][$key] = $item;
     }
 }
コード例 #23
0
ファイル: sitemap.php プロジェクト: ratbird/hope
 /**
  * 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);
 }
コード例 #24
0
ファイル: api.php プロジェクト: ratbird/hope
 /**
  *
  **/
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     require_once 'lib/bootstrap-api.php';
     $GLOBALS['perm']->check('root');
     Navigation::activateItem('/admin/config/api');
     PageLayout::setTitle(_('API Verwaltung'));
     $this->types = array('website' => _('Website'), 'desktop' => _('Herkömmliches Desktopprogramm'), 'mobile' => _('Mobile App'));
     // Sidebar
     $views = new ViewsWidget();
     $views->addLink(_('Registrierte Applikationen'), $this->url_for('admin/api'))->setActive($action === 'index');
     $views->addLink(_('Globale Zugriffseinstellungen'), $this->url_for('admin/api/permissions'))->setActive($action == 'permissions');
     $views->addLink(_('Konfiguration'), $this->url_for('admin/api/config'))->setActive($action == 'config');
     Sidebar::get()->addWidget($views);
     $actions = new ActionsWidget();
     $actions->addLink(_('Neue Applikation registrieren'), $this->url_for('admin/api/edit'), Icon::create('add', 'clickable'))->asDialog();
     Sidebar::get()->addWidget($actions);
 }
コード例 #25
0
ファイル: show.php プロジェクト: anantace/Kursadministration
 public function before_filter(&$action, &$args)
 {
     $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     $this->course = Course::findCurrent();
     if (!$this->course) {
         throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
     } else {
         $this->sem_id = $this->course->getID();
         $this->seminar = new Seminar($this->sem_id);
     }
     //if ($GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1])) {
     $widget = new ActionsWidget();
     $widget->addLink(_('Kursverwaltung'), $this->url_for('show/course'), false);
     $widget->addLink(_('Teilnehmerverwaltung'), $this->url_for('show'), false);
     Sidebar::get()->addWidget($widget);
     //}
     Navigation::activateItem('/admin/kursadmin');
 }
コード例 #26
0
ファイル: settings.php プロジェクト: ratbird/hope
 /**
  * Sets up the controller
  *
  * @param String $action Which action shall be invoked
  * @param Array $args Arguments passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     // Abwärtskompatibilität, erst ab 1.1 bekannt
     if (!isset($GLOBALS['ALLOW_CHANGE_NAME'])) {
         $GLOBALS['ALLOW_CHANGE_NAME'] = TRUE;
     }
     parent::before_filter($action, $args);
     // Ensure user is logged in
     $GLOBALS['auth']->login_if($action !== 'logout' && $GLOBALS['auth']->auth['uid'] === 'nobody');
     // extract username
     $username = Request::username('username', $GLOBALS['user']->username);
     $user = User::findByUsername($username);
     if (!$GLOBALS['perm']->have_profile_perm('user', $user->user_id)) {
         $username = $GLOBALS['user']->username;
     } else {
         $username = $user->username;
         URLHelper::addLinkParam('username', $username);
     }
     $this->about = new about($username, null);
     $this->about->get_user_details();
     if (!$this->about->check) {
         $this->reportErrorWithDetails(_('Zugriff verweigert.'), array(_("Wahrscheinlich ist Ihre Session abgelaufen. Bitte " . "nutzen Sie in diesem Fall den untenstehenden Link, " . "um zurück zur Anmeldung zu gelangen.\n\n" . "Eine andere Ursache kann der Versuch des Zugriffs " . "auf Userdaten, die Sie nicht bearbeiten dürfen, sein. " . "Nutzen Sie den untenstehenden Link, um zurück auf " . "die Startseite zu gelangen."), sprintf(_('%s Hier%s geht es wieder zur Anmeldung beziehungsweise Startseite.'), '<a href="index.php">', '</a>')));
         $this->render_nothing();
         return;
     }
     $this->user = User::findByUsername($username);
     $this->restricted = $GLOBALS['perm']->get_profile_perm($this->user->user_id) !== 'user' && $username !== $GLOBALS['user']->username;
     $this->config = UserConfig::get($this->user->user_id);
     $this->validator = new email_validation_class();
     # Klasse zum Ueberpruefen der Eingaben
     $this->validator->timeout = 10;
     // Default auth plugin to standard
     if (!$this->user->auth_plugin) {
         $this->user->auth_plugin = 'standard';
     }
     PageLayout::addSqueezePackage('settings');
     // Show info message if user is not on his own profile
     if ($username != $GLOBALS['user']->username) {
         $message = sprintf(_('Daten von: %s %s (%s), Status: %s'), htmlReady($this->user->Vorname), htmlReady($this->user->Nachname), $username, $this->user->perms);
         $this->reportInfo($message);
     }
     Sidebar::get()->setImage('sidebar/person-sidebar.png');
     $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
 }
コード例 #27
0
ファイル: single.php プロジェクト: ratbird/hope
 protected function createSidebar($active = null, $calendar = null)
 {
     parent::createSidebar($active, $calendar);
     $sidebar = Sidebar::Get();
     if ($calendar->havePermission(Calendar::PERMISSION_WRITABLE)) {
         $actions = new ActionsWidget();
         $actions->addLink(_('Termin anlegen'), $this->url_for('calendar/single/edit'), Icon::create('add', 'clickable'), array('data-dialog' => 'size=auto'));
         if ($calendar->havePermission(Calendar::PERMISSION_OWN) && get_config('CALENDAR_GROUP_ENABLE')) {
             $actions->addLink(_('Kalender freigeben'), $this->url_for('calendar/single/manage_access'), Icon::create('community', 'clickable'), array('id' => 'calendar-open-manageaccess', 'data-dialog' => '', 'data-dialogname' => 'manageaccess'));
         }
         $sidebar->addWidget($actions);
     }
     if ($calendar->havePermission(Calendar::PERMISSION_OWN)) {
         $export = new ExportWidget();
         $export->addLink(_('Termine exportieren'), $this->url_for('calendar/single/export_calendar'), Icon::create('download', 'clickable'), array('data-dialog' => 'size=auto'))->setActive($active == 'export_calendar');
         $export->addLink(_('Termine importieren'), $this->url_for('calendar/single/import'), Icon::create('upload', 'clickable'), array('data-dialog' => 'size=auto'))->setActive($active == 'import');
         $export->addLink(_('Kalender teilen'), $this->url_for('calendar/single/share'), Icon::create('group2', 'clickable'), array('data-dialog' => 'size=auto'))->setActive($active == 'share');
         $sidebar->addWidget($export);
     }
 }
コード例 #28
0
ファイル: wizard.php プロジェクト: ratbird/hope
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     global $perm;
     if (Request::isXhr()) {
         $this->dialog = true;
     }
     PageLayout::setTitle(_('Neue Veranstaltung anlegen'));
     $navigation = new Navigation(_('Neue Veranstaltung anlegen'), 'dispatch.php/course/wizard');
     Navigation::addItem('/browse/my_courses/new_course', $navigation);
     Navigation::activateItem('/browse/my_courses/new_course');
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage('sidebar/seminar-sidebar.png');
     $this->sidebar->setTitle(_('Neue Veranstaltung anlegen'));
     $this->steps = CourseWizardStepRegistry::findBySQL("`enabled`=1 ORDER BY `number`");
     // Special handling for studygroups.
     if (Request::int('studygroup')) {
         $this->flash['studygroup'] = true;
     }
 }
コード例 #29
0
ファイル: start.php プロジェクト: ratbird/hope
 /**
  * Entry point of the controller that displays the start page of Stud.IP
  *
  * @param string $action
  * @param string $widgetId
  *
  * @return void
  */
 function index_action($action = false, $widgetId = null)
 {
     $this->left = WidgetHelper::getUserWidgets($GLOBALS['user']->id, 0);
     $this->right = WidgetHelper::getUserWidgets($GLOBALS['user']->id, 1);
     if (!(count($this->left) + count($this->right))) {
         WidgetHelper::setInitialPositions();
         $this->left = WidgetHelper::getUserWidgets($GLOBALS['user']->id, 0);
         $this->right = WidgetHelper::getUserWidgets($GLOBALS['user']->id, 1);
     }
     WidgetHelper::setActiveWidget(Request::get('activeWidget'));
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/home-sidebar.png');
     $sidebar->setTitle(_("Meine Startseite"));
     $nav = new NavigationWidget();
     $nav->setTitle(_('Sprungmarken'));
     foreach (array_merge($this->left, $this->right) as $widget) {
         $nav->addLink($widget->getPluginName(), $this->url_for('start#widget-' . $widget->widget_id));
     }
     $sidebar->addWidget($nav);
     // Show action to add widget only if not all widgets have already been added.
     $actions = new ActionsWidget();
     if (WidgetHelper::getAvailableWidgets($GLOBALS['user']->id)) {
         $actions->addLink(_('Neues Widget hinzufügen'), $this->url_for('start/add'), Icon::create('add', 'clickable'))->asDialog();
     }
     $actions->addLink(_('Standard wiederherstellen'), $this->url_for('start/reset'), Icon::create('accept', 'clickable'));
     $sidebar->addWidget($actions);
     // Root may set initial positions
     if ($GLOBALS['perm']->have_perm('root')) {
         $settings = new ActionsWidget();
         $settings->setTitle(_('Einstellungen'));
         $settings->addElement(new WidgetElement(_('Standard-Startseite bearbeiten:')));
         foreach ($GLOBALS['perm']->permissions as $permission => $useless) {
             $settings->addElement(new LinkElement(ucfirst($permission), $this->url_for('start/edit_defaults/' . $permission), Icon::create('link-intern', 'clickable'), array('data-dialog' => '')));
         }
         $sidebar->addWidget($settings);
     }
     if ($GLOBALS['perm']->get_perm() == 'user') {
         PageLayout::postMessage(MessageBox::info(_('Sie haben noch nicht auf Ihre Bestätigungsmail geantwortet.'), array(_('Bitte holen Sie dies nach, um Stud.IP Funktionen wie das Belegen von Veranstaltungen nutzen zu können.'), sprintf(_('Bei Problemen wenden Sie sich an: %s'), '<a href="mailto:' . $GLOBALS['UNI_CONTACT'] . '">' . $GLOBALS['UNI_CONTACT'] . '</a>'))));
         PageLayout::postMessage(MessageBox::info(sprintf(_('Haben Sie die Bestätigungsmail an Ihre Adresse "%s" nicht erhalten?'), htmlReady($GLOBALS['user']->Email)), array(Studip\LinkButton::create(_('Bestätigungsmail erneut verschicken'), $this->url_for('start/resend_validation_mail')) . ' ' . Studip\LinkButton::create(_('Email-Adresse ändern'), $this->url_for('start/edit_mail_address'), array('data-dialog' => "size=auto", 'title' => _('Email-Adresse'))))));
     }
 }
コード例 #30
0
ファイル: study_areas.php プロジェクト: ratbird/hope
 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);
 }