From 83eb9e0e9d02e58e11a7f5e29713f905462f5cc4 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Mon, 17 Feb 2014 11:13:57 +1300 Subject: [PATCH] MDL-44194 theme_anomaly: unified @package use and improved coding style --- theme/anomaly/config.php | 26 ++++++++++++++--- theme/anomaly/lang/en/theme_anomaly.php | 1 - theme/anomaly/layout/frontpage.php | 22 ++++++++++++++ theme/anomaly/layout/general.php | 22 ++++++++++++++ theme/anomaly/layout/report.php | 22 ++++++++++++++ theme/anomaly/lib.php | 38 ++++++++++++++++++++++++- theme/anomaly/renderers.php | 28 ++++++++++++++++++ theme/anomaly/settings.php | 30 ++++++++++++++++--- theme/anomaly/version.php | 2 +- 9 files changed, 180 insertions(+), 11 deletions(-) diff --git a/theme/anomaly/config.php b/theme/anomaly/config.php index c921541e58f..04e5949b150 100644 --- a/theme/anomaly/config.php +++ b/theme/anomaly/config.php @@ -1,8 +1,26 @@ . + +/** + * This file contains a few configuration variables that control how Moodle uses this theme. + * + * @package theme_anomaly + * @copyright 2010 Patrick Malley (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ $THEME->name = 'anomaly'; diff --git a/theme/anomaly/lang/en/theme_anomaly.php b/theme/anomaly/lang/en/theme_anomaly.php index 18967aa48e7..ad44df5a3ef 100644 --- a/theme/anomaly/lang/en/theme_anomaly.php +++ b/theme/anomaly/lang/en/theme_anomaly.php @@ -1,5 +1,4 @@ . + +/** + * The frontpage layout for the Anomaly theme. + * + * @package theme_anomaly + * @copyright 2010 Patrick Malley (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/anomaly/layout/general.php b/theme/anomaly/layout/general.php index d7831016a40..9644a5b8e7e 100644 --- a/theme/anomaly/layout/general.php +++ b/theme/anomaly/layout/general.php @@ -1,4 +1,26 @@ . + +/** + * The default layout for the Anomaly theme. + * + * @package theme_anomaly + * @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/anomaly/layout/report.php b/theme/anomaly/layout/report.php index d7207b372b6..2cca764082c 100644 --- a/theme/anomaly/layout/report.php +++ b/theme/anomaly/layout/report.php @@ -1,4 +1,26 @@ . + +/** + * The report layout for the Anomaly theme. + * + * @package theme_anomaly + * @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/anomaly/lib.php b/theme/anomaly/lib.php index 42c31007f54..6de8c220b72 100644 --- a/theme/anomaly/lib.php +++ b/theme/anomaly/lib.php @@ -1,8 +1,37 @@ . +/** + * This file contains functions specific to the needs of the Anomaly theme. + * + * @package theme_anomaly + * @copyright 2010 Patrick Malley (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * Process CSS applying theme customisations before it is cached and delivered. + * + * @param string $css + * @param theme_config $theme + * @return string + */ function anomaly_process_css($css, $theme) { - // Set custom CSS + // Set custom CSS. if (!empty($theme->settings->customcss)) { $customcss = $theme->settings->customcss; } else { @@ -13,6 +42,13 @@ function anomaly_process_css($css, $theme) { return $css; } +/** + * Adds custom CSS set by the admin to the CSS for the Anomaly theme. + * + * @param string $css + * @param string $customcss + * @return string + */ function anomaly_set_customcss($css, $customcss) { $tag = '[[setting:customcss]]'; $replacement = $customcss; diff --git a/theme/anomaly/renderers.php b/theme/anomaly/renderers.php index 1bb8cb0186c..8ccd1454824 100644 --- a/theme/anomaly/renderers.php +++ b/theme/anomaly/renderers.php @@ -1,5 +1,33 @@ . +/** + * This file contains renderers overridden by the Anomaly theme. + * + * @package theme_anomaly + * @copyright 2010 Patrick Malley (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * Class theme_anomaly_core_renderer + * + * @copyright 2010 Patrick Malley (http://newschoollearning.com/) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class theme_anomaly_core_renderer extends core_renderer { /** diff --git a/theme/anomaly/settings.php b/theme/anomaly/settings.php index b097584c805..ff17a2a6a15 100644 --- a/theme/anomaly/settings.php +++ b/theme/anomaly/settings.php @@ -1,21 +1,43 @@ . + +/** + * Anomaly theme settings. + * + * @package theme_anomaly + * @copyright 2013 Mary Evans + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ defined('MOODLE_INTERNAL') || die; if ($ADMIN->fulltree) { - // Tagline setting + // Tagline setting. $name = 'theme_anomaly/tagline'; - $title = get_string('tagline','theme_anomaly'); + $title = get_string('tagline', 'theme_anomaly'); $description = get_string('taglinedesc', 'theme_anomaly'); $default = ''; $setting = new admin_setting_configtext($name, $title, $description, $default); $setting->set_updatedcallback('theme_reset_all_caches'); $settings->add($setting); - // Custom CSS file + // Custom CSS file. $name = 'theme_anomaly/customcss'; - $title = get_string('customcss','theme_anomaly'); + $title = get_string('customcss', 'theme_anomaly'); $description = get_string('customcssdesc', 'theme_anomaly'); $default = ''; $setting = new admin_setting_configtextarea($name, $title, $description, $default); diff --git a/theme/anomaly/version.php b/theme/anomaly/version.php index 1772f356cea..3458188f113 100644 --- a/theme/anomaly/version.php +++ b/theme/anomaly/version.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die; $plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2013110500; // Requires this Moodle version -$plugin->component = 'theme_anomaly'; // Full name of the plugin (used for diagnostics) +$plugin->component = 'theme_anomaly'; // Full name of the plugin (used for diagnostics). $plugin->dependencies = array( 'theme_base' => 2013110500, );