本文整理汇总了PHP中PageLayout类的典型用法代码示例。如果您正苦于以下问题:PHP PageLayout类的具体用法?PHP PageLayout怎么用?PHP PageLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PageLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index_action
function index_action()
{
$form_fields['comment'] = array('caption' => _("Kommentar"), 'type' => 'textarea', 'attributes' => array('rows' => 4, 'style' => 'width:100%'));
$form_fields['snd_message'] = array('caption' => _("Benachrichtigung über ausfallende Termine an alle Teilnehmer verschicken"), 'type' => 'checkbox', 'attributes' => array('style' => 'vertical-align:middle'));
$form_buttons['save_close'] = array('caption' => _('OK'), 'info' => _("Termine absagen und Dialog schließen"));
$form = new StudipForm($form_fields, $form_buttons, 'cancel_dates', false);
if ($form->isClicked('save_close')) {
$sem = Seminar::getInstance($this->course_id);
$comment = $form->getFormFieldValue('comment');
foreach ($this->dates as $date) {
$sem->cancelSingleDate($date->getTerminId(), $date->getMetadateId());
$date->setComment($comment);
$date->setExTermin(true);
$date->store();
}
if ($form->getFormFieldValue('snd_message') && count($this->dates)) {
$snd_messages = raumzeit_send_cancel_message($comment, $this->dates);
if ($snd_messages) {
$msg = sprintf(_("Es wurden %s Benachrichtigungen gesendet."), $snd_messages);
}
}
PageLayout::postMessage(MessageBox::success(_("Folgende Termine wurden abgesagt") . ($msg ? ' (' . $msg . '):' : ':'), array_map(function ($d) {
return $d->toString();
}, $this->dates)));
$this->redirect($this->url_for('course/dates'));
}
$this->form = $form;
}
示例2: index_action
/**
* This method is called to show the form to upload a new avatar for a
* course.
*
* @return void
*/
function index_action()
{
// nothing to do
if ($this->studygroup_mode) {
$this->avatar = StudygroupAvatar::getAvatar($this->course_id);
} else {
$this->avatar = CourseAvatar::getAvatar($this->course_id);
}
if (get_config('NEWS_RSS_EXPORT_ENABLE') && $this->course_id) {
$rss_id = StudipNews::GetRssIdFromRangeId($this->course_id);
if ($rss_id) {
PageLayout::addHeadElement('link', array('rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => 'RSS', 'href' => 'rss.php?id=' . $rss_id));
}
}
// Fetch news
$response = $this->relay('news/display/' . $this->course_id);
$this->news = $response->body;
// Fetch votes
if (get_config('VOTE_ENABLE')) {
$response = $this->relay('questionnaire/widget/' . $this->course_id);
$this->votes = $response->body;
}
// Fetch dates
if (!$this->studygroup_mode) {
$response = $this->relay("calendar/contentbox/display/{$this->course_id}/1210000");
$this->dates = $response->body;
}
}
示例3: before_filter
/**
* Common code for all actions: set default layout and page title.
*
* @param type $action
* @param type $args
*/
function before_filter(&$action, &$args)
{
$this->validate_args($args, array('option', 'option'));
parent::before_filter($action, $args);
// set correct encoding if this is an ajax-call
if (Request::isAjax()) {
header('Content-Type: text/html; charset=Windows-1252');
}
$this->flash = Trails_Flash::instance();
// set default layout
$layout = $GLOBALS['template_factory']->open('layouts/base');
$this->set_layout($layout);
// Set help keyword for Stud.IP's user-documentation and page title
PageLayout::setHelpKeyword('Basis.Forum');
PageLayout::setTitle($_SESSION['SessSemName']['header_line'] . ' - ' . _('Forum'));
$this->AVAILABLE_DESIGNS = array('web20', 'studip');
if ($GLOBALS['CANONICAL_RELATIVE_PATH_STUDIP'] && $GLOBALS['CANONICAL_RELATIVE_PATH_STUDIP'] != '/') {
$this->picturepath = $GLOBALS['CANONICAL_RELATIVE_PATH_STUDIP'] . '/' . $this->dispatcher->trails_root . '/img';
} else {
$this->picturepath = '/' . $this->dispatcher->trails_root . '/img';
}
// we want to display the dates in german
setlocale(LC_TIME, 'de_DE@euro', 'de_DE', 'de', 'ge');
// the default for displaying timestamps
$this->time_format_string = "%a %d. %B %Y, %H:%M";
$this->time_format_string_short = "%d.%m.%Y, %H:%M";
$this->template_factory = new Flexi_TemplateFactory(dirname(__FILE__) . '/../templates');
//$this->check_token();
ForumVisit::setVisit($this->getId());
if (Request::int('page')) {
ForumHelpers::setPage(Request::int('page'));
}
$this->seminar_id = $this->getId();
}
示例4: showweek_action
/**
* @todo der include muss weg
*/
public function showweek_action($timestamp = null)
{
$calendar = Calendar::getInstance(Calendar::RANGE_INST, $this->institute_id);
PageLayout::setTitle(getHeaderLine($this->institute_id) . ' - ' . _("Terminkalender - Wochenansicht"));
$_SESSION['calendar_sess_control_data']['view_prv'] = 'showweek';
Navigation::activateItem("/course/calendar/week");
$atime = $timestamp ?: time();
$at = date('G', $atime);
if ($at >= $this->calendar_settings['start'] && $at <= $this->calendar_settings['end'] || !$atime) {
$st = $this->calendar_settings['start'];
$et = $this->calendar_settings['end'];
} elseif ($at < $this->calendar_settings['start']) {
$st = 0;
$et = $this->calendar_settings['start'] + 2;
} else {
$st = $this->calendar_settings['end'] - 2;
$et = 23;
}
include_once $GLOBALS['RELATIVE_PATH_CALENDAR'] . '/lib/DbCalendarWeek.class.php';
$this->_calendar = $calendar;
$this->atime = $atime;
$this->cmd = 'showweek';
$this->st = $st;
$this->et = $et;
}
示例5: initialize
public function initialize()
{
PageLayout::addStylesheet($this->getPluginUrl() . '/css/style.css');
//PageLayout::addStylesheet($this->getPluginURL().'/assets/style.css');
PageLayout::addScript($this->getPluginURL() . '/js/script.js');
$this->setupAutoload();
}
示例6: authorize_action
/**
*
**/
public function authorize_action()
{
global $user, $auth;
$auth->login_if($user->id == 'nobody');
$user_id = OAuthUser::getMappedId($user->id);
// Fetch the oauth store and the oauth server.
$store = OAuthStore::instance();
$server = new OAuthServer();
try {
// Check if there is a valid request token in the current request
// Returns an array with the consumer key, consumer secret, token, token secret and token type.
$rs = $server->authorizeVerify();
if (isset($_POST['allow'])) {
// See if the user clicked the 'allow' submit button (or whatever you choose)
$authorized = array_key_exists('allow', $_POST);
// Set the request token to be authorized or not authorized
// When there was a oauth_callback then this will redirect to the consumer
$server->authorizeFinish($authorized, $user_id);
// No oauth_callback, show the user the result of the authorization
// ** your code here **
PageLayout::postMessage(Messagebox::success(_('Sie haben der Applikation Zugriff auf Ihre Daten gewährt.')));
$this->redirect('user#' . $rs['consumer_key']);
}
} catch (OAuthException $e) {
// No token to be verified in the request, show a page where the user can enter the token to be verified
// **your code here**
die('invalid');
}
PageLayout::disableHeader();
$this->set_layout($GLOBALS['template_factory']->open('layouts/base_without_infobox'));
$this->rs = $rs;
}
示例7: before_filter
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
// Lock context to user id
$this->owner = $GLOBALS['user'];
$this->context_id = $this->owner->id;
$this->full_access = true;
if (Config::get()->PERSONALDOCUMENT_OPEN_ACCESS) {
$username = Request::username('username', $GLOBALS['user']->username);
$user = User::findByUsername($username);
if ($user && $user->id !== $GLOBALS['user']->id) {
$this->owner = $user;
$this->context_id = $user->id;
$this->full_access = Config::get()->PERSONALDOCUMENT_OPEN_ACCESS_ROOT_PRIVILEDGED && $GLOBALS['user']->perms === 'root';
URLHelper::bindLinkParam('username', $username);
}
}
$this->limit = $GLOBALS['user']->cfg->PERSONAL_FILES_ENTRIES_PER_PAGE ?: Config::get()->ENTRIES_PER_PAGE;
$this->userConfig = DocUsergroupConfig::getUserConfig($GLOBALS['user']->id);
if ($this->userConfig['area_close'] == 1) {
$this->redirect('document/closed/index');
}
if (Request::isPost()) {
CSRFProtection::verifySecurityToken();
}
if (($ticket = Request::get('studip-ticket')) && !check_ticket($ticket)) {
$message = _('Bei der Verarbeitung Ihrer Anfrage ist ein Fehler aufgetreten.') . "\n" . _('Bitte versuchen Sie es erneut.');
PageLayout::postMessage(MessageBox::error($message));
$this->redirect('document/files/index');
}
}
示例8: 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::setTitle(_('Allgemeine Einstellungen anpassen'));
Navigation::activateItem('/profile/settings/general');
SkipLinks::addIndex(_('Allgemeine Einstellungen anpassen'), 'layout_content', 100);
}
示例9: __construct
/**
* Initialize a new instance of the plugin.
*/
function __construct()
{
parent::__construct();
if (Config::get()->WYSIWYG && is_object($GLOBALS['user'])) {
if (strpos($_SERVER['REQUEST_URI'], 'dispatch.php/settings/general') !== false) {
if (Request::submitted('forced_language')) {
$GLOBALS['user']->cfg->store('WYSIWYG_DISABLE', Request::submitted('wysiwyg_user_config'));
}
$snippet = '
<tr>
<td>
<label for="wysiwyg_user_config">
WYSIWYG Editor ausschalten<br>
<dfn id="cookie_auth_token_description">
Mit dieser Einstellung können Sie den Stud.IP WYSIWYG Editor ausschalten. Dadurch müssen Sie ggf. Texte in HTML schreiben.
</dfn>
</label>
</td>
<td>
<input type="checkbox" value="1" aria-describedby="wysiwyg_user_config" id="wysiwyg_user_config" name="wysiwyg_user_config" ' . ($GLOBALS['user']->cfg->WYSIWYG_DISABLE ? 'checked' : '') . '>
</td>
</tr>';
$snippet = jsready($snippet, 'script-double');
PageLayout::addHeadElement('script', array('type' => 'text/javascript'), "jQuery(function (\$) {\$('#main_content tbody tr').first().after('{$snippet}');});");
}
if (!(Config::get()->WYSIWYG = !$GLOBALS['user']->cfg->WYSIWYG_DISABLE)) {
$old_packages = array_flip(PageLayout::getSqueezePackages());
unset($old_packages['wysiwyg']);
call_user_func_array('PageLayout::setSqueezePackages', array_values(array_flip($old_packages)));
}
}
}
示例10: overview_action
public function overview_action()
{
Navigation::activateItem("/admin/locations/sem_classes");
if (count($_POST) && Request::submitted('delete') && Request::get("delete_sem_class")) {
$sem_class = $GLOBALS['SEM_CLASS'][Request::get("delete_sem_class")];
if ($sem_class->delete()) {
PageLayout::postMessage(MessageBox::success(_("Veranstaltungskategorie wurde gelöscht.")));
$GLOBALS['SEM_CLASS'] = SemClass::refreshClasses();
}
}
if (count($_POST) && Request::get("add_name")) {
$statement = DBManager::get()->prepare("SELECT 1 FROM sem_classes WHERE name = :name");
$statement->execute(array('name' => Request::get("add_name")));
$duplicate = $statement->fetchColumn();
if ($duplicate) {
$message = sprintf(_("Es existiert bereits eine Veranstaltungskategorie mit dem Namen \"%s\""), Request::get("add_name"));
PageLayout::postMessage(MessageBox::error($message));
$this->redirect('admin/sem_classes/overview');
} else {
$statement = DBManager::get()->prepare("INSERT INTO sem_classes SET name = :name, mkdate = UNIX_TIMESTAMP(), chdate = UNIX_TIMESTAMP() " . "");
$statement->execute(array('name' => Request::get("add_name")));
$id = DBManager::get()->lastInsertId();
if (Request::get("add_like")) {
$sem_class = clone $GLOBALS['SEM_CLASS'][Request::get("add_like")];
$sem_class->set('name', Request::get("add_name"));
$sem_class->set('id', $id);
$sem_class->store();
}
$this->redirect(URLHelper::getURL($this->url_for('admin/sem_classes/details'), array('id' => $id)));
PageLayout::postMessage(MessageBox::success(_("Veranstaltungskategorie wurde erstellt.")));
$GLOBALS['SEM_CLASS'] = SemClass::refreshClasses();
}
}
}
示例11: auth_registerform
/**
*
*/
function auth_registerform()
{
// set up dummy user environment
if ($GLOBALS['user']->id !== 'nobody') {
$GLOBALS['user'] = new Seminar_User('nobody');
$GLOBALS['perm'] = new Seminar_Perm();
$GLOBALS['auth'] = $this;
}
// set up user session
include 'lib/seminar_open.php';
if (!$_COOKIE[get_class($GLOBALS['sess'])]) {
$register_template = $GLOBALS['template_factory']->open('nocookies');
} else {
$register_template = $GLOBALS['template_factory']->open('registerform');
$register_template->set_attribute('validator', new email_validation_class());
$register_template->set_attribute('error_msg', $this->error_msg);
$register_template->set_attribute('username', Request::get('username'));
$register_template->set_attribute('Vorname', Request::get('Vorname'));
$register_template->set_attribute('Nachname', Request::get('Nachname'));
$register_template->set_attribute('Email', Request::get('Email'));
$register_template->set_attribute('title_front', Request::get('title_front'));
$register_template->set_attribute('title_rear', Request::get('title_rear'));
$register_template->set_attribute('geschlecht', Request::int('geschlecht', 0));
}
PageLayout::setHelpKeyword('Basis.AnmeldungRegistrierung');
PageLayout::setTitle(_('Registrierung'));
// $header_template = $GLOBALS['template_factory']->open('header');
// $header_template->current_page = _('Registrierung');
$layout = $GLOBALS['template_factory']->open('layouts/base.php');
$register_template->set_layout($layout);
// include 'lib/include/html_head.inc.php';
// echo $header_template->render();
echo $register_template->render();
// include 'lib/include/html_end.inc.php';
}
示例12: fetchData
public function fetchData()
{
if ($this->already_fetched) {
return;
}
$this->already_fetched = true;
try {
if (!$this->customImportEnabled()) {
if (in_array($this['source'], array("csv_upload", "extern"))) {
return;
} elseif ($this['source'] === "database") {
$this->fetchDataFromDatabase();
return;
} elseif ($this['source'] === "csv_weblink") {
$this->fetchDataFromWeblink();
return;
} elseif ($this['source'] === "csv_studipfile") {
$output = $this->getCSVDataFromFile(get_upload_file_path($this['tabledata']['weblink']['file_id']), ";");
$headline = array_shift($output);
$this->createTable($headline, $output);
return;
}
} else {
$this->getPlugin()->fetchData();
}
} catch (Exception $e) {
PageLayout::postMessage(MessageBox::error(sprintf(_("Konnte Tabelle '%s' nicht mit Daten befüllen."), $this['name'])));
}
}
示例13: index_action
/**
* Displays a page.
*/
public function index_action($id = null)
{
Navigation::activateItem('/course/literature/view');
PageLayout::setTitle($_SESSION['SessSemName']["header_line"] . " - " . _("Literatur"));
$this->list = StudipLitList::GetFormattedListsByRange($_SESSION["SessionSeminar"], object_get_visit($_SESSION["SessionSeminar"], "literature"));
$this->_range_id = $_SESSION["SessionSeminar"];
}
示例14: 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.MyStudIPPrivacy');
PageLayout::setTitle(_('Privatsphäre'));
Navigation::activateItem('/profile/settings/privacy');
SkipLinks::addIndex(_('Privatsphäre'), 'layout_content', 100);
}
示例15: perform
/**
* This method dispatches all actions.
*
* @param string $unconsumed_path part of the dispatch path that was not consumed
*/
public function perform($unconsumed_path)
{
$this->setupAutoload();
// Add JS and StyleSheet to header
PageLayout::addScript($this->getPluginURL() . '/javascript/forum.js');
PageLayout::addStylesheet($this->getPluginURL() . '/stylesheets/forum.css');
parent::perform($unconsumed_path);
}