From 3473a16d7adda63503cc8a08654d2e11bc557f0f Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Mon, 17 Feb 2014 11:19:18 +1300 Subject: [PATCH] MDL-44204 theme_fusion: unified @package use and improved coding style --- theme/fusion/layout/frontpage.php | 22 ++++++++++++ theme/fusion/layout/general.php | 22 ++++++++++++ theme/fusion/lib.php | 60 ++++++++++++++++++++++++------- theme/fusion/settings.php | 22 ++++++++++++ 4 files changed, 113 insertions(+), 13 deletions(-) diff --git a/theme/fusion/layout/frontpage.php b/theme/fusion/layout/frontpage.php index c1ca1191d13..4d48326f5af 100644 --- a/theme/fusion/layout/frontpage.php +++ b/theme/fusion/layout/frontpage.php @@ -1,4 +1,26 @@ . + +/** + * The frontpage layout. + * + * @package theme_fusion + * @copyright 2010 Patrick Malley (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/fusion/layout/general.php b/theme/fusion/layout/general.php index dadf25b0e56..729fea8d00f 100644 --- a/theme/fusion/layout/general.php +++ b/theme/fusion/layout/general.php @@ -1,4 +1,26 @@ . + +/** + * The default layout. + * + * @package theme_fusion + * @copyright 2010 Patrick Malley (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/fusion/lib.php b/theme/fusion/lib.php index 116462b0981..80bad2fd436 100644 --- a/theme/fusion/lib.php +++ b/theme/fusion/lib.php @@ -1,4 +1,33 @@ . + +/** + * This file contains functions specific to the needs of the Fusion theme. + * + * @package theme_fusion + * @copyright 2010 Patrick Malley (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * Sets the link colour for the Fusion theme. + * @param string $css + * @param string $linkcolor + * @return string + */ function fusion_set_linkcolor($css, $linkcolor) { $tag = '[[setting:linkcolor]]'; $replacement = $linkcolor; @@ -6,11 +35,16 @@ function fusion_set_linkcolor($css, $linkcolor) { $replacement = '#2d83d5'; } $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 fusion_set_customcss($css, $customcss) { $tag = '[[setting:customcss]]'; $replacement = $customcss; @@ -21,29 +55,29 @@ function fusion_set_customcss($css, $customcss) { return $css; } - - - - +/** + * Processes theme CSS adding customisations before it is cached and delivered. + * + * @param string $css + * @param theme_config $theme + * @return string + */ function fusion_process_css($css, $theme) { - - if (!empty($theme->settings->linkcolor)) { + + if (!empty($theme->settings->linkcolor)) { $linkcolor = $theme->settings->linkcolor; } else { $linkcolor = null; } $css = fusion_set_linkcolor($css, $linkcolor); - if (!empty($theme->settings->customcss)) { + if (!empty($theme->settings->customcss)) { $customcss = $theme->settings->customcss; } else { $customcss = null; } $css = fusion_set_customcss($css, $customcss); - + return $css; - - - } diff --git a/theme/fusion/settings.php b/theme/fusion/settings.php index ef5b9711d34..d4a5dd82362 100644 --- a/theme/fusion/settings.php +++ b/theme/fusion/settings.php @@ -1,4 +1,26 @@ . + +/** + * Settings for the fusion theme. + * + * @package theme_fusion + * @copyright 2010 Patrick Malley (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ defined('MOODLE_INTERNAL') || die;