本文整理汇总了PHP中PageLayout::addSqueezePackage方法的典型用法代码示例。如果您正苦于以下问题:PHP PageLayout::addSqueezePackage方法的具体用法?PHP PageLayout::addSqueezePackage怎么用?PHP PageLayout::addSqueezePackage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageLayout
的用法示例。
在下文中一共展示了PageLayout::addSqueezePackage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: before_filter
/**
* This function is called before any output is generated or any other
* actions are performed. Initializations happen here.
*
* @param $action Name of the action to perform
* @param $args Arguments for the given action
*/
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
$this->modules = array();
// Set Navigation
PageLayout::setHelpKeyword("Basis.ProfileModules");
PageLayout::setTitle(_("Mehr Funktionen"));
PageLayout::addSqueezePackage('lightbox');
Navigation::activateItem('/profile/modules');
// Get current user.
$this->username = Request::username('username', $GLOBALS['user']->username);
$this->user_id = get_userid($this->username);
$this->plugins = array();
$blubber = PluginEngine::getPlugin('Blubber');
// Add blubber to plugin list so status can be updated.
if ($blubber) {
$this->plugins[] = $blubber;
}
// Get homepage plugins from database.
$this->plugins = array_merge($this->plugins, PluginEngine::getPlugins('HomepagePlugin'));
// Show info message if user is not on his own profile
if ($this->user_id != $GLOBALS['user']->id) {
$current_user = User::find($this->user_id);
$message = sprintf(_('Daten von: %s %s (%s), Status: %s'), htmlReady($current_user->Vorname), htmlReady($current_user->Nachname), htmlReady($current_user->username), htmlReady($current_user->perms));
PageLayout::postMessage(MessageBox::info($message));
}
$this->setupSidebar();
}
示例2: before_filter
/**
* common tasks for all actions
*/
function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
PageLayout::setTitle(_('Teilnahmebeschränkte Veranstaltungen'));
Navigation::activateItem('/tools/coursesets/restricted_courses');
PageLayout::addSqueezePackage('tablesorter');
}
示例3: before_filter
/**
* common tasks for all actions
*/
function before_filter(&$action, &$args)
{
global $perm;
parent::before_filter($action, $args);
$course_id = $args[0];
$this->course_id = Request::option('cid', $course_id);
Navigation::activateItem('/course/admin/admission');
if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$perm->have_studip_perm("tutor", $this->course_id)) {
throw new Trails_Exception(403);
}
$this->course = Course::find($this->course_id);
$this->user_id = $GLOBALS['user']->id;
PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenZugangsberechtigungen");
PageLayout::setTitle($this->course->getFullname() . " - " . _("Verwaltung von Zugangsberechtigungen"));
$lockrules = words('admission_turnout admission_type admission_endtime admission_binding passwort read_level write_level admission_prelim admission_prelim_txt admission_starttime admission_endtime_sem admission_disable_waitlist user_domain admission_binding admission_studiengang');
foreach ($lockrules as $rule) {
$this->is_locked[$rule] = LockRules::Check($this->course_id, $rule) ? 'disabled readonly' : '';
}
if (!SeminarCategories::GetByTypeId($this->course->status)->write_access_nobody) {
$this->is_locked['write_level'] = 'disabled readonly';
}
update_admission($this->course->id);
PageLayout::addSqueezePackage('admission');
URLHelper::addLinkParam('return_to_dialog', Request::get('return_to_dialog'));
}
示例4: 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);
}
示例5: 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');
}
示例6: before_filter
/**
* Before filter, basically initializes the controller by actvating the
* according navigation entry and other settings.
*
* @param String $action Action to execute
* @param Array $args Arguments passed for the action (might be empty)
*/
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
PageLayout::setTitle(_('Dateiverwaltung'));
PageLayout::setHelpKeyword('Basis.Dateien');
Navigation::activateItem('/profile/files');
PageLayout::addSqueezePackage('document');
}
示例7: before_filter
/**
* Common tasks for all actions
*
* @param String $action Called action
* @param Array $args Possible arguments
*/
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
$course_id = $args[0];
$this->course_id = Request::option('cid', $course_id);
if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$GLOBALS['perm']->have_studip_perm("tutor", $this->course_id)) {
throw new Trails_Exception(400);
}
PageLayout::addSqueezePackage('raumzeit');
PageLayout::setHelpKeyword('Basis.VeranstaltungenVerwaltenAendernVonZeitenUndTerminen');
PageLayout::setTitle(Course::findCurrent()->getFullname() . " - " . _('Blockveranstaltungstermine anlegen'));
}
示例8: before_filter
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
checkObject();
checkObjectModule("schedule");
$course = Course::findCurrent();
if ($course) {
PageLayout::setTitle(sprintf('%s - %s', $course->getFullname(), _("Termine")));
} else {
PageLayout::setTitle(_("Termine"));
}
PageLayout::addSqueezePackage('tablesorter');
}
示例9: before_filter
/**
* common tasks for all actions
*/
function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
$this->course_id = $args[0];
if (!in_array($action, words('apply claim delete order_down order_up'))) {
$this->redirect($this->url_for('/apply/' . $action));
return false;
}
if (!get_object_type($this->course_id, array('sem'))) {
throw new Trails_Exception(400);
}
$course = Seminar::GetInstance($this->course_id);
$enrolment_info = $course->getEnrolmentInfo($GLOBALS['user']->id);
//Ist bereits Teilnehmer/Admin/freier Zugriff -> gleich weiter
if ($enrolment_info['enrolment_allowed'] && (in_array($enrolment_info['cause'], words('root courseadmin member')) || $enrolment_info['cause'] == 'free_access' && $GLOBALS['user']->id == 'nobody')) {
$redirect_url = UrlHelper::getUrl('seminar_main.php', array('auswahl' => $this->course_id));
if (Request::isXhr()) {
$this->response->add_header('X-Location', $redirect_url);
$this->render_nothing();
} else {
$this->redirect($redirect_url);
}
return false;
}
//Grundsätzlich verboten
if (!$enrolment_info['enrolment_allowed']) {
throw new AccessDeniedException($enrolment_info['description']);
}
PageLayout::setTitle($course->getFullname() . " - " . _("Veranstaltungsanmeldung"));
PageLayout::addSqueezePackage('enrolment');
if (Request::isXhr()) {
$this->set_layout(null);
$this->response->add_header('X-No-Buttons', 1);
$this->response->add_header('X-Title', PageLayout::getTitle());
$request = Request::getInstance();
foreach ($request as $key => $value) {
$request[$key] = studip_utf8decode($value);
}
} else {
$this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
}
$this->set_content_type('text/html;charset=windows-1252');
if (Request::submitted('cancel')) {
$this->redirect(URLHelper::getURL('dispatch.php/course/details/', array('sem_id' => $this->course_id)));
}
}
示例10: before_filter
/**
* Initializes the controller
*
* @param String $action Action to execute
* @param Array $args Arguments
*/
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
if (Request::submitted('abort')) {
$this->redirect('admin/statusgroups/index');
}
$this->user_id = $GLOBALS['user']->user_id;
// Set pagelayout
PageLayout::addSqueezePackage('statusgroups');
PageLayout::setHelpKeyword("Basis.Allgemeines");
PageLayout::setTitle(_("Verwaltung von Funktionen und Gruppen"));
Navigation::activateItem('/admin/institute/groups');
// Include url for ajax moving of members in group to page header
PageLayout::addHeadElement('meta', array('name' => 'statusgroups-ajax-movable-endpoint', 'content' => $this->url_for('admin/statusgroups/move')));
$this->setType();
// Check if the viewing user should get the admin interface
$this->tutor = $this->type['edit']($this->user_id);
}
示例11: 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'));
}
示例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(_('Bedingung'));
Navigation::activateItem('/tools/coursesets');
}
PageLayout::addSqueezePackage('userfilter');
$this->set_content_type('text/html;charset=windows-1252');
}
示例13: 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 {
$this->via_ajax = false;
$layout = $GLOBALS['template_factory']->open('layouts/base');
$this->set_layout($layout);
PageLayout::setTitle(_('Verwaltung von Anmelderegeln'));
Navigation::activateItem('/admin/config/admissionrules');
}
PageLayout::addSqueezePackage('admission');
$this->set_content_type('text/html;charset=windows-1252');
}
示例14: before_filter
/**
* Common tasks for all actions
*
* @param String $action Called action
* @param Array $args Possible arguments
*/
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
if (!$GLOBALS['perm']->have_perm('admin')) {
throw new AccessDeniedException();
}
Navigation::activateItem('/browse/my_courses/list');
// we are defintely not in an lecture or institute
closeObject();
//delete all temporary permission changes
if (is_array($_SESSION)) {
foreach (array_keys($_SESSION) as $key) {
if (strpos($key, 'seminar_change_view_') !== false) {
unset($_SESSION[$key]);
}
}
}
$this->insts = Institute::getMyInstitutes($GLOBALS['user']->id);
if (empty($this->insts) && !$GLOBALS['perm']->have_perm('root')) {
PageLayout::postMessage(MessageBox::error(_('Sie wurden noch keiner Einrichtung zugeordnet')));
}
if (!$GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT) {
$GLOBALS['user']->cfg->store('MY_INSTITUTES_DEFAULT', $this->insts[0]['Institut_id']);
}
// Semester selection
if ($GLOBALS['user']->cfg->MY_COURSES_SELECTED_CYCLE) {
$this->semester = Semester::find($GLOBALS['user']->cfg->MY_COURSES_SELECTED_CYCLE);
}
if (Request::submitted("search") || Request::get("reset-search")) {
$GLOBALS['user']->cfg->store('ADMIN_COURSES_SEARCHTEXT', Request::get("search"));
}
if (Request::submitted("teacher_filter")) {
$GLOBALS['user']->cfg->store('ADMIN_COURSES_TEACHERFILTER', Request::option("teacher_filter"));
}
PageLayout::setHelpKeyword("Basis.Veranstaltungen");
PageLayout::setTitle(_("Verwaltung von Veranstaltungen und Einrichtungen"));
Sidebar::Get()->setTitle(_('Veranstaltungsadministration'));
PageLayout::addSqueezePackage('raumzeit');
// Add admission functions.
PageLayout::addSqueezePackage('admission');
}
示例15: before_filter
/**
* Common actions before any other action
*
* @param String $action Action to be executed
* @param Array $args Arguments passed to the action
* @throws Trails_Exception when either no course was found or the user
* may not access this area
*/
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
// Try to find a valid course
if (Course::findCurrent()) {
$course_id = Course::findCurrent()->id;
} else {
throw new Trails_Exception(404, _('Es wurde keine Veranstaltung ausgewählt!'));
}
if (!$GLOBALS['perm']->have_studip_perm('tutor', $course_id)) {
throw new Trails_Exception(400);
}
// Get seminar instance
$this->course = Seminar::getInstance($course_id);
if (Navigation::hasItem('course/admin/dates')) {
Navigation::activateItem('course/admin/dates');
}
$this->show = array('regular' => true, 'irregular' => true, 'roomRequest' => true);
PageLayout::setHelpKeyword('Basis.Veranstaltungen');
PageLayout::addSqueezePackage('raumzeit');
$title = _('Verwaltung von Zeiten und Räumen');
$title = $this->course->getFullname() . ' - ' . $title;
PageLayout::setTitle($title);
$_SESSION['raumzeitFilter'] = Request::get('newFilter');
// bind linkParams for chosen semester and opened dates
URLHelper::bindLinkParam('raumzeitFilter', $_SESSION['raumzeitFilter']);
$this->checkFilter();
$this->selection = $this->getSemestersForCourse($this->course, $_SESSION['raumzeitFilter']);
if (!Request::isXhr()) {
$this->setSidebar();
} elseif (Request::isXhr() && $this->flash['update-times']) {
$semester_id = $GLOBALS['user']->cfg->MY_COURSES_SELECTED_CYCLE;
if ($semester_id === 'all') {
$semester_id = '';
}
$this->response->add_header('X-Raumzeit-Update-Times', json_encode(studip_utf8encode(array('course_id' => $this->course->id, 'html' => Seminar::GetInstance($this->course->id)->getDatesHTML(array('semester_id' => $semester_id, 'show_room' => true)) ?: _('nicht angegeben')))));
}
}