本文整理汇总了PHP中Sidebar::Get方法的典型用法代码示例。如果您正苦于以下问题:PHP Sidebar::Get方法的具体用法?PHP Sidebar::Get怎么用?PHP Sidebar::Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sidebar
的用法示例。
在下文中一共展示了Sidebar::Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: before_filter
/**
* 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);
}
示例2: before_filter
/**
* 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');
}
示例3: initialize
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');
}
示例4: createSidebar
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);
}
示例5: index_action
/**
*
**/
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);
}
示例6: before_filter
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
}
示例7: set_sidebar
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);
}
}
示例8: createSidebar
protected function createSidebar($active = null, $calendar = null)
{
$active = $active ?: $this->last_view;
$sidebar = Sidebar::Get();
$sidebar->setTitle(_('Kalender'));
$sidebar->setImage('sidebar/schedule-sidebar.png');
$views = new ViewsWidget();
$views->addLink(_('Tag'), $this->url_for($this->base . 'day'))->setActive($active == 'day');
$views->addLink(_('Woche'), $this->url_for($this->base . 'week'))->setActive($active == 'week');
$views->addLink(_('Monat'), $this->url_for($this->base . 'month'))->setActive($active == 'month');
$views->addLink(_('Jahr'), $this->url_for($this->base . 'year'))->setActive($active == 'year');
$sidebar->addWidget($views);
}
示例9: createSidebar
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);
}
}
示例10: index_action
/**
* Displays all available tasks.
*
* @param int $page Which page to display
*/
public function index_action($page = 1)
{
$this->max_per_page = Config::get()->ENTRIES_PER_PAGE;
$this->total = CronjobTask::countBySql('1');
$this->page = max(1, min($page, ceil($this->total / $this->max_per_page)));
$limit = sprintf(" LIMIT %u, %u", ($this->page - 1) * $this->max_per_page, $this->max_per_page);
$this->tasks = CronjobTask::findBySQL('1' . $limit);
// Infobox image was produced from an image by Robbert van der Steeg
// http://www.flickr.com/photos/robbie73/5924985913/
$sidebar = Sidebar::Get();
$sidebar->setTitle(_('Cronjobs'));
$sidebar->setImage('sidebar/admin-sidebar.png');
// Aktionen
$actions = new ViewsWidget();
$actions->addLink(_('Cronjobs verwalten'),$this->url_for('admin/cronjobs/schedules'));
$actions->addLink(_('Aufgaben verwalten'),$this->url_for('admin/cronjobs/tasks'))->setActive(true);
$actions->addLink(_('Logs anzeigen'),$this->url_for('admin/cronjobs/logs'));
$sidebar->addWidget($actions);
}
示例11: index_action
/**
* Displays the deputy information of a user.
*/
public function index_action()
{
if (Request::submitted('add_deputy') && ($deputy_id = Request::option('deputy_id'))) {
$this->check_ticket();
if (isDeputy($deputy_id, $this->user->user_id)) {
$this->reportError(_('%s ist bereits als Vertretung eingetragen.'), get_fullname($deputy_id, 'full'));
} else {
if ($deputy_id == $this->user->user_id) {
$this->reportError(_('Sie können sich nicht als Ihre eigene Vertretung eintragen!'));
} else {
if (addDeputy($deputy_id, $this->user->user_id)) {
$this->reportSuccess(_('%s wurde als Vertretung eingetragen.'), get_fullname($deputy_id, 'full'));
} else {
$this->reportError(_('Fehler beim Eintragen der Vertretung!'));
}
}
}
$this->redirect('settings/deputies');
return;
}
$deputies = getDeputies($this->user->user_id, true);
$exclude_users = array($this->user->user_id);
if (is_array($deputies)) {
$exclude_users = array_merge($exclude_users, array_map(function ($d) {
return $d['user_id'];
}, $deputies));
}
$this->deputies = $deputies;
$this->search = new PermissionSearch('user', _('Vor-, Nach- oder Benutzername'), 'user_id', array('permission' => getValidDeputyPerms(), 'exclude_user' => $exclude_users));
$sidebar = Sidebar::Get();
$sidebar->setTitle(PageLayout::getTitle());
$actions = new ActionsWidget();
// add "add dozent" to infobox
$mp = MultiPersonSearch::get('settings_add_deputy')->setLinkText(_('Neue Standardvertretung festlegen'))->setDefaultSelectedUser(array_keys($this->deputies))->setLinkIconPath('')->setTitle(_('Neue Standardvertretung festlegen'))->setExecuteURL(URLHelper::getLink('dispatch.php/settings/deputies/add_member'))->setSearchObject($this->search)->setNavigationItem('/links/settings/deputies')->render();
$element = LinkElement::fromHTML($mp, Icon::create('community+add', 'clickable'));
$actions->addElement($element);
Sidebar::Get()->addWidget($actions);
}
示例12: before_filter
/**
* @see AuthenticatedController::before_filter
*/
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
if (Request::isXhr()) {
$this->via_ajax = true;
$this->set_layout(null);
$request = Request::getInstance();
foreach ($request as $key => $value) {
$request[$key] = studip_utf8decode($value);
}
} else {
$layout = $GLOBALS['template_factory']->open('layouts/base');
$this->set_layout($layout);
PageLayout::setTitle(_('Personenlisten'));
Navigation::activateItem('/tools/coursesets/userlists');
}
PageLayout::addSqueezePackage('admission');
$this->set_content_type('text/html;charset=windows-1252');
$views = new ViewsWidget();
$views->setTitle(_('Aktionen'));
$views->addLink(_('Personenliste anlegen'), $this->url_for('admission/userlist/configure'))->setActive($action == 'configure');
Sidebar::Get()->addWidget($views);
}
示例13: index_action
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']));
}
}
}
示例14: initSidebar
private function initSidebar($active_id = null)
{
$sidebar = Sidebar::Get();
$letterlist = new SidebarWidget();
foreach (range('A', 'Z') as $letter) {
if ($this->contacts[$letter]) {
$html .= "<a href='#letter_{$letter}'>{$letter}</a>";
} else {
$html .= "<span>{$letter}</span>";
}
}
$letterlist->setTitle(_('Schnellzugriff'));
$letterlist->addElement(new WidgetElement("<div class='letterlist'>{$html}</div>"));
$sidebar->addWidget($letterlist);
// Groups
$actions = new ActionsWidget();
$actions->addLink(_('Neue Gruppe anlegen'), $this->url_for('contact/editGroup'), Icon::create('group3+add', 'clickable'))->asDialog('size=auto');
$actions->addLink(_('Nachricht an alle'), $this->url_for('messages/write', array('rec_uname' => $this->allContacts->pluck('username'))), Icon::create('mail', 'clickable'))->asDialog();
$actions->addLink(_('E-Mail an alle'), URLHelper::getLink('mailto:' . join(',', $this->allContacts->pluck('email'))), Icon::create('mail', 'clickable'));
$actions->addLink(_('Alle vCards herunterladen'), $this->url_for('contact/vcard/' . $this->filter), Icon::create('vcard', 'clickable'));
$sidebar->addWidget($actions);
// Groups navigation
$groupsWidget = new ViewsWidget();
$groupsWidget->setTitle(_('Gruppen'));
$groupsWidget->addLink(_('Alle Kontakte'), URLHelper::getLink('dispatch.php/contact/index'))->setActive(!$active_id);
foreach ($this->groups as $group) {
$groupsWidget->addLink($group->name, URLHelper::getLink('dispatch.php/contact/index/' . $group->id))->setActive($group->id == $active_id);
}
$sidebar->addWidget($groupsWidget);
}
示例15: setSidebar
private function setSidebar($action)
{
$sidebar = Sidebar::Get();
$sidebar->setTitle(PageLayout::getTitle() ?: _('Rollen'));
$sidebar->setImage('sidebar/roles-sidebar.png');
$views = new ViewsWidget();
$views->addLink(_('Rollen verwalten'), $this->url_for('admin/role'))->setActive($action === 'index');
$views->addLink(_('Personenzuweisungen bearbeiten'), $this->url_for('admin/role/assign_role'))->setActive($action === 'assign_role');
$views->addLink(_('Pluginzuweisungen bearbeiten'), $this->url_for('admin/role/assign_plugin_role'))->setActive($action === 'assign_plugin_role');
$views->addLink(_('Rollenzuweisungen anzeigen'), $this->url_for('admin/role/show_role'))->setActive($action === 'show_role');
$sidebar->addWidget($views);
$actions = new ActionsWidget();
$actions->addLink(_('Neue Rolle anlegen'), $this->url_for('admin/role/add'), Icon::create('add', 'clickable'))->asDialog('size=auto');
$sidebar->addWidget($actions);
}