本文整理汇总了PHP中PageLayout::addStylesheet方法的典型用法代码示例。如果您正苦于以下问题:PHP PageLayout::addStylesheet方法的具体用法?PHP PageLayout::addStylesheet怎么用?PHP PageLayout::addStylesheet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageLayout
的用法示例。
在下文中一共展示了PageLayout::addStylesheet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_action
public function show_action()
{
//JavaScript Datei hinzufühen
PageLayout::addScript($this->getPluginURL() . '/assets/js/raumbelegungen.js');
//CSS Datei hinzufügen
PageLayout::addStylesheet($this->getPluginURL() . '/assets/css/raumbelegung.css');
//Sammeln der Informationen die Auf der Startseite benoetigt werden
$template = $this->getTemplate("start.php");
$start = $this->raumbelegung->getStart();
$template->set_attribute('gebaude', $start["gebaeude"]);
$template->set_attribute('auswahl', $start["auswahl"]);
if (isset($_REQUEST["gebaude"])) {
//echo $auswahlgeb;
if (isset($_REQUEST["von"]) and $_REQUEST["von"] != "00.00.0000") {
$von = $this->raumbelegung->dateToUnix($_GET["von"]);
} else {
$von = time();
}
if (isset($_REQUEST["bis"]) and $_REQUEST["bis"] != "00.00.0000") {
if ($_REQUEST["bis"] != $_REQUEST["von"]) {
$bis = $this->raumbelegung->dateToUnix($_REQUEST["bis"], "24");
} else {
$bis = $this->raumbelegung->dateToUnix($_REQUEST["bis"], "22");
}
// Wenn gleicher Tag dann nur bis 22Uhr
} else {
$bis = $von;
}
$termine = $this->getTermine($von, $bis, $start["auswahl"]["gebaeude"]);
$template->set_attribute('termine', $termine);
} else {
$template->set_attribute('termine', "");
}
echo $template->render();
}
示例2: 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();
}
示例3: 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);
}
示例4: index_action
/**
* this action is the main action of the schedule-controller, setting the environment for the timetable,
* accepting a comma-separated list of days.
*
* @param string a list of an arbitrary mix of the numbers 0-6, separated with a comma (e.g. 1,2,3,4,5 (for Monday to Friday, the default))
*/
function index_action($days = false)
{
if ($GLOBALS['perm']->have_perm('admin')) {
$inst_mode = true;
}
$my_schedule_settings = $GLOBALS['user']->cfg->SCHEDULE_SETTINGS;
// set the days to be displayed
if ($days === false) {
if (Request::getArray('days')) {
$this->days = array_keys(Request::getArray('days'));
} else {
$this->days = array(0, 1, 2, 3, 4, 5, 6);
}
} else {
$this->days = explode(',', $days);
}
// try to find the correct institute-id
$institute_id = Request::option('institute_id', $SessSemName[1] ? $SessSemName[1] : Request::option('cid', false));
if (!$institute_id) {
$institute_id = $GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT;
}
if (!$institute_id || in_array(get_object_type($institute_id), words('inst fak')) === false) {
throw new Exception(sprintf(_('Kann Einrichtungskalendar nicht anzeigen!' . 'Es wurde eine ungültige Instituts-Id übergeben (%s)!', $institute_id)));
}
// load semester-data and current semester
$semdata = new SemesterData();
$this->semesters = $semdata->getAllSemesterData();
if (Request::option('semester_id')) {
$this->current_semester = $semdata->getSemesterData(Request::option('semester_id'));
} else {
$this->current_semester = $semdata->getCurrentSemesterData();
}
$this->entries = (array) CalendarInstscheduleModel::getInstituteEntries($GLOBALS['user']->id, $this->current_semester, 8, 20, $institute_id, $this->days);
Navigation::activateItem('/course/main/schedule');
PageLayout::setHelpKeyword('Basis.TerminkalenderStundenplan');
PageLayout::setTitle($GLOBALS['SessSemName']['header_line'] . ' - ' . _('Veranstaltungs-Stundenplan'));
$zoom = Request::int('zoom', 0);
$this->controller = $this;
$this->calendar_view = new CalendarWeekView($this->entries, 'instschedule');
$this->calendar_view->setHeight(40 + 20 * $zoom);
$this->calendar_view->setRange($my_schedule_settings['glb_start_time'], $my_schedule_settings['glb_end_time']);
$this->calendar_view->groupEntries();
// if enabled, group entries with same start- and end-date
URLHelper::addLinkParam('zoom', $zoom);
URLHelper::addLinkParam('semester_id', $this->current_semester['semester_id']);
$style_parameters = array('whole_height' => $this->calendar_view->getOverallHeight(), 'entry_height' => $this->calendar_view->getHeight());
$factory = new Flexi_TemplateFactory($this->dispatcher->trails_root . '/views');
PageLayout::addStyle($factory->render('calendar/stylesheet', $style_parameters));
if (Request::option('printview')) {
PageLayout::addStylesheet('print.css');
} else {
PageLayout::addStylesheet('print.css', array('media' => 'print'));
}
}
示例5: includePolyfills
private function includePolyfills($target_version = null)
{
if ($target_version === null) {
$target_version = $GLOBALS['SOFTWARE_VERSION'];
}
if ($target_version < '2.1') {
require_once 'polyfills/CSRFProtection.php';
require_once 'polyfills/SkipLinks.php';
}
if ($target_version < '2.2') {
require_once 'polyfills/UpdateInformation.php';
}
if ($target_version < '2.3') {
require_once 'polyfills/Button.php';
require_once 'polyfills/LinkButton.php';
PageLayout::addStylesheet($this->getPluginURL() . '/polyfills/buttons.css');
}
}
示例6: before_filter
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
Navigation::activateItem('/admin/config/document_area');
PageLayout::setTitle(_('Dateibereich') . ' - ' . _('Administration'));
if (Request::isXhr()) {
$this->set_layout(null);
$this->set_content_type('text/html;Charset=windows-1252');
} else {
$this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
}
if(empty($_SESSION['document_config_filter'])){
$_SESSION['document_config_filter'] = 'all';
}
PageLayout::addScript('ui.multiselect.js');
PageLayout::addStylesheet('jquery-ui-multiselect.css');
$this->getInfobox();
}
示例7: compact
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?
if ($quick_view_mode === 'no_nav' || Request::get('print_view')) {
PageLayout::disableHeader();
}
if (Request::get('print_view')){
PageLayout::removeStylesheet('style.css');
PageLayout::addStylesheet('print.css'); // use special stylesheet for printing
}
Sidebar::get()->setImage('sidebar/resources-sidebar.png');
// Add clipboard if neccessary (another hack meets the core)
if (is_object($clipObj)) {
$form = $clipObj->getFormObject();
$action = $quick_view
? URLHelper::getLink('', compact('quick_view', 'quick_view_mode'))
: URLHelper::getLink('', compact('view', 'quick_view_mode'));
ob_start();
echo $form->getFormStart($action);
$clipObj->showClip(false, '100%');
echo $form->getFormEnd();
示例8: __construct
public function __construct()
{
parent::__construct();
// instantiate patching template factory
$GLOBALS['template_factory'] = new VHS\PatchTemplateFactory($GLOBALS['template_factory'], realpath($this->getPluginPath() . '/templates'));
global $perm;
$username = Request::get('username', $auth->auth['uname']);
PageLayout::addStylesheet($this->getPluginUrl() . '/css/startseite.css');
PageLayout::addStylesheet($this->getPluginUrl() . '/css/courseware.css');
//falls Mooc.IP aktiviert ist, Icon aus der Kopfzeile ausblenden
if (Navigation::hasItem('/mooc')) {
Navigation::removeItem('/mooc');
}
if (!$perm->have_perm('admin') && $perm->get_perm() != 'nobody') {
if (Navigation::hasItem('/search')) {
Navigation::removeItem('/search');
}
if (Navigation::hasItem('/tools')) {
if (!$perm->have_perm('dozent')) {
if (Navigation::hasItem('/tools/elearning')) {
Navigation::removeItem('/tools/elearning');
}
if (Navigation::hasItem('/tools/evaluation')) {
Navigation::removeItem('/tools/evaluation');
}
}
}
/**
if (Navigation::hasItem('/course/main/courses')){
// Navigation::removeItem('/course/main/courses');
}
if (Navigation::hasItem('/course/main/schedule')){
// Navigation::removeItem('/course/main/schedule');
}
**/
if (Navigation::hasItem('/tools')) {
Navigation::getItem('/tools')->setImage(NULL);
}
if (Navigation::hasItem('/tools/rss')) {
Navigation::removeItem('/tools/rss');
}
if (Navigation::hasItem('/tools/literature')) {
Navigation::removeItem('/tools/literature');
}
if (Navigation::hasItem('/profile/edit/study_data')) {
Navigation::removeItem('/profile/edit/study_data');
}
if (Navigation::hasItem('/start/search')) {
Navigation::removeItem('/start/search');
}
if (Navigation::hasItem('/browse')) {
$stmt = DBManager::get()->prepare("SELECT su.seminar_id FROM seminar_user su\n\t\t\t\t\tWHERE su.user_id = ?");
$stmt->execute(array($GLOBALS['user']->id));
$count = $stmt->rowCount();
if ($count == 1) {
$result = $stmt->fetch();
Navigation::getItem('/browse')->setURL("/seminar_main.php?auswahl=" . $result['seminar_id']);
Navigation::getItem('/browse')->setTitle("Mein Kurs");
}
if ($count == 0 && !$perm->have_perm('tutor')) {
Navigation::removeItem('/browse');
}
}
if (Navigation::hasItem('/course')) {
$stmt = DBManager::get()->prepare("SELECT su.seminar_id FROM seminar_user su\n\t\t\t\t\tWHERE su.user_id = ?");
$stmt->execute(array($GLOBALS['user']->id));
$count = $stmt->rowCount();
if ($count == 1) {
$result = $stmt->fetch();
Navigation::getItem('/course')->setURL("/seminar_main.php?auswahl=" . $result['seminar_id']);
Navigation::getItem('/course')->setTitle("Mein Kurs");
}
}
if (Navigation::hasItem('/start/my_courses')) {
if (Navigation::hasItem('/start/my_courses/browse')) {
Navigation::removeItem('/start/my_courses/browse');
}
if (Navigation::hasItem('/start/my_courses/new_studygroup')) {
Navigation::removeItem('/start/my_courses/new_studygroup');
}
if (Navigation::hasItem('/start/tools')) {
Navigation::removeItem('/start/tools');
}
$stmt = DBManager::get()->prepare("SELECT su.seminar_id FROM seminar_user su\n\t\t\t\t\tWHERE su.user_id = ?");
$stmt->execute(array($GLOBALS['user']->id));
$count = $stmt->rowCount();
if ($count == 1) {
$result = $stmt->fetch();
Navigation::getItem('/start/my_courses')->setURL("/seminar_main.php?auswahl=" . $result['seminar_id']);
Navigation::getItem('/start/my_courses')->setTitle("Mein Kurs");
}
if ($count == 0) {
Navigation::removeItem('/start/my_courses');
}
if ($count > 1) {
Navigation::getItem('/start/my_courses')->setTitle("Kurse");
}
}
if (Navigation::hasItem('/start/community/browse')) {
//.........这里部分代码省略.........
示例9: _
///////////////////////////////////////////////////////////
// Start of Output
PageLayout::setHelpKeyword("Basis.Dateien");
PageLayout::setTitle($SessSemName["header_line"]. " - " . _("Dateien"));
if ($folder_system_data['cmd'] == 'all') {
Navigation::activateItem('/course/files/all');
} else {
Navigation::activateItem('/course/files/tree');
}
$config = Config::get();
if ($config['FILESYSTEM_MULTICOPY_ENABLE']) {
PageLayout::addStylesheet('jquery-ui-multiselect.css');
PageLayout::addScript('ui.multiselect.js');
}
ob_start();
// Hauptteil
if (!isset($range_id))
$range_id = $SessSemName[1] ;
//JS Routinen einbinden, wenn benoetigt. Wird in der Funktion gecheckt, ob noetig...
JS_for_upload();
//we need this <body> tag, sad but true :)
echo "\n<body onUnLoad=\"STUDIP.OldUpload.upload_end()\">";
?>
示例10: page_open
require '../lib/bootstrap.php';
page_open(array("sess" => "Seminar_Session", "auth" => "Seminar_Auth", "perm" => "Seminar_Perm", "user" => "Seminar_User"));
$perm->check("user");
include('lib/seminar_open.php'); // initialise Stud.IP-Session
// -- here you have to put initialisations for the current page
$druck = Request::option('druck');
$wiki_dump_id = Request::option('wiki_dump_id');
$forum_dump_id = Request::option('forum_dump_id');
$dump_id = Request::option('dump_id');
if ($druck) {
PageLayout::removeStylesheet('style.css');
PageLayout::addStylesheet('print.css');
}
PageLayout::setHelpKeyword("Basis.Archiv");
PageLayout::setTitle(_("Archiv"));
Navigation::activateItem('/search/archive');
// Start of Output
ob_start();
require_once 'lib/msg.inc.php';
require_once 'lib/datei.inc.php';
require_once 'lib/log_events.inc.php';
$delete_id = Request::option('delete_id');
$open = Request::option('open');
示例11: index_action
/**
* this action is the main action of the schedule-controller, setting the environment
* for the timetable, accepting a comma-separated list of days.
*
* @param string $days a list of an arbitrary mix of the numbers 0-6, separated
* with a comma (e.g. 1,2,3,4,5 (for Monday to Friday, the default))
* @return void
*/
function index_action($days = false)
{
global $user;
$schedule_settings = CalendarScheduleModel::getScheduleSettings();
if ($GLOBALS['perm']->have_perm('admin')) {
$inst_mode = true;
}
if ($inst_mode) {
// try to find the correct institute-id
$institute_id = Request::option('institute_id', $SessSemName[1] ? $SessSemName[1] : Request::option('cid', false));
if (!$institute_id) {
$institute_id = UserConfig::get($user->id)->MY_INSTITUTES_DEFAULT;
}
if (!$institute_id || !in_array(get_object_type($institute_id), words('fak inst'))) {
throw new Exception('Cannot display institute-calender. No valid ID given!');
}
Navigation::activateItem('/browse/my_courses/schedule');
} else {
Navigation::activateItem('/calendar/schedule');
}
// check, if the hidden seminar-entries shall be shown
$show_hidden = Request::int('show_hidden', 0);
// load semester-data and current semester
$semdata = new SemesterData();
$this->semesters = array_reverse($semdata->getAllSemesterData());
if (Request::option('semester_id')) {
$this->current_semester = $semdata->getSemesterData(Request::option('semester_id'));
} else {
$this->current_semester = $semdata->getCurrentSemesterData();
}
// check type-safe if days is false otherwise sunday (0) cannot be chosen
if ($days === false) {
if (Request::getArray('days')) {
$this->days = array_keys(Request::getArray('days'));
} else {
$this->days = $schedule_settings['glb_days'];
foreach ($this->days as $key => $day_number) {
$this->days[$key] = ($day_number + 6) % 7;
}
}
} else {
$this->days = explode(',', $days);
}
$this->controller = $this;
$this->calendar_view = $inst_mode ? CalendarScheduleModel::getInstCalendarView($institute_id, $show_hidden, $this->current_semester, $this->days) : CalendarScheduleModel::getUserCalendarView($GLOBALS['user']->id, $show_hidden, $this->current_semester, $this->days);
// have we chosen an entry to display?
if ($this->flash['entry']) {
if ($inst_mode) {
$this->show_entry = $this->flash['entry'];
} else {
if ($this->flash['entry']['id'] == null) {
$this->show_entry = $this->flash['entry'];
} else {
foreach ($this->calendar_view->getColumns() as $entry_days) {
foreach ($entry_days->getEntries() as $entry) {
if ($this->flash['entry']['cycle_id']) {
if ($this->flash['entry']['id'] . '-' . $this->flash['entry']['cycle_id'] == $entry['id']) {
$this->show_entry = $entry;
$this->show_entry['id'] = reset(explode('-', $this->show_entry['id']));
}
} else {
if ($entry['id'] == $this->flash['entry']['id']) {
$this->show_entry = $entry;
}
}
}
}
}
}
}
$style_parameters = array('whole_height' => $this->calendar_view->getOverallHeight(), 'entry_height' => $this->calendar_view->getHeight());
$factory = new Flexi_TemplateFactory($this->dispatcher->trails_root . '/views');
PageLayout::addStyle($factory->render('calendar/stylesheet', $style_parameters), 'screen, print');
if (Request::option('printview')) {
$this->calendar_view->setReadOnly();
PageLayout::addStylesheet('print.css');
} else {
PageLayout::addStylesheet('print.css', array('media' => 'print'));
}
$this->show_hidden = $show_hidden;
$inst = get_object_name($institute_id, 'inst');
$this->inst_mode = $inst_mode;
$this->institute_name = $inst['name'];
$this->institute_id = $institute_id;
if (Request::get('show_settings')) {
$this->show_settings = true;
}
}
示例12: print_view_action
/**
* Displays print view of literature list
*/
public function print_view_action()
{
PageLayout::removeStylesheet('style.css');
PageLayout::addStylesheet('print.css');
// use special stylesheet for printing
$_range_id = Request::option('_range_id');
if ($_range_id != $GLOBALS['user']->id && !$GLOBALS['perm']->have_studip_perm('user', $_range_id)) {
throw new AccessDeniedException();
}
$_the_tree = TreeAbstract::GetInstance("StudipLitList", $_range_id);
$this->title = sprintf(_("Literatur %s"), $_the_tree->root_name);
$this->list = StudipLitList::GetFormattedListsByRange($_range_id, false, false);
}
示例13: json_encode
<?
global $template_factory;
$this->set_layout($template_factory->open('layouts/base_without_infobox'));
$ASSETS = $plugin->getPluginURL() . '/assets/';
PageLayout::addStylesheet($ASSETS . 'css/questions/styles.css');
PageLayout::addScript($ASSETS . 'js/vendor/validator.js');
PageLayout::addHeadElement('script', array(),
'
var cliqr = {bootstrap: {}, config: {
PLUGIN_URL : "' . htmlReady(current(explode('?', $controller->url_for("")))) . '"
, CID : "' . htmlReady($cid) . '"
, ASSETS : "' . htmlReady($ASSETS) . '"
, SHORT_URL : "' . htmlReady($short_url) . '"
}};
');
?>
<!-- BEGIN CLIQR PAGE -->
<script>
cliqr.bootstrap.POLLS = <?php
echo json_encode(array_map(function ($q) {
return $q->toJSON();
}, $questions));
?>
;
</script>
<div id="cliqr-container"></div>
<!-- END CLIQR PAGE -->
示例14: printWikiPage
/**
* Display wiki page for print.
*
* @param string keyword WikiPage name
* @param string version WikiPage version
*
**/
function printWikiPage($keyword, $version) {
global $SessSemName;
$wikiData=getWikiPage($keyword, $version);
PageLayout::removeStylesheet('style.css');
PageLayout::addStylesheet('print.css'); // use special stylesheet for printing
include ('lib/include/html_head.inc.php'); // Output of html head
echo "<p><em>" . htmlReady($SessSemName['header_line']) ."</em></p>";
echo "<h1>" . htmlReady($keyword) ."</h1>";
echo "<p><em>";
echo sprintf(_("Version %s, letzte Änderung %s von %s."), $wikiData['version'],
date("d.m.Y, H:i", $wikiData['chdate']), get_fullname($wikiData['user_id'], 'full', 1));
echo "</em></p>";
echo "<hr>";
echo wikiReady($wikiData['body'], TRUE, FALSE, "none");
echo "<hr><p><font size=-1>created by Stud.IP Wiki-Module ";
echo date("d.m.Y, H:i", time());
echo " </font></p>";
include ('lib/include/html_end.inc.php');
}
示例15: addStylesheet
/**
* Includes given stylesheet in page, compiles less if neccessary
*
* @param String $filename Name of the stylesheet (css or less) to include
* (relative to plugin directory)
*/
protected function addStylesheet($filename)
{
if (substr($filename, -5) !== '.less') {
$url = $this->getPluginURL() . '/' . $filename;
PageLayout::addStylesheet($url);
return;
}
// Create absolute path to less file
$less_file = $GLOBALS['ABSOLUTE_PATH_STUDIP'] . $this->getPluginPath() . '/' . $filename;
// Fail if file does not exist
if (!file_exists($less_file)) {
throw new Exception('Could not locate LESS file "' . $filename . '"');
}
// Get plugin version from metadata
$metadata = $this->getMetadata();
$plugin_version = $metadata['version'];
// Get plugin id (or parent plugin id if any)
$plugin_id = $this->plugin_info['depends'] ?: $this->getPluginId();
// Get asset file from storage
$asset = Assets\Storage::getFactory()->createCSSFile($less_file, array('plugin_id' => $this->plugin_info['depends'] ?: $this->getPluginId(), 'plugin_version' => $metadata['version']));
// Compile asset if neccessary
if ($asset->isNew()) {
$less = file_get_contents($less_file);
$css = Assets\Compiler::compileLESS($less, array('plugin-path' => $this->getPluginURL()));
$asset->setContent($css);
}
// Include asset in page by reference or directly
$download_uri = $asset->getDownloadLink();
if ($download_uri === false) {
PageLayout::addStyle($asset->getContent());
} else {
PageLayout::addHeadElement('link', ['rel' => 'stylesheet', 'href' => $download_uri, 'type' => 'text/css']);
}
}