Skip to content

Commit

Permalink
Aardvark 3.0: Added Brand Logo setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
lazydaisy committed May 20, 2016
1 parent 099d53b commit e42f261
Show file tree
Hide file tree
Showing 11 changed files with 862 additions and 827 deletions.
34 changes: 22 additions & 12 deletions README.txt
Expand Up @@ -9,8 +9,8 @@
* custom menu and user menu.
*
* The theme now features a simple flat look with inspiration taken from Flat UI
* and Google's material design.
*
* and Google's material design.
*
* ------------------------------------------------------------------------------
* More information and documentation can be
* found at https://moodle.org/plugins/view.php?plugin=theme_aardvark
Expand All @@ -29,45 +29,55 @@
* Website: http://vle.newbury-college.ac.uk
*/

v3.0
- Depreciated Logo URL.
- Added new setting for 'Brand Logo' filpicker.
- Transfered all individual settings CSS to style/setting.css.
- Renamed style/custom.css to style/aardvark.css.
- Updated aardvark/lib.php.
- Updated aardvark/settings.php.
- Validated all CSS stylesheets with W3C CSS Validator (http://jigsaw.w3.org/css-validator/)
- Updated aardvark/version.php
- Created new branch - AARDVARK_30_STABLE

v2.9.7
- Removed <?php echo $html->navbarclass ?> from header.php (not required) [Mary Evans]

v2.9.6
- Convert fixed path to dynamic path for img.defaultuserpic url. Fixes broken default user image links; when Moodle is mounted in a sub-directory. [Timothy OBrien]

v2.9.5
- removed the z-index fix that turned out to be less of a fix and more or a nightmare

v2.9.4
- increased z-index even more because 5000 was too low for the activity chooser

v2.9.3
- fixed actionmenu hover colour
- increased z-index on PDF Editor

v2.9.2
- fixed img max-width issue that affected Gradebook in Chrome

v2.9.1
- updated a few oranges and yellows to make them less "murky"
- fixed logo width to allow for wider logos

v2.9
- redesigned with a modern, flat style to appear less cluttered and easier to navigate.
- fixed issue with mobile/responsive menu not showing in 2.9
- tidied up some custom settings that are no longer required or broken.

v2.8.1
- replaced 'profileblock' with new 'User menu items' from Moodle Core.
- set Moodle 2.8+ as minimum specification

v2.8
- updated to fix image widths in version 2.8

v2.6.4
- updated config.php for gradebook compatibility in Moodle 2.6+ (Thank you Mary)
- added Wikipedia to Social Network icons in footer

v2.6.3
- added a workaround for the TinyMCE hyperlink issue in IE11

13 changes: 2 additions & 11 deletions config.php
Expand Up @@ -17,12 +17,6 @@
/**
* Configuration for Aarvark theme.
*
* DO NOT MODIFY THIS THEME!
* COPY IT FIRST, THEN RENAME THE COPY AND MODIFY IT INSTEAD.
*
* For full information about creating Moodle themes, see:
* http://docs.moodle.org/dev/Themes_2.0
*
* @package theme_aardvark
* @authors Shaun Daubney
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand All @@ -31,11 +25,12 @@
$THEME->name = 'aardvark';
$THEME->doctype = 'html5';
$THEME->parents = array('bootstrapbase');
$THEME->sheets = array('custom', 'blockicons', 'profilebar', 'font-awesome.min', 'settings');
$THEME->sheets = array('aardvark', 'blockicons', 'settings');
$THEME->yuicssmodules = array();
$THEME->supportscssoptimisation = false;
$THEME->editor_sheets = array('editor');
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->csspostprocess = 'theme_aardvark_process_css';

$THEME->layouts = array(
// Most backwards compatible layout without the blocks - this is the layout used by default.
Expand Down Expand Up @@ -147,7 +142,3 @@
'defaultregion' => 'side-pre'
),
);

$THEME->csspostprocess = 'aardvark_process_css';


124 changes: 66 additions & 58 deletions lang/en/theme_aardvark.php
@@ -1,87 +1,95 @@
<?php
$string['pluginname'] = 'Aardvark';
$string['region-side-post'] = 'Right';
$string['region-side-pre'] = 'Left';
$string['choosereadme'] = 'Aardvark is a three column theme for Moodle 2.9+ originally created by Shaun Daubney for <a href="http://www.newbury-college.ac.uk">Newbury College</a> based on Bootstrap. Older versions are available for Moodle 2.8 and below.';
// 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/>.

/*
* @author Shaun Daubney
* @package theme_aardvark
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$string['configtitle'] = 'Aardvark';
$string['android'] = 'Google Play Store URL';
$string['androiddesc'] = 'Enter the URL of your Google Play Store Store page. (i.e https://play.google.com/store/apps/developer?id=mycollege)';
$string['apple'] = 'Apple App Store URL';
$string['appledesc'] = 'Enter the URL of your Apple App Store page. (i.e https://itunes.apple.com/gb/artist/my-college/id123456789)';

$string['basicheading'] = 'Basic Settings';
$string['basicheadingdesc'] = 'Customise basic elements of the theme.';

$string['frontpageheading'] = 'Frontpage';
$string['frontpageheadingdesc'] = 'Customise frontpage elements of the theme such as user alerts and date.';

$string['colourheading'] = 'Colours and Background';
$string['colourheadingdesc'] = 'Customise site colours and background image.';

$string['footeroptheading'] = 'Footer';
$string['footeroptdesc'] = 'Customise basic elements of the theme\'s footer.';

$string['socialiconsheading'] = 'Social Icons';
$string['socialiconsheadingdesc'] = 'Customise social network icons.';

$string['logo'] = 'Logo';
$string['logodesc'] = 'Change the logo of this theme by entering the URL to a new one (i.e., http://www.somesite/logo.png). Ideally a transparent .png with a maximium height of 38px will work best.';

$string['maincolor'] = 'Main colour';
$string['maincolordesc'] = 'Change the main colour of the theme. This includes menu hover, url hover and buttons.';

$string['shortname'] = 'Short Name';
$string['shortnamedesc'] = 'Display the site short name in the menu bar.';

$string['generalalert'] = 'General Alert';
$string['generalalertdesc'] = 'This will display an alert on your frontpage to advise users of a particular event/situation.';

$string['disclaimer'] = 'Disclaimer';
$string['disclaimerdesc'] = 'The content from this textarea will be displayed in the footer of every page.';

$string['copyright'] = 'Copyright';
$string['copyrightdesc'] = 'The name of your organisation.';
$string['brandlogo'] = 'Navbar \'Brand\' logo';
$string['brandlogodesc'] = 'This setting allows you to add a small \'Brand\' logo into the top navbar. Ideally the logo should be no bigger than 36px by 36px.';

$string['ceop'] = 'CEOP';
$string['ceopaus'] = 'Enable Australia';
$string['ceopdesc'] = 'Enable CEOP reporting.';
$string['ceopnone'] = 'Disabled';
$string['ceopaus'] = 'Enable Australia';
$string['ceopuk'] = 'Enable United Kingdom';
$string['choosereadme'] = 'Aardvark is a three column theme for Moodle 2.9+ originally created by Shaun Daubney for <a href="http://www.newbury-college.ac.uk">Newbury College</a> based on Bootstrap. Older versions are available for Moodle 2.8 and below.';
$string['colourheading'] = 'Colours and Background';
$string['colourheadingdesc'] = 'Customise site colours and background image.';
$string['configtitle'] = 'Aardvark';
$string['copyright'] = 'Copyright';
$string['copyrightdesc'] = 'The name of your organisation.';
$string['credit'] = 'Based on an original theme created by Shaun Daubney';
$string['customcss'] = 'Custom CSS';
$string['customcssdesc'] = 'Whatever CSS rules you add to this area will be reflected in every page, making for easier customisation of this theme.';

$string['website'] = 'Website URL';
$string['websitedesc'] = 'Enter the URL of your main website. (i.e http://www.mycollege.ac.uk)';
$string['disclaimer'] = 'Disclaimer';
$string['disclaimerdesc'] = 'The content from this textarea will be displayed in the footer of every page.';

$string['facebook'] = 'Facebook URL';
$string['facebookdesc'] = 'Enter the URL of your Facebook page. (i.e http://www.facebook.com/mycollege)';

$string['twitter'] = 'Twitter URL';
$string['twitterdesc'] = 'Enter the URL of your Twitter feed. (i.e http://www.twitter.com/mycollege)';

$string['googleplus'] = 'Google+ URL';
$string['googleplusdesc'] = 'Enter the URL of your Google+ profile. (i.e http://plus.google.com/107817105228930159735)';

$string['flickr'] = 'Flickr URL';
$string['flickrdesc'] = 'Enter the URL of your Flickr page. (i.e http://www.flickr.com/mycollege)';
$string['footeroptdesc'] = 'Customise basic elements of the theme\'s footer.';
$string['footeroptheading'] = 'Footer';
$string['frontpageheading'] = 'Frontpage';
$string['frontpageheadingdesc'] = 'Customise frontpage elements of the theme such as user alerts and date.';

$string['pinterest'] = 'Pinterest URL';
$string['pinterestdesc'] = 'Enter the URL of your Pinterest page. (i.e http://pinterest.com/mycollege)';
$string['generalalert'] = 'General Alert';
$string['generalalertdesc'] = 'This will display an alert on your frontpage to advise users of a particular event/situation.';
$string['googleplus'] = 'Google+ URL';
$string['googleplusdesc'] = 'Enter the URL of your Google+ profile. (i.e http://plus.google.com/107817105228930159735)';

$string['instagram'] = 'Instagram URL';
$string['instagramdesc'] = 'Enter the URL of your Instagram page (via web.stagram). (i.e http://web.stagram.com/n/mycollege/)';

$string['linkedin'] = 'LinkedIn URL';
$string['linkedindesc'] = 'Enter the URL of your LinkedIn profile. (i.e http://www.linkedin.com/company/mycollege)';

$string['youtube'] = 'YouTube URL';
$string['youtubedesc'] = 'Enter the URL of your YouTube channel. (i.e http://www.youtube.com/mycollege)';
$string['maincolor'] = 'Main colour';
$string['maincolordesc'] = 'Change the main colour of the theme. This includes menu hover, url hover and buttons.';

$string['wikipedia'] = 'Wikipedia URL';
$string['wikipediadesc'] = 'Enter the URL of your Wikipedia page. (i.e http://en.wikipedia.org/wiki/mycollege)';
$string['pinterest'] = 'Pinterest URL';
$string['pinterestdesc'] = 'Enter the URL of your Pinterest page. (i.e http://pinterest.com/mycollege)';
$string['pluginname'] = 'Aardvark';

$string['apple'] = 'Apple App Store URL';
$string['appledesc'] = 'Enter the URL of your Apple App Store page. (i.e https://itunes.apple.com/gb/artist/my-college/id123456789)';
$string['region-side-post'] = 'Right';
$string['region-side-pre'] = 'Left';

$string['android'] = 'Google Play Store URL';
$string['androiddesc'] = 'Enter the URL of your Google Play Store Store page. (i.e https://play.google.com/store/apps/developer?id=mycollege)';
$string['shortname'] = 'Short Name';
$string['shortnamedesc'] = 'Display the site short name in the menu bar.';
$string['socialiconsheading'] = 'Social Icons';
$string['socialiconsheadingdesc'] = 'Customise social network icons.';

$string['customcss'] = 'Custom CSS';
$string['customcssdesc'] = 'Whatever CSS rules you add to this area will be reflected in every page, making for easier customisation of this theme.';
$string['twitter'] = 'Twitter URL';
$string['twitterdesc'] = 'Enter the URL of your Twitter feed. (i.e http://www.twitter.com/mycollege)';

$string['website'] = 'Website URL';
$string['websitedesc'] = 'Enter the URL of your main website. (i.e http://www.mycollege.ac.uk)';
$string['wikipedia'] = 'Wikipedia URL';
$string['wikipediadesc'] = 'Enter the URL of your Wikipedia page. (i.e http://en.wikipedia.org/wiki/mycollege)';

$string['credit'] = 'Based on an original theme created by Shaun Daubney';
$string['youtube'] = 'YouTube URL';
$string['youtubedesc'] = 'Enter the URL of your YouTube channel. (i.e http://www.youtube.com/mycollege)';
92 changes: 41 additions & 51 deletions layout/header.php
Expand Up @@ -19,7 +19,7 @@
* @package theme_aardvark
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

global $CFG;

$hasheading = ($PAGE->heading);
Expand All @@ -36,7 +36,6 @@
$isfrontpage = $PAGE->bodyid == "page-site-index";
$iscoursepage = $PAGE->pagelayout == "course";

$haslogo = (!empty($PAGE->theme->settings->logo));
$hasshortname = (!empty($PAGE->theme->settings->shortname));
$hasgeneralalert = (!empty($PAGE->theme->settings->generalalert));

Expand All @@ -46,54 +45,45 @@
?>

<header role="banner" class="navbar navbar-fixed-top">
<nav role="navigation" class="navbar-inner">
<div class="container-fluid" >
<div class="logo">
<a href="<?php echo $CFG->wwwroot;?>">

<?php if ($haslogo) {
echo html_writer::empty_tag('img', array('src'=>$PAGE->theme->settings->logo, 'class'=>'logo')); }

else {} ?>

</div>
<?php if ($hasshortname) {?>
<a class="brand" href="<?php echo $CFG->wwwroot;?>"><?php echo
format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID)));
?></a>
<?php } else {} ?>
<a class="btn btn-navbar" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<?php echo $OUTPUT->user_menu(); ?>
<div class="nav-collapse collapse navbar-responsive-collapse">
<?php echo $OUTPUT->custom_menu(); ?>
<ul class="nav pull-right">
<li><?php echo $OUTPUT->page_heading_menu(); ?></li>
</ul>
</div>
<nav role="navigation" class="navbar-inner">
<div class="container-fluid" >
<a class="brand" href="<?php echo $CFG->wwwroot;?>"><?php
if ($hasshortname) {
echo '<span class="shortname">' . format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))). '</span>';
} ?></a>

<a class="btn btn-navbar" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<?php echo $OUTPUT->user_menu(); ?>
<div class="nav-collapse collapse navbar-responsive-collapse"><?php
echo $OUTPUT->custom_menu(); ?>
<ul class="nav pull-right">
<li><?php echo $OUTPUT->page_heading_menu(); ?></li>
</ul>
</div>
</nav>

</header>



<div class="container-fluid clearfix">

<?php if ($hasnavbar) { ?>
<nav class="breadcrumb-button"><?php echo $PAGE->button; ?></nav>
<?php echo $OUTPUT->navbar(); ?>
<?php } ?>
<?php if ($iscoursepage) {?>
<h1 id="courseheader"><?php echo $PAGE->heading ?></h1>
<?php } ?>
<?php if (($isfrontpage) && ($hasgeneralalert)) {?>
<div id="page-header-generalalert">
<?php echo $PAGE->theme->settings->generalalert; ?>
</div>
<?php } ?>
</div>
</nav>
</header>

<div class="container-fluid clearfix"><?php

if ($hasnavbar) { ?>
<nav class="breadcrumb-button"><?php echo $PAGE->button; ?></nav><?php
echo $OUTPUT->navbar();
}

if ($iscoursepage) { ?>
<h1 id="courseheader"><?php echo $PAGE->heading ?></h1><?php
}

if (($isfrontpage) && ($hasgeneralalert)) { ?>
<div id="page-header-generalalert"><?php
echo $PAGE->theme->settings->generalalert; ?>
</div><?php
} ?>

</div>
<div id="page" class="container-fluid clearfix">
<div id="page" class="container-fluid clearfix">

0 comments on commit e42f261

Please sign in to comment.