本文整理汇总了PHP中Sidebar::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Sidebar::get方法的具体用法?PHP Sidebar::get怎么用?PHP Sidebar::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sidebar
的用法示例。
在下文中一共展示了Sidebar::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index_action
/**
* 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();
}
示例2: before_filter
/**
* 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');
**/
}
示例3: before_filter
/**
* 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');
}
示例4: index_action
/**
* 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;
}
示例5: before_filter
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');
}
示例6: before_filter
/**
* 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');
}
示例7: before_filter
/**
* 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));
}
示例8: before_filter
/**
* 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');
}
示例9: index_action
/**
* 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'])));
}
}
示例10: before_filter
/**
* 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');
}
示例11: index_action
/**
* 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);
}
示例12: before_filter
/**
*
**/
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);
}
示例13: before_filter
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');
}
示例14: before_filter
/**
* 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'));
}
示例15: before_filter
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;
}
}