mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch '44208-27' of git://github.com/samhemelryk/moodle
This commit is contained in:
commit
6030ef565f
4 changed files with 55 additions and 15 deletions
|
@ -1,4 +1,26 @@
|
||||||
<?php
|
<?php
|
||||||
|
// This file is part of Moodle - http://moodle.org/
|
||||||
|
//
|
||||||
|
// Moodle is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Moodle is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The frontpage layout.
|
||||||
|
*
|
||||||
|
* @package theme_nonzero
|
||||||
|
* @copyright 2010 Patrick Malley
|
||||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
|
*/
|
||||||
|
|
||||||
$hasheading = ($PAGE->heading);
|
$hasheading = ($PAGE->heading);
|
||||||
$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
|
$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
|
||||||
|
|
|
@ -1,4 +1,26 @@
|
||||||
<?php
|
<?php
|
||||||
|
// This file is part of Moodle - http://moodle.org/
|
||||||
|
//
|
||||||
|
// Moodle is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Moodle is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The default layout.
|
||||||
|
*
|
||||||
|
* @package theme_nonzero
|
||||||
|
* @copyright 2010 Patrick Malley
|
||||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
|
*/
|
||||||
|
|
||||||
$hasheading = ($PAGE->heading);
|
$hasheading = ($PAGE->heading);
|
||||||
$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
|
$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
|
||||||
|
|
|
@ -29,8 +29,7 @@
|
||||||
|
|
||||||
function nonzero_process_css($css, $theme) {
|
function nonzero_process_css($css, $theme) {
|
||||||
|
|
||||||
|
// Set the region-pre and region-post widths.
|
||||||
// Set the region-pre and region-post widths
|
|
||||||
if (!empty($theme->settings->regionprewidth) && !empty($theme->settings->regionpostwidth)) {
|
if (!empty($theme->settings->regionprewidth) && !empty($theme->settings->regionpostwidth)) {
|
||||||
$regionprewidth = $theme->settings->regionprewidth;
|
$regionprewidth = $theme->settings->regionprewidth;
|
||||||
$regionpostwidth = $theme->settings->regionpostwidth;
|
$regionpostwidth = $theme->settings->regionpostwidth;
|
||||||
|
@ -40,8 +39,7 @@ function nonzero_process_css($css, $theme) {
|
||||||
}
|
}
|
||||||
$css = nonzero_set_regionwidths($css, $regionprewidth, $regionpostwidth);
|
$css = nonzero_set_regionwidths($css, $regionprewidth, $regionpostwidth);
|
||||||
|
|
||||||
|
// Set the custom CSS.
|
||||||
// Set the custom CSS
|
|
||||||
if (!empty($theme->settings->customcss)) {
|
if (!empty($theme->settings->customcss)) {
|
||||||
$customcss = $theme->settings->customcss;
|
$customcss = $theme->settings->customcss;
|
||||||
} else {
|
} else {
|
||||||
|
@ -49,7 +47,7 @@ function nonzero_process_css($css, $theme) {
|
||||||
}
|
}
|
||||||
$css = nonzero_set_customcss($css, $customcss);
|
$css = nonzero_set_customcss($css, $customcss);
|
||||||
|
|
||||||
// Return the CSS
|
// Return the CSS.
|
||||||
return $css;
|
return $css;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,10 +55,10 @@ function nonzero_process_css($css, $theme) {
|
||||||
* Sets the region width variable in CSS
|
* Sets the region width variable in CSS
|
||||||
*
|
*
|
||||||
* @param string $css
|
* @param string $css
|
||||||
* @param mixed $regionwidth
|
* @param string $regionprewidth
|
||||||
|
* @param string $regionpostwidth
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function nonzero_set_regionwidths($css, $regionprewidth, $regionpostwidth) {
|
function nonzero_set_regionwidths($css, $regionprewidth, $regionpostwidth) {
|
||||||
$tag1 = '[[setting:regionprewidth]]';
|
$tag1 = '[[setting:regionprewidth]]';
|
||||||
$tag2 = '[[setting:regionpostwidth]]';
|
$tag2 = '[[setting:regionpostwidth]]';
|
||||||
|
@ -79,15 +77,13 @@ function nonzero_set_regionwidths($css, $regionprewidth, $regionpostwidth) {
|
||||||
return $css;
|
return $css;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the custom css variable in CSS
|
* Sets the custom css variable in CSS
|
||||||
*
|
*
|
||||||
* @param string $css
|
* @param string $css
|
||||||
* @param mixed $customcss
|
* @param string $customcss
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function nonzero_set_customcss($css, $customcss) {
|
function nonzero_set_customcss($css, $customcss) {
|
||||||
$tag = '[[setting:customcss]]';
|
$tag = '[[setting:customcss]]';
|
||||||
$replacement = $customcss;
|
$replacement = $customcss;
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
defined('MOODLE_INTERNAL') || die;
|
defined('MOODLE_INTERNAL') || die;
|
||||||
|
|
||||||
if ($ADMIN->fulltree) {
|
if ($ADMIN->fulltree) {
|
||||||
// Block region-pre width
|
// Block region-pre width.
|
||||||
$name = 'theme_nonzero/regionprewidth';
|
$name = 'theme_nonzero/regionprewidth';
|
||||||
$title = get_string('regionprewidth','theme_nonzero');
|
$title = get_string('regionprewidth','theme_nonzero');
|
||||||
$description = get_string('regionprewidthdesc', 'theme_nonzero');
|
$description = get_string('regionprewidthdesc', 'theme_nonzero');
|
||||||
|
@ -40,7 +40,7 @@ if ($ADMIN->fulltree) {
|
||||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||||
$settings->add($setting);
|
$settings->add($setting);
|
||||||
|
|
||||||
// Block region-post width
|
// Block region-post width.
|
||||||
$name = 'theme_nonzero/regionpostwidth';
|
$name = 'theme_nonzero/regionpostwidth';
|
||||||
$title = get_string('regionpostwidth','theme_nonzero');
|
$title = get_string('regionpostwidth','theme_nonzero');
|
||||||
$description = get_string('regionpostwidthdesc', 'theme_nonzero');
|
$description = get_string('regionpostwidthdesc', 'theme_nonzero');
|
||||||
|
@ -50,7 +50,7 @@ if ($ADMIN->fulltree) {
|
||||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||||
$settings->add($setting);
|
$settings->add($setting);
|
||||||
|
|
||||||
// Custom CSS file
|
// Custom CSS file.
|
||||||
$name = 'theme_nonzero/customcss';
|
$name = 'theme_nonzero/customcss';
|
||||||
$title = get_string('customcss','theme_nonzero');
|
$title = get_string('customcss','theme_nonzero');
|
||||||
$description = get_string('customcssdesc', 'theme_nonzero');
|
$description = get_string('customcssdesc', 'theme_nonzero');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue