diff --git a/theme/sky_high/config.php b/theme/sky_high/config.php index 39343f0cb50..e4549c3502c 100644 --- a/theme/sky_high/config.php +++ b/theme/sky_high/config.php @@ -15,8 +15,6 @@ // along with Moodle. If not, see . /** - * - * * DO NOT MODIFY THIS THEME! * COPY IT FIRST, THEN RENAME THE COPY AND MODIFY IT INSTEAD. * @@ -24,7 +22,9 @@ * http://docs.moodle.org/dev/Themes_2.0 * * @package theme_sky_high - */ + * @copyright 2010 John Stabinger (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ $THEME->name = 'sky_high'; diff --git a/theme/sky_high/lang/en/theme_sky_high.php b/theme/sky_high/lang/en/theme_sky_high.php index 88f543b9b8c..f100398bc72 100644 --- a/theme/sky_high/lang/en/theme_sky_high.php +++ b/theme/sky_high/lang/en/theme_sky_high.php @@ -1,5 +1,4 @@ . /** - * Strings for component 'theme_standard', language 'en', branch 'MOODLE_20_STABLE' + * Strings for component 'theme_sky_high', language 'en'. * - * @package theme_standard - * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @package theme_sky_high + * @copyright 2010 John Stabinger (http://newschoollearning.com/) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/theme/sky_high/layout/frontpage.php b/theme/sky_high/layout/frontpage.php index 0a3ccf68010..87edb13f6b5 100644 --- a/theme/sky_high/layout/frontpage.php +++ b/theme/sky_high/layout/frontpage.php @@ -1,4 +1,26 @@ . + +/** + * The frontpage layout. + * + * @package theme_sky_high + * @copyright 2010 John Stabinger (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ $hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT); $hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT); diff --git a/theme/sky_high/layout/general.php b/theme/sky_high/layout/general.php index c9b4d983692..dd6f53538e2 100644 --- a/theme/sky_high/layout/general.php +++ b/theme/sky_high/layout/general.php @@ -1,4 +1,26 @@ . + +/** + * The default layout. + * + * @package theme_sky_high + * @copyright 2010 John Stabinger (http://newschoollearning.com/) + * @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()); diff --git a/theme/sky_high/layout/report.php b/theme/sky_high/layout/report.php index 562c76c9b2c..10117912e56 100644 --- a/theme/sky_high/layout/report.php +++ b/theme/sky_high/layout/report.php @@ -1,4 +1,26 @@ . + +/** + * The report layout. + * + * @package theme_sky_high + * @copyright 2010 John Stabinger (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ $hassidepre = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-pre', $OUTPUT)); $hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar()); diff --git a/theme/sky_high/lib.php b/theme/sky_high/lib.php index 2685878b966..f3cbf558dd5 100644 --- a/theme/sky_high/lib.php +++ b/theme/sky_high/lib.php @@ -1,21 +1,50 @@ . +/** + * This file contains functions specific to the needs of the Sky High theme. + * + * @package theme_sky_high + * @copyright 2010 John Stabinger (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * Processes CSS applying theme customisations before it is cached and delivered. + * + * @param string $css + * @param theme_config $theme + * @return string + */ function sky_high_process_css($css, $theme) { - + if (!empty($theme->settings->regionwidth)) { $regionwidth = $theme->settings->regionwidth; } else { $regionwidth = null; } $css = sky_high_set_regionwidth($css, $regionwidth); - + if (!empty($theme->settings->customcss)) { $customcss = $theme->settings->customcss; } else { $customcss = null; } $css = sky_high_set_customcss($css, $customcss); - + return $css; } @@ -23,7 +52,7 @@ function sky_high_process_css($css, $theme) { * Sets the region width variable in CSS * * @param string $css - * @param mixed $regionwidth + * @param string $regionwidth * @return string */ function sky_high_set_regionwidth($css, $regionwidth) { @@ -36,9 +65,9 @@ function sky_high_set_regionwidth($css, $regionwidth) { $replacement = 240; } $css = str_replace($tag, $replacement.'px', $css); - $css = str_replace($doubletag, ($replacement*2).'px', $css); - $css = str_replace($rightmargintag, ($replacement*3-5).'px', $css); - $css = str_replace($leftmargintag, ($replacement+5).'px', $css); + $css = str_replace($doubletag, ($replacement * 2).'px', $css); + $css = str_replace($rightmargintag, ($replacement * 3 - 5).'px', $css); + $css = str_replace($leftmargintag, ($replacement + 5).'px', $css); return $css; } @@ -46,7 +75,7 @@ function sky_high_set_regionwidth($css, $regionwidth) { * Sets the custom css variable in CSS * * @param string $css - * @param mixed $customcss + * @param string $customcss * @return string */ function sky_high_set_customcss($css, $customcss) { @@ -57,6 +86,4 @@ function sky_high_set_customcss($css, $customcss) { } $css = str_replace($tag, $replacement, $css); return $css; -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/theme/sky_high/settings.php b/theme/sky_high/settings.php index 6427f53e1aa..b5ceb8bc81c 100644 --- a/theme/sky_high/settings.php +++ b/theme/sky_high/settings.php @@ -1,49 +1,64 @@ . + /** * Settings for the sky_high theme + * + * @package theme_sky_high + * @copyright 2010 John Stabinger (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - + defined('MOODLE_INTERNAL') || die; if ($ADMIN->fulltree) { - -// Logo file setting -$name = 'theme_sky_high/logo'; -$title = get_string('logo','theme_sky_high'); -$description = get_string('logodesc', 'theme_sky_high'); -$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); - -// Block region width -$name = 'theme_sky_high/regionwidth'; -$title = get_string('regionwidth','theme_sky_high'); -$description = get_string('regionwidthdesc', 'theme_sky_high'); -$default = 240; -$choices = array(200=>'200px', 240=>'240px', 290=>'290px', 350=>'350px', 420=>'420px'); -$setting = new admin_setting_configselect($name, $title, $description, $default, $choices); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); - -// Foot note setting -$name = 'theme_sky_high/footnote'; -$title = get_string('footnote','theme_sky_high'); -$description = get_string('footnotedesc', 'theme_sky_high'); -$setting = new admin_setting_confightmleditor($name, $title, $description, ''); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); - -// Custom CSS file -$name = 'theme_sky_high/customcss'; -$title = get_string('customcss','theme_sky_high'); -$description = get_string('customcssdesc', 'theme_sky_high'); -$setting = new admin_setting_configtextarea($name, $title, $description, ''); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); - -// Add our page to the structure of the admin tree + // Logo file setting. + $name = 'theme_sky_high/logo'; + $title = get_string('logo', 'theme_sky_high'); + $description = get_string('logodesc', 'theme_sky_high'); + $setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); -} -?> \ No newline at end of file + // Block region width. + $name = 'theme_sky_high/regionwidth'; + $title = get_string('regionwidth', 'theme_sky_high'); + $description = get_string('regionwidthdesc', 'theme_sky_high'); + $default = 240; + $choices = array(200 => '200px', 240 => '240px', 290 => '290px', 350 => '350px', 420 => '420px'); + $setting = new admin_setting_configselect($name, $title, $description, $default, $choices); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); + + // Foot note setting. + $name = 'theme_sky_high/footnote'; + $title = get_string('footnote', 'theme_sky_high'); + $description = get_string('footnotedesc', 'theme_sky_high'); + $setting = new admin_setting_confightmleditor($name, $title, $description, ''); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); + + // Custom CSS file. + $name = 'theme_sky_high/customcss'; + $title = get_string('customcss', 'theme_sky_high'); + $description = get_string('customcssdesc', 'theme_sky_high'); + $setting = new admin_setting_configtextarea($name, $title, $description, ''); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); + + // Add our page to the structure of the admin tree. +} \ No newline at end of file diff --git a/theme/sky_high/version.php b/theme/sky_high/version.php index 5803220f52c..e1f77141fea 100644 --- a/theme/sky_high/version.php +++ b/theme/sky_high/version.php @@ -24,9 +24,9 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$plugin->requires = 2013110500; // Requires this Moodle version -$plugin->component = 'theme_sky_high'; // Full name of the plugin (used for diagnostics) +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX). +$plugin->requires = 2013110500; // Requires this Moodle version. +$plugin->component = 'theme_sky_high'; // Full name of the plugin (used for diagnostics). $plugin->dependencies = array( 'theme_canvas' => 2013110500, );