1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-25 10:26:17 +02:00

Merge branch '44208-27' of git://github.com/samhemelryk/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2014-02-19 01:28:53 +01:00
commit 6030ef565f
4 changed files with 55 additions and 15 deletions

@ -1,4 +1,26 @@
<?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);
$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());

@ -1,4 +1,26 @@
<?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);
$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());

@ -29,8 +29,7 @@
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)) {
$regionprewidth = $theme->settings->regionprewidth;
$regionpostwidth = $theme->settings->regionpostwidth;
@ -40,8 +39,7 @@ function nonzero_process_css($css, $theme) {
}
$css = nonzero_set_regionwidths($css, $regionprewidth, $regionpostwidth);
// Set the custom CSS
// Set the custom CSS.
if (!empty($theme->settings->customcss)) {
$customcss = $theme->settings->customcss;
} else {
@ -49,7 +47,7 @@ function nonzero_process_css($css, $theme) {
}
$css = nonzero_set_customcss($css, $customcss);
// Return the CSS
// Return the CSS.
return $css;
}
@ -57,10 +55,10 @@ function nonzero_process_css($css, $theme) {
* Sets the region width variable in CSS
*
* @param string $css
* @param mixed $regionwidth
* @param string $regionprewidth
* @param string $regionpostwidth
* @return string
*/
function nonzero_set_regionwidths($css, $regionprewidth, $regionpostwidth) {
$tag1 = '[[setting:regionprewidth]]';
$tag2 = '[[setting:regionpostwidth]]';
@ -74,20 +72,18 @@ function nonzero_set_regionwidths($css, $regionprewidth, $regionpostwidth) {
}
$css = str_replace($tag1, $replacement1.'px', $css);
$css = str_replace($tag2, $replacement2.'px', $css);
$css = str_replace($tag3, ($replacement1+$replacement2).'px', $css);
$css = str_replace($tag4, (2*$replacement1+$replacement2).'px', $css);
$css = str_replace($tag3, ($replacement1 + $replacement2).'px', $css);
$css = str_replace($tag4, (2 * $replacement1 + $replacement2).'px', $css);
return $css;
}
/**
* Sets the custom css variable in CSS
*
* @param string $css
* @param mixed $customcss
* @param string $customcss
* @return string
*/
function nonzero_set_customcss($css, $customcss) {
$tag = '[[setting:customcss]]';
$replacement = $customcss;

@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
// Block region-pre width
// Block region-pre width.
$name = 'theme_nonzero/regionprewidth';
$title = get_string('regionprewidth','theme_nonzero');
$description = get_string('regionprewidthdesc', 'theme_nonzero');
@ -40,7 +40,7 @@ if ($ADMIN->fulltree) {
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Block region-post width
// Block region-post width.
$name = 'theme_nonzero/regionpostwidth';
$title = get_string('regionpostwidth','theme_nonzero');
$description = get_string('regionpostwidthdesc', 'theme_nonzero');
@ -50,7 +50,7 @@ if ($ADMIN->fulltree) {
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Custom CSS file
// Custom CSS file.
$name = 'theme_nonzero/customcss';
$title = get_string('customcss','theme_nonzero');
$description = get_string('customcssdesc', 'theme_nonzero');