diff --git a/theme/brick/layout/frontpage.php b/theme/brick/layout/frontpage.php index 77dae8fd54b..2b74c35addf 100644 --- a/theme/brick/layout/frontpage.php +++ b/theme/brick/layout/frontpage.php @@ -1,4 +1,26 @@ . + +/** + * The frontpage layout for the Brick theme. + * + * @package theme_brick + * @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/brick/layout/general.php b/theme/brick/layout/general.php index c4d34cc3271..935746c39eb 100644 --- a/theme/brick/layout/general.php +++ b/theme/brick/layout/general.php @@ -1,4 +1,26 @@ . + +/** + * The default layout for the Brick theme. + * + * @package theme_brick + * @copyright 2010 John Stabinger (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ $hasheading = ($PAGE->heading); $hasnavbutton = ($PAGE->button); diff --git a/theme/brick/lib.php b/theme/brick/lib.php index cd76200d6d9..c65e0cfb6ac 100644 --- a/theme/brick/lib.php +++ b/theme/brick/lib.php @@ -1,4 +1,34 @@ . + +/** + * This file contains functions specific to the Brick theme. + * + * @package theme_brick + * @copyright 2010 John Stabinger (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * Sets the link colour used by the Brick theme. + * + * @param string $css + * @param string $linkcolor + * @return string + */ function brick_set_linkcolor($css, $linkcolor) { $tag = '[[setting:linkcolor]]'; $replacement = $linkcolor; @@ -9,6 +39,13 @@ function brick_set_linkcolor($css, $linkcolor) { return $css; } +/** + * Sets the link hover colour used by the Brick theme. + * + * @param string $css + * @param string $linkhover + * @return string + */ function brick_set_linkhover($css, $linkhover) { $tag = '[[setting:linkhover]]'; $replacement = $linkhover; @@ -19,6 +56,13 @@ function brick_set_linkhover($css, $linkhover) { return $css; } +/** + * Sets the main colour used by the Brick theme. + * + * @param string $css + * @param string $maincolor + * @return string + */ function brick_set_maincolor($css, $maincolor) { $tag = '[[setting:maincolor]]'; $replacement = $maincolor; @@ -29,6 +73,13 @@ function brick_set_maincolor($css, $maincolor) { return $css; } +/** + * Sets the main link colour used by the Brick theme. + * + * @param string $css + * @param string $maincolorlink + * @return string + */ function brick_set_maincolorlink($css, $maincolorlink) { $tag = '[[setting:maincolorlink]]'; $replacement = $maincolorlink; @@ -39,6 +90,13 @@ function brick_set_maincolorlink($css, $maincolorlink) { return $css; } +/** + * Sets the headig colour used by the brick theme. + * + * @param string $css + * @param string $headingcolor + * @return string + */ function brick_set_headingcolor($css, $headingcolor) { $tag = '[[setting:headingcolor]]'; $replacement = $headingcolor; @@ -49,55 +107,65 @@ function brick_set_headingcolor($css, $headingcolor) { return $css; } +/** + * Sets the logo used by the Brick theme. + * + * @param string $css + * @param string $logo + * @param theme_config $theme + * @return string + */ function brick_set_logo($css, $logo, $theme) { - $tag = '[[setting:logo]]'; - $replacement = $logo; - if (is_null($replacement)) { - $replacement = $theme->pix_url('logo', 'theme'); - } - $css = str_replace($tag, $replacement, $css); - return $css; + $tag = '[[setting:logo]]'; + $replacement = $logo; + if (is_null($replacement)) { + $replacement = $theme->pix_url('logo', 'theme'); + } + $css = str_replace($tag, $replacement, $css); + return $css; } - - - - - +/** + * Processes CSS adding Brick customisations to it before it is cached and delivered. + * + * @param string $css + * @param theme_config $theme + * @return string + */ function brick_process_css($css, $theme) { - - if (!empty($theme->settings->linkcolor)) { + + if (!empty($theme->settings->linkcolor)) { $linkcolor = $theme->settings->linkcolor; } else { $linkcolor = null; } $css = brick_set_linkcolor($css, $linkcolor); -// Set the link hover color + // Set the link hover color. if (!empty($theme->settings->linkhover)) { $linkhover = $theme->settings->linkhover; } else { $linkhover = null; } $css = brick_set_linkhover($css, $linkhover); - - // Set the main color + + // Set the main color. if (!empty($theme->settings->maincolor)) { $maincolor = $theme->settings->maincolor; } else { $maincolor = null; } $css = brick_set_maincolor($css, $maincolor); - - // Set the main accent color + + // Set the main accent color. if (!empty($theme->settings->maincolorlink)) { $maincolorlink = $theme->settings->maincolorlink; } else { $maincolorlink = null; } $css = brick_set_maincolorlink($css, $maincolorlink); - - // Set the main headings color + + // Set the main headings color. if (!empty($theme->settings->headingcolor)) { $headingcolor = $theme->settings->headingcolor; } else { @@ -105,18 +173,13 @@ function brick_process_css($css, $theme) { } $css = brick_set_headingcolor($css, $headingcolor); - // Set the logo image + // Set the logo image. if (!empty($theme->settings->logo)) { $logo = $theme->settings->logo; } else { $logo = null; } $css = brick_set_logo($css, $logo, $theme); - - - + return $css; - - - -} +} \ No newline at end of file diff --git a/theme/brick/settings.php b/theme/brick/settings.php index b73ac26c497..a990365c055 100644 --- a/theme/brick/settings.php +++ b/theme/brick/settings.php @@ -1,66 +1,87 @@ . + +/** + * Settings for the Brick theme. + * + * @package theme_brick + * @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) { -// Background image setting -// logo image setting -$name = 'theme_brick/logo'; -$title = get_string('logo','theme_brick'); -$description = get_string('logodesc', 'theme_brick'); -$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); + // Background image setting logo image setting. + $name = 'theme_brick/logo'; + $title = get_string('logo','theme_brick'); + $description = get_string('logodesc', 'theme_brick'); + $setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); -// link color setting -$name = 'theme_brick/linkcolor'; -$title = get_string('linkcolor','theme_brick'); -$description = get_string('linkcolordesc', 'theme_brick'); -$default = '#06365b'; -$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_brick/linkcolor'; + $title = get_string('linkcolor','theme_brick'); + $description = get_string('linkcolordesc', 'theme_brick'); + $default = '#06365b'; + $previewconfig = NULL; + $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); -// link hover color setting -$name = 'theme_brick/linkhover'; -$title = get_string('linkhover','theme_brick'); -$description = get_string('linkhoverdesc', 'theme_brick'); -$default = '#5487ad'; -$previewconfig = NULL; -$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); + // Link hover color setting. + $name = 'theme_brick/linkhover'; + $title = get_string('linkhover','theme_brick'); + $description = get_string('linkhoverdesc', 'theme_brick'); + $default = '#5487ad'; + $previewconfig = NULL; + $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); -// main color setting -$name = 'theme_brick/maincolor'; -$title = get_string('maincolor','theme_brick'); -$description = get_string('maincolordesc', 'theme_brick'); -$default = '#8e2800'; -$previewconfig = NULL; -$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); + // Main color setting. + $name = 'theme_brick/maincolor'; + $title = get_string('maincolor','theme_brick'); + $description = get_string('maincolordesc', 'theme_brick'); + $default = '#8e2800'; + $previewconfig = NULL; + $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); -// main color accent setting -$name = 'theme_brick/maincolorlink'; -$title = get_string('maincolorlink','theme_brick'); -$description = get_string('maincolorlinkdesc', 'theme_brick'); -$default = '#fff0a5'; -$previewconfig = NULL; -$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); + // Main color accent setting. + $name = 'theme_brick/maincolorlink'; + $title = get_string('maincolorlink','theme_brick'); + $description = get_string('maincolorlinkdesc', 'theme_brick'); + $default = '#fff0a5'; + $previewconfig = NULL; + $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); -// heading color setting -$name = 'theme_brick/headingcolor'; -$title = get_string('headingcolor','theme_brick'); -$description = get_string('headingcolordesc', 'theme_brick'); -$default = '#5c3500'; -$previewconfig = NULL; -$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); -$setting->set_updatedcallback('theme_reset_all_caches'); -$settings->add($setting); + // Heading color setting. + $name = 'theme_brick/headingcolor'; + $title = get_string('headingcolor','theme_brick'); + $description = get_string('headingcolordesc', 'theme_brick'); + $default = '#5c3500'; + $previewconfig = NULL; + $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); + $setting->set_updatedcallback('theme_reset_all_caches'); + $settings->add($setting); } \ No newline at end of file