function __construct() { parent::__construct(); require_once 'polyfills/Button.php'; require_once 'polyfills/LinkButton.php'; PageLayout::addStylesheet($this->getPluginURL() . '/polyfills/buttons.css'); $navigation = new AutoNavigation(_('Plugin-Generator')); $navigation->setURL(PluginEngine::GetLink($this, array(), '')); $navigation->setImage(Assets::image_path('icons/16/black/plugin.png')); Navigation::addItem('/tools/plugingenerator', $navigation); /*/ $navigation = new AutoNavigation(_('Plugin-Generator')); $navigation->setURL(PluginEngine::GetLink($this, array(), '')); Navigation::addItem('/plugingenerator/index', $navigation); $navigation = new AutoNavigation(_('Tools')); $navigation->setURL(PluginEngine::GetLink($this, array(), 'tools')); Navigation::addItem('/plugingenerator/tools', $navigation); //*/ }
public function getIconNavigation($course_id, $last_visit, $user_id = null) { if (!$user_id) { $user_id = $GLOBALS['user']->id; } $icon = new AutoNavigation($this->getDisplayTitle(), PluginEngine::getLink($this, array(), "forum/forum")); $db = DBManager::get(); $last_own_posting_time = (int) $db->query("SELECT mkdate " . "FROM px_topics " . "WHERE user_id = " . $db->quote($user_id) . " " . "AND Seminar_id = " . $db->quote($course_id) . " " . "")->fetch(PDO::FETCH_COLUMN, 0); $new_ones = $db->query("SELECT COUNT(*) " . "FROM px_topics " . "WHERE chdate > " . $db->quote(max($last_visit, $last_own_posting_time)) . " " . "AND user_id != " . $db->quote($user_id) . " " . "AND Seminar_id = " . $db->quote($course_id) . " " . "")->fetch(PDO::FETCH_COLUMN, 0); if ($new_ones) { $title = $new_ones > 1 ? sprintf(_("%s neue Blubber"), $new_ones) : _("1 neuer Blubber"); $icon->setImage($this->getPluginURL() . "/assets/images/blubber_red.png", array('title' => $title)); $icon->setTitle($title); } else { $icon->setImage($this->getPluginURL() . "/assets/images/blubber_grey.png", array('title' => $this->getDisplayTitle())); } return $icon; }
function getTabNavigation($course_id) { $sem_create_perm = in_array(get_config('SEM_CREATE_PERM'), array('root', 'admin', 'dozent')) ? get_config('SEM_CREATE_PERM') : 'dozent'; if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id)) { $navigation = new Navigation(_('Verwaltung')); $navigation->setImage(Icon::create('admin', 'info_alt')); $navigation->setActiveImage(Icon::create('admin', 'info')); $main = new Navigation(_('Verwaltung'), 'dispatch.php/course/management'); $navigation->addSubNavigation('main', $main); if ($GLOBALS['SessSemName']['class'] !== "inst") { $item = new Navigation(_('Grunddaten'), 'dispatch.php/course/basicdata/view/' . $course_id); $item->setImage(Icon::create('edit', 'clickable')); $item->setDescription(_('Bearbeiten der Grundeinstellungen dieser Veranstaltung.')); $navigation->addSubNavigation('details', $item); $item = new Navigation(_('Infobild'), 'dispatch.php/course/avatar/update/' . $course_id); $item->setImage(Icon::create('file-pic', 'clickable')); $item->setDescription(_('Infobild dieser Veranstaltung bearbeiten oder löschen.')); $navigation->addSubNavigation('avatar', $item); $item = new Navigation(_('Studienbereiche'), 'dispatch.php/course/study_areas/show/' . $course_id); $item->setImage(Icon::create('module', 'clickable')); $item->setDescription(_('Zuordnung dieser Veranstaltung zu Studienbereichen für die Darstellung im Verzeichnis aller Veranstaltungen.')); $navigation->addSubNavigation('study_areas', $item); $item = new Navigation(_('Zeiten/Räume'), 'dispatch.php/course/timesrooms'); $item->setImage(Icon::create('date', 'clickable')); $item->setDescription(_('Regelmäßige Veranstaltungszeiten, Einzeltermine und Ortsangaben ändern.')); $navigation->addSubNavigation('dates', $item); if (get_config('RESOURCES_ENABLE') && get_config('RESOURCES_ALLOW_ROOM_REQUESTS')) { $item = new Navigation(_('Raumanfragen'), 'dispatch.php/course/room_requests/index/' . $course_id); $item->setImage(Icon::create('resources', 'clickable')); $item->setDescription(_('Raumanfragen zu Veranstaltungszeiten verwalten.')); $navigation->addSubNavigation('room_requests', $item); } $item = new Navigation(_('Zugangsberechtigungen'), 'dispatch.php/course/admission'); $item->setImage(Icon::create('lock-locked', 'clickable')); $item->setDescription(_('Zugangsbeschränkungen, Anmeldeverfahren oder einen Passwortschutz für diese Veranstaltung einrichten.')); $navigation->addSubNavigation('admission', $item); $item = new AutoNavigation(_('Zusatzangaben'), 'dispatch.php/admin/additional'); $item->setImage(Icon::create('add', 'clickable')); $item->setDescription(_('Vorlagen zur Erhebung weiterer Angaben von Teilnehmenden auswählen.')); $navigation->addSubNavigation('additional_data', $item); if ($GLOBALS['perm']->have_perm($sem_create_perm)) { if (!LockRules::check($course_id, 'seminar_copy')) { $item = new Navigation(_('Veranstaltung kopieren'), 'dispatch.php/course/wizard/copy/' . $course_id); $item->setImage(Icon::create('seminar+add', 'clickable')); $main->addSubNavigation('copy', $item); } if (get_config('ALLOW_DOZENT_ARCHIV') || $GLOBALS['perm']->have_perm('admin')) { $item = new Navigation(_('Veranstaltung archivieren'), 'archiv_assi.php'); $item->setImage(Icon::create('seminar+remove', 'clickable')); $main->addSubNavigation('archive', $item); } if ((get_config('ALLOW_DOZENT_VISIBILITY') || $GLOBALS['perm']->have_perm('admin')) && !LockRules::Check($course_id, 'seminar_visibility')) { $is_visible = Course::findCurrent()->visible; $item = new Navigation(_('Sichtbarkeit ändern') . ' (' . ($is_visible ? _('sichtbar') : _('unsichtbar')) . ')', 'dispatch.php/course/management/change_visibility'); $item->setImage(Icon::create('visibility-' . ($is_visible ? 'visible' : 'invisible'), 'clickable')); $main->addSubNavigation('visibility', $item); } if ($GLOBALS['perm']->have_perm('admin')) { $is_locked = Course::findCurrent()->lock_rule; $item = new Navigation(_('Sperrebene ändern') . ' (' . ($is_locked ? _('gesperrt') : _('nicht gesperrt')) . ')', 'dispatch.php/course/management/lock'); $item->setImage(Icon::create('lock-' . ($is_locked ? 'locked' : 'unlocked'), 'clickable'), ['data-dialog' => 'size=auto']); $main->addSubNavigation('lock', $item); } } // show entry for simulated participant view if (in_array($GLOBALS['perm']->get_studip_perm($course_id), words('tutor dozent'))) { $item = new Navigation('Studierendenansicht simulieren', 'dispatch.php/course/change_view?cid=' . Request::option('cid')); $item->setDescription(_('Hier können Sie sich die Veranstaltung aus der Sicht von Studierenden sehen.')); $item->setImage(Icon::create('visibility-invisible', 'clickable')); $main->addSubNavigation('change_view', $item); } } // endif modules only seminars if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id)) { if (get_config('VOTE_ENABLE')) { $item = new Navigation(_('Umfragen und Tests'), 'admin_vote.php?view=vote_sem'); $item->setImage(Icon::create('vote', 'clickable')); $item->setDescription(_('Erstellen und bearbeiten von einfachen Umfragen und Tests.')); $navigation->addSubNavigation('vote', $item); $item = new Navigation(_('Evaluationen'), 'admin_evaluation.php?view=eval_sem'); $item->setImage(Icon::create('evaluation', 'clickable')); $item->setDescription(_('Richten Sie fragebogenbasierte Umfragen und Lehrevaluationen ein.')); $navigation->addSubNavigation('evaluation', $item); } } return array('admin' => $navigation); } else { return array(); } }
/** * Returns a navigation-object with the grey/red icon for displaying in the * my_courses.php page. * @param string $course_id * @param int $last_visit * @param string|null $user_id * @return \AutoNavigation */ public function getIconNavigation($course_id, $last_visit, $user_id = null) { if (!$user_id) { $user_id = $GLOBALS['user']->id; } $icon = new AutoNavigation($this->getDisplayTitle(), PluginEngine::getLink($this, array(), "streams/forum")); $db = DBManager::get(); $last_own_posting_time = (int) $db->query("SELECT mkdate " . "FROM blubber " . "WHERE user_id = " . $db->quote($user_id) . " " . "AND Seminar_id = " . $db->quote($course_id) . " " . "AND context_type = 'course' " . "ORDER BY mkdate DESC " . "")->fetch(PDO::FETCH_COLUMN, 0); $new_ones = $db->query("SELECT COUNT(*) " . "FROM blubber " . "WHERE chdate > " . $db->quote(max($last_visit, $last_own_posting_time)) . " " . "AND user_id != " . $db->quote($user_id) . " " . "AND Seminar_id = " . $db->quote($course_id) . " " . "AND context_type = 'course' " . "")->fetch(PDO::FETCH_COLUMN, 0); if ($new_ones) { $title = $new_ones > 1 ? sprintf(_("%s neue Blubber"), $new_ones) : _("1 neuer Blubber"); $icon->setImage(Icon::create('blubber', 'attention', compact('title'))); $icon->setTitle($title); $icon->setBadgeNumber($new_ones); } else { $icon->setImage(Icon::create('blubber', 'inactive', ["title" => $this->getDisplayTitle()])); } return $icon; }