diff --git a/theme/overlay/layout/frontpage.php b/theme/overlay/layout/frontpage.php index cc6d7264316..6a796eaf1c7 100644 --- a/theme/overlay/layout/frontpage.php +++ b/theme/overlay/layout/frontpage.php @@ -1,4 +1,26 @@ . + +/** + * The frontpage layout. + * + * @package theme_overlay + * @copyright 2008 NodeThirtyThree (http://nodethirtythree.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/overlay/layout/general.php b/theme/overlay/layout/general.php index 1534590240c..773c07f36c9 100644 --- a/theme/overlay/layout/general.php +++ b/theme/overlay/layout/general.php @@ -1,4 +1,26 @@ . + +/** + * The default layout. + * + * @package theme_overlay + * @copyright 2008 NodeThirtyThree (http://nodethirtythree.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/overlay/lib.php b/theme/overlay/lib.php index dccb3795b82..a77d8123af6 100644 --- a/theme/overlay/lib.php +++ b/theme/overlay/lib.php @@ -1,4 +1,33 @@ . + +/** + * This file contains functions specific to the needs of the Overlay theme. + * + * @package theme_overlay + * @copyright 2008 NodeThirtyThree (http://nodethirtythree.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * Sets the link colour in CSS. + * @param string $css + * @param string $linkcolor + * @return string + */ function overlay_set_linkcolor($css, $linkcolor) { $tag = '[[setting:linkcolor]]'; $replacement = $linkcolor; @@ -6,11 +35,15 @@ function overlay_set_linkcolor($css, $linkcolor) { $replacement = '#428ab5'; } $css = str_replace($tag, $replacement, $css); - - return $css; } +/** + * Sets the header colour in CSS. + * @param string $css + * @param string $headercolor + * @return string + */ function overlay_set_headercolor($css, $headercolor) { $tag = '[[setting:headercolor]]'; $replacement = $headercolor; @@ -18,12 +51,15 @@ function overlay_set_headercolor($css, $headercolor) { $replacement = '#2a4c7b'; } $css = str_replace($tag, $replacement, $css); - - return $css; } - +/** + * Adds custom CSS to the theme CSS before it is cached and delivered. + * @param string $css + * @param string $customcss + * @return string + */ function overlay_set_customcss($css, $customcss) { $tag = '[[setting:customcss]]'; $replacement = $customcss; @@ -34,36 +70,35 @@ function overlay_set_customcss($css, $customcss) { return $css; } - - - - +/** + * Processes CSS before it is cached and delivered, applying theme customisations. + * @param string $css + * @param theme_config $theme + * @return string + */ function overlay_process_css($css, $theme) { - - if (!empty($theme->settings->linkcolor)) { + + if (!empty($theme->settings->linkcolor)) { $linkcolor = $theme->settings->linkcolor; } else { $linkcolor = null; } $css = overlay_set_linkcolor($css, $linkcolor); - - if (!empty($theme->settings->headercolor)) { + + if (!empty($theme->settings->headercolor)) { $headercolor = $theme->settings->headercolor; } else { $headercolor = null; } $css = overlay_set_headercolor($css, $headercolor); - - if (!empty($theme->settings->customcss)) { + + if (!empty($theme->settings->customcss)) { $customcss = $theme->settings->customcss; } else { $customcss = null; } $css = overlay_set_customcss($css, $customcss); - + return $css; - - - } diff --git a/theme/overlay/settings.php b/theme/overlay/settings.php index 6c73fc8273c..8400f0167f0 100644 --- a/theme/overlay/settings.php +++ b/theme/overlay/settings.php @@ -1,45 +1,64 @@ . + +/** + * Settings for the overlay theme. + * + * @package theme_overlay + * @copyright 2008 NodeThirtyThree (http://nodethirtythree.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ defined('MOODLE_INTERNAL') || die; if ($ADMIN->fulltree) { + // link color setting. + $name = 'theme_overlay/linkcolor'; + $title = get_string('linkcolor','theme_overlay'); + $description = get_string('linkcolordesc', 'theme_overlay'); + $default = '#428ab5'; + $previewconfig = NULL; + $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); -// link color setting -$name = 'theme_overlay/linkcolor'; -$title = get_string('linkcolor','theme_overlay'); -$description = get_string('linkcolordesc', 'theme_overlay'); -$default = '#428ab5'; -$previewconfig = NULL; -$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); + // Tag line setting. + $name = 'theme_overlay/headercolor'; + $title = get_string('headercolor','theme_overlay'); + $description = get_string('headercolordesc', 'theme_overlay'); + $default = '#2a4c7b'; + $previewconfig = NULL; + $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); + // Foot note setting. + $name = 'theme_overlay/footertext'; + $title = get_string('footertext','theme_overlay'); + $description = get_string('footertextdesc', 'theme_overlay'); + $setting = new admin_setting_confightmleditor($name, $title, $description, ''); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); -// Tag line setting -$name = 'theme_overlay/headercolor'; -$title = get_string('headercolor','theme_overlay'); -$description = get_string('headercolordesc', 'theme_overlay'); -$default = '#2a4c7b'; -$previewconfig = NULL; -$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); - -// Foot note setting -$name = 'theme_overlay/footertext'; -$title = get_string('footertext','theme_overlay'); -$description = get_string('footertextdesc', 'theme_overlay'); -$setting = new admin_setting_confightmleditor($name, $title, $description, ''); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); - -// Custom CSS file -$name = 'theme_overlay/customcss'; -$title = get_string('customcss','theme_overlay'); -$description = get_string('customcssdesc', 'theme_overlay'); -$setting = new admin_setting_configtextarea($name, $title, $description, ''); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); - + // Custom CSS file. + $name = 'theme_overlay/customcss'; + $title = get_string('customcss','theme_overlay'); + $description = get_string('customcssdesc', 'theme_overlay'); + $setting = new admin_setting_configtextarea($name, $title, $description, ''); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); } \ No newline at end of file diff --git a/theme/overlay/version.php b/theme/overlay/version.php index 973b2601db7..8c224ad939e 100644 --- a/theme/overlay/version.php +++ b/theme/overlay/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_overlay'; // 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_overlay'; // Full name of the plugin (used for diagnostics). $plugin->dependencies = array( 'theme_canvas' => 2013110500, );