Skip to content

Commit

Permalink
Merge branch '44206-27' of git://github.com/samhemelryk/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Feb 19, 2014
2 parents 6151f9d + 3057d35 commit faefe57
Show file tree
Hide file tree
Showing 8 changed files with 243 additions and 32 deletions.
22 changes: 22 additions & 0 deletions theme/magazine/config.php
@@ -1,4 +1,26 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Magazine theme configuration.
*
* @package theme_magazine
* @copyright 2010 John Stabinger (http://newschoollearning.com/)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

Expand Down
23 changes: 23 additions & 0 deletions theme/magazine/lang/en/theme_magazine.php
@@ -1,4 +1,27 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Language strings for the magazine theme.
*
* @package theme_magazine
* @copyright 2010 John Stabinger (http://newschoollearning.com/)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$string['pluginname'] = 'Magazine';
$string['region-side-post'] = 'Right';
$string['region-side-pre'] = 'Left';
Expand Down
26 changes: 25 additions & 1 deletion theme/magazine/layout/embedded.php
@@ -1,4 +1,28 @@
<?php echo $OUTPUT->doctype() ?>
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* The embedded layout.
*
* @package theme_magazine
* @copyright 2010 John Stabinger (http://newschoollearning.com/)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<title><?php echo $PAGE->title ?></title>
Expand Down
23 changes: 23 additions & 0 deletions theme/magazine/layout/frontpage.php
@@ -1,4 +1,27 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* The frontpage layout.
*
* @package theme_magazine
* @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());
$hasfooter = (empty($PAGE->layout_options['nofooter']));
Expand Down
22 changes: 22 additions & 0 deletions theme/magazine/layout/general.php
@@ -1,4 +1,26 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* The default layout.
*
* @package theme_magazine
* @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());
$hasfooter = (empty($PAGE->layout_options['nofooter']));
Expand Down
113 changes: 94 additions & 19 deletions theme/magazine/lib.php
@@ -1,4 +1,26 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* This file contains functions specific to the needs of the Magazine theme.
*
* @package theme_magazine
* @copyright 2010 John Stabinger (http://newschoollearning.com/)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
* Makes our changes to the CSS
Expand All @@ -9,88 +31,90 @@
*/
function magazine_process_css($css, $theme) {

// Set the link color
// Set the link color.
if (!empty($theme->settings->linkcolor)) {
$linkcolor = $theme->settings->linkcolor;
} else {
$linkcolor = null;
}
$css = magazine_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 = magazine_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 = magazine_set_maincolor($css, $maincolor);
// Set the main accent color

// Set the main accent color.
if (!empty($theme->settings->maincoloraccent)) {
$maincoloraccent = $theme->settings->maincoloraccent;
} else {
$maincoloraccent = null;
}
$css = magazine_set_maincoloraccent($css, $maincoloraccent);
// Set the main headings color

// Set the main headings color.
if (!empty($theme->settings->headingcolor)) {
$headingcolor = $theme->settings->headingcolor;
} else {
$headingcolor = null;
}
$css = magazine_set_headingcolor($css, $headingcolor);
// Set the block headings color

// Set the block headings color.
if (!empty($theme->settings->blockcolor)) {
$blockcolor = $theme->settings->blockcolor;
} else {
$blockcolor = null;
}
$css = magazine_set_blockcolor($css, $blockcolor);
// Set the forum background color

// Set the forum background color.
if (!empty($theme->settings->forumback)) {
$forumback = $theme->settings->forumback;
} else {
$forumback = null;
}
$css = magazine_set_forumback($css, $forumback);
// Set the body background image

// Set the body background image.
if (!empty($theme->settings->background)) {
$background = $theme->settings->background;
} else {
$background = null;
}
$css = magazine_set_background($css, $background, $theme);
// Set the logo image

// Set the logo image.
if (!empty($theme->settings->logo)) {
$logo = $theme->settings->logo;
} else {
$logo = null;
}
$css = magazine_set_logo($css, $logo, $theme);


// Return the CSS
// Return the CSS.
return $css;
}



/**
* Sets the link color variable in CSS
* Sets the link color variable in CSS.
*
* @param string $css
* @param string $linkcolor
* @return string
*/
function magazine_set_linkcolor($css, $linkcolor) {
$tag = '[[setting:linkcolor]]';
Expand All @@ -102,6 +126,12 @@ function magazine_set_linkcolor($css, $linkcolor) {
return $css;
}

/**
* Sets the link hover colour in CSS.
* @param string $css
* @param string $linkhover
* @return string
*/
function magazine_set_linkhover($css, $linkhover) {
$tag = '[[setting:linkhover]]';
$replacement = $linkhover;
Expand All @@ -112,6 +142,12 @@ function magazine_set_linkhover($css, $linkhover) {
return $css;
}

/**
* Sets the main colour used by the Magazine theme.
* @param string $css
* @param string $maincolor
* @return string
*/
function magazine_set_maincolor($css, $maincolor) {
$tag = '[[setting:maincolor]]';
$replacement = $maincolor;
Expand All @@ -122,6 +158,12 @@ function magazine_set_maincolor($css, $maincolor) {
return $css;
}

/**
* Sets the colour for accents within the Magazine theme.
* @param string $css
* @param string $maincoloraccent
* @return string
*/
function magazine_set_maincoloraccent($css, $maincoloraccent) {
$tag = '[[setting:maincoloraccent]]';
$replacement = $maincoloraccent;
Expand All @@ -132,6 +174,12 @@ function magazine_set_maincoloraccent($css, $maincoloraccent) {
return $css;
}

/**
* Sets the heading colour in CSS.
* @param string $css
* @param string $headingcolor
* @return string
*/
function magazine_set_headingcolor($css, $headingcolor) {
$tag = '[[setting:headingcolor]]';
$replacement = $headingcolor;
Expand All @@ -142,6 +190,12 @@ function magazine_set_headingcolor($css, $headingcolor) {
return $css;
}

/**
* Sets the block colour in CSS.
* @param string $css
* @param string $blockcolor
* @return string
*/
function magazine_set_blockcolor($css, $blockcolor) {
$tag = '[[setting:blockcolor]]';
$replacement = $blockcolor;
Expand All @@ -152,6 +206,12 @@ function magazine_set_blockcolor($css, $blockcolor) {
return $css;
}

/**
* Sets the forum back colour in CSS.
* @param string $css
* @param string $forumback
* @return string
*/
function magazine_set_forumback($css, $forumback) {
$tag = '[[setting:forumback]]';
$replacement = $forumback;
Expand All @@ -162,6 +222,13 @@ function magazine_set_forumback($css, $forumback) {
return $css;
}

/**
* Sets the background for the Magazine theme.
* @param string $css
* @param string $background
* @param theme_config $theme
* @return string
*/
function magazine_set_background($css, $background, $theme) {
$tag = '[[setting:background]]';
$replacement = $background;
Expand All @@ -172,6 +239,14 @@ function magazine_set_background($css, $background, $theme) {
return $css;
}

/**
* Sets the logo for the Magazine theme.
*
* @param string $css
* @param string $logo
* @param theme_config $theme
* @return string
*/
function magazine_set_logo($css, $logo, $theme) {
$tag = '[[setting:logo]]';
$replacement = $logo;
Expand Down

0 comments on commit faefe57

Please sign in to comment.