예제 #1
0
/**
 * Essentials is a basic child theme of Essential to help you as a theme
 * developer create your own child theme of Essential.
 *
 * @package     theme_essentials
 * @copyright   2015 Gareth J Barnard
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
function theme_essentials_process_css($css, $theme)
{
    /* Change to 'false' if you don't want to use Essential's settings and remove '$THEME->parents_exclude_sheets' in config.php.
     *
     * If you want to override any Essential setting with a separate version in this child theme, then define it in 'settings.php' with the
     * same name bar the theme name prefix and 'theme_essential_process_css' will do the rest via 'toolbox.php'.  Please look at the examples
     * already coded in 'settings.php'.
     *  
     * If you want the alternative colours, then remove the overridden method 'custom_menu_themecolours' in the 'theme_essentials_core_renderer'
     * class in the 'core_renderer.php' file in the 'classes' folder. */
    $usingessentialsettings = true;
    if ($usingessentialsettings) {
        global $CFG;
        if (file_exists("{$CFG->dirroot}/theme/essential/lib.php")) {
            require_once "{$CFG->dirroot}/theme/essential/lib.php";
        } else {
            if (!empty($CFG->themedir) and file_exists("{$CFG->themedir}/essential/lib.php")) {
                require_once "{$CFG->themedir}/essential/lib.php";
            }
        }
        // else will just fail when cannot find theme_essential_process_css!
        $css = theme_essential_process_css($css, $theme);
    }
    // If you have your own additional settings, then add them here.
    $css = essentials_set_frontpagetitlestyle($css, \theme_essential\toolbox::get_setting('frontpagetitlestyle', false, $theme));
    // Finally return processed CSS
    return $css;
}
예제 #2
0
파일: piwik.php 프로젝트: RobsonTK/Moodle
function theme_essential_insert_analytics_tracking()
{
    $siteurl = \theme_essential\toolbox::get_setting('analyticssiteurl');
    $tracking = '';
    if (!empty($siteurl)) {
        $imagetrack = \theme_essential\toolbox::get_setting('analyticsimagetrack');
        $siteid = \theme_essential\toolbox::get_setting('analyticssiteid');
        $trackadmin = \theme_essential\toolbox::get_setting('analyticstrackadmin');
        $cleanurl = \theme_essential\toolbox::get_setting('analyticscleanurl');
        if ($imagetrack) {
            $addition = '<noscript><p><img src="//' . $siteurl . '/piwik.php?idsite=' . $siteid . '" style="border:0" alt="" /></p></noscript>';
        } else {
            $addition = '';
        }
        if ($cleanurl) {
            $doctitle = "_paq.push(['setDocumentTitle', " . theme_essential_analytics_trackurl() . "]);";
        } else {
            $doctitle = "";
        }
        if (!is_siteadmin() || $trackadmin) {
            $tracking = "<script type='text/javascript'>\n                    var _paq = _paq || [];\n                    " . $doctitle . "\n                    _paq.push(['enableLinkTracking']);\n                    _paq.push(['trackPageView']);\n                    (function(){\n                        var u=(('https:' == document.location.protocol) ? 'https' : 'http') + '://" . $siteurl . "/';\n                        _paq.push(['setSiteId', " . $siteid . "]);\n                        _paq.push(['setTrackerUrl', u+'piwik.php']);\n                        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'piwik.js';\n                        s.parentNode.insertBefore(g,s);\n                    })();\n                </script>\n                " . $addition;
        }
    }
    return $tracking;
}
function insert_analytics_tracking()
{
    global $PAGE, $OUTPUT;
    $trackingid = \theme_essential\toolbox::get_setting('analyticstrackingid');
    $trackadmin = \theme_essential\toolbox::get_setting('analyticstrackadmin');
    $cleanurl = \theme_essential\toolbox::get_setting('analyticscleanurl');
    $tracking = '';
    if ($cleanurl) {
        $addition = "{'hitType' : 'pageview',\n            'page' : " . analytics_trackurl() . ",\n            'title' : '" . addslashes($PAGE->heading) . "'\n            }";
    } else {
        $addition = "'pageview'";
    }
    if (!is_siteadmin() || $trackadmin) {
        $tracking = "\n            <script>\n            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n            })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n            ga('create', '" . $trackingid . "', {'siteSpeedSampleRate': 50});\n            ga('send', " . $addition . ");\n\n            </script>";
    }
    return $tracking;
}
 public function test_render_slide()
 {
     $theslide = \theme_essential\toolbox::render_slide(1, 0);
     $thecontent = '<a href="https://about.me/gjbarnard" target="_blank" class="item side-caption active">';
     $thecontent .= '<div class="container-fluid"><div class="row-fluid"><div class="span5 the-side-caption">';
     $thecontent .= '<div class="the-side-caption-content"><h4>Test slide one</h4><div><p>Test of link in caption: me.</p>';
     $thecontent .= '</div></div></div><div class="span7"><div class="carousel-image-container">';
     $thecontent .= '<img src="http://www.example.com/moodle/theme/image.php/_s/essential/theme/1/default_slide" ';
     $thecontent .= 'alt="Test slide one" class="carousel-image"></div></div></div></div></a>';
     $this->assertEquals($thecontent, $theslide);
     $theslide = \theme_essential\toolbox::render_slide(2, 0);
     $thecontent = '<div class="item side-caption">';
     $thecontent .= '<div class="container-fluid"><div class="row-fluid"><div class="span5 the-side-caption">';
     $thecontent .= '<div class="the-side-caption-content"><h4>Test slide two</h4><div>';
     $thecontent .= '<p>Test of link in caption: <a href="https://about.me/gjbarnard" target="_blank">me.</a></p>';
     $thecontent .= '</div></div></div><div class="span7"><div class="carousel-image-container">';
     $thecontent .= '<img src="http://www.example.com/moodle/theme/image.php/_s/essential/theme/1/default_slide" ';
     $thecontent .= 'alt="Test slide two" class="carousel-image"></div></div></div></div></div>';
     $this->assertEquals($thecontent, $theslide);
 }
예제 #5
0
// 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/>.
/**
 * Essential is a clean and customizable theme.
 *
 * @package     theme_essential
 * @copyright   2016 Gareth J Barnard
 * @copyright   2014 Gareth J Barnard, David Bezemer
 * @copyright   2013 Julian Ridden
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once \theme_essential\toolbox::get_tile_file('additionaljs');
require_once \theme_essential\toolbox::get_tile_file('pagesettings');
echo $OUTPUT->doctype();
?>
<html <?php 
echo $OUTPUT->htmlattributes();
?>
>
<head>
    <title><?php 
echo $OUTPUT->page_title();
?>
</title>
    <link rel="shortcut icon" href="<?php 
echo $OUTPUT->favicon();
?>
"/>
    echo $OUTPUT->course_content_footer();
}
?>
                        </section>
                    <?php 
if (!$footerregion) {
    if ($hasboringlayout && $left || !$left) {
        echo $OUTPUT->blocks('side-pre', 'span3 desktop-first-column');
    } else {
        echo $OUTPUT->blocks('side-pre', 'span3 pull-right');
    }
}
?>
                </div>
                <?php 
if ($footerregion) {
    echo $OUTPUT->essential_blocks('side-pre', 'row-fluid', 'aside', 4);
}
?>
            </div>
        </div>
        <!-- End Main Regions -->
    </section>
</div>

<?php 
require_once \theme_essential\toolbox::get_tile_file('footer');
?>
</body>
</html>
예제 #7
0
            <div class="row-fluid">
                <!-- HEADER: LOGO AREA -->
                <div class="<?php 
echo $logoclass;
echo !$left ? ' pull-right' : ' pull-left';
?>
">
                    <?php 
if (!$haslogo) {
    ?>
                        <a class="textlogo" href="<?php 
    echo preg_replace("(https?:)", "", $CFG->wwwroot);
    ?>
">
                            <i id="headerlogo" class="fa fa-<?php 
    echo \theme_essential\toolbox::get_setting('siteicon');
    ?>
"></i>
                            <?php 
    echo $OUTPUT->get_title('header');
    ?>
                        </a>
                    <?php 
} else {
    ?>
                        <a class="logo" href="<?php 
    echo preg_replace("(https?:)", "", $CFG->wwwroot);
    ?>
" title="<?php 
    print_string('home');
    ?>
 /**
  * Returns the url of the custom favicon.
  */
 public function favicon()
 {
     $favicon = \theme_essential\toolbox::get_setting('favicon', 'format_file_url');
     if (empty($favicon)) {
         return $this->page->theme->pix_url('favicon', 'theme');
     } else {
         return $favicon;
     }
 }
예제 #9
0
    echo $OUTPUT->essential_edit_button('theme_essential_slideshow');
    ?>
                <ol class="carousel-indicators">
                    <?php 
    for ($indicatorslideindex = 0; $indicatorslideindex < $numberofslides; $indicatorslideindex++) {
        echo '<li data-target="#essentialCarousel" data-slide-to="' . $indicatorslideindex . '"';
        if ($indicatorslideindex == 0) {
            echo 'class="active"';
        }
        echo '></li>';
    }
    ?>
                </ol>
                <div class="carousel-inner<?php 
    echo $captionscenter . $captionsbelowclass;
    ?>
">
                    <?php 
    for ($slideindex = 1; $slideindex <= $numberofslides; $slideindex++) {
        echo \theme_essential\toolbox::render_slide($slideindex, $captionoptions);
    }
    ?>
                </div>
                <?php 
    echo \theme_essential\toolbox::render_slide_controls($left);
    ?>
            </div>
        </div>
    </div>
<?php 
}
 /**
  * Returns HTML to display course content (summary, course contacts and optionally category name)
  *
  * This method is called from coursecat_coursebox() and may be re-used in AJAX
  *
  * @param coursecat_helper $chelper various display options
  * @param stdClass|course_in_list $course
  * @return string
  */
 protected function coursecat_coursebox_content(coursecat_helper $chelper, $course)
 {
     if (!$this->enablecategoryicon) {
         return parent::coursecat_coursebox_content($chelper, $course);
     }
     global $CFG;
     if ($chelper->get_show_courses() < self::COURSECAT_SHOW_COURSES_EXPANDED) {
         return '';
     }
     if ($course instanceof stdClass) {
         require_once $CFG->libdir . '/coursecatlib.php';
         $course = new course_in_list($course);
     }
     $content = '';
     $coursehascontacts = $course->has_course_contacts();
     // Display course summary.
     if ($course->has_summary()) {
         $summaryclass = 'summary';
         if ($coursehascontacts == false) {
             $summaryclass .= ' noteachers';
         }
         $content .= html_writer::start_tag('div', array('class' => $summaryclass));
         $content .= $chelper->get_course_formatted_summary($course, array('overflowdiv' => true, 'noclean' => true, 'para' => false));
         $content .= html_writer::end_tag('div');
         // Class .summary.
     }
     // Display course overview files.
     $contentimages = $contentfiles = '';
     foreach ($course->get_course_overviewfiles() as $file) {
         $isimage = $file->is_valid_image();
         $url = file_encode_url("{$CFG->wwwroot}/pluginfile.php", '/' . $file->get_contextid() . '/' . $file->get_component() . '/' . $file->get_filearea() . $file->get_filepath() . $file->get_filename(), !$isimage);
         if ($isimage) {
             $contentimages .= html_writer::tag('div', html_writer::empty_tag('img', array('src' => $url)), array('class' => 'courseimage'));
         } else {
             $image = $this->output->pix_icon(file_file_icon($file, 24), $file->get_filename(), 'moodle');
             $filename = html_writer::tag('span', $image, array('class' => 'fp-icon')) . html_writer::tag('span', $file->get_filename(), array('class' => 'fp-filename'));
             $contentfiles .= html_writer::tag('span', html_writer::link($url, $filename), array('class' => 'coursefile fp-filename-icon'));
         }
     }
     $content .= $contentimages . $contentfiles;
     // Display course contacts.  See course_in_list::get_course_contacts().
     if ($coursehascontacts) {
         $content .= html_writer::start_tag('ul', array('class' => 'teachers'));
         foreach ($course->get_course_contacts() as $userid => $coursecontact) {
             $faiconsetting = \theme_essential\toolbox::get_setting('courselistteachericon');
             $faiconsettinghtml = empty($faiconsetting) ? '' : '<i class="fa fa-' . $faiconsetting . '"></i> ';
             $name = $faiconsettinghtml . $coursecontact['rolename'] . ': ' . html_writer::link(new moodle_url('/user/view.php', array('id' => $userid, 'course' => SITEID)), $coursecontact['username']);
             $content .= html_writer::tag('li', $name);
         }
         $content .= html_writer::end_tag('ul');
         // Class .teachers.
     }
     // Display course category if necessary (for example in search results).
     if ($chelper->get_show_courses() == self::COURSECAT_SHOW_COURSES_EXPANDED_WITH_CAT) {
         require_once $CFG->libdir . '/coursecatlib.php';
         if ($cat = coursecat::get($course->category, IGNORE_MISSING)) {
             $content .= html_writer::start_tag('div', array('class' => 'coursecat'));
             $content .= get_string('category') . ': ' . html_writer::link(new moodle_url('/course/index.php', array('categoryid' => $cat->id)), $cat->get_formatted_name(), array('class' => $cat->visible ? '' : 'dimmed'));
             $content .= html_writer::end_tag('div');
             // Class .coursecat.
         }
     }
     return $content;
 }
예제 #11
0
 public static function set_font($css, $type, $fontname)
 {
     $familytag = '[[setting:' . $type . 'font]]';
     $facetag = '[[setting:fontfiles' . $type . ']]';
     if (empty($fontname)) {
         $familyreplacement = 'Verdana';
         $facereplacement = '';
     } else {
         if (\theme_essential\toolbox::get_setting('fontselect') === '3') {
             $fontfiles = array();
             $fontfileeot = self::setting_file_url('fontfileeot' . $type, 'fontfileeot' . $type);
             if (!empty($fontfileeot)) {
                 $fontfiles[] = "url('" . $fontfileeot . "?#iefix') format('embedded-opentype')";
             }
             $fontfilewoff = self::setting_file_url('fontfilewoff' . $type, 'fontfilewoff' . $type);
             if (!empty($fontfilewoff)) {
                 $fontfiles[] = "url('" . $fontfilewoff . "') format('woff')";
             }
             $fontfilewofftwo = self::setting_file_url('fontfilewofftwo' . $type, 'fontfilewofftwo' . $type);
             if (!empty($fontfilewofftwo)) {
                 $fontfiles[] = "url('" . $fontfilewofftwo . "') format('woff2')";
             }
             $fontfileotf = self::setting_file_url('fontfileotf' . $type, 'fontfileotf' . $type);
             if (!empty($fontfileotf)) {
                 $fontfiles[] = "url('" . $fontfileotf . "') format('opentype')";
             }
             $fontfilettf = self::setting_file_url('fontfilettf' . $type, 'fontfilettf' . $type);
             if (!empty($fontfilettf)) {
                 $fontfiles[] = "url('" . $fontfilettf . "') format('truetype')";
             }
             $fontfilesvg = self::setting_file_url('fontfilesvg' . $type, 'fontfilesvg' . $type);
             if (!empty($fontfilesvg)) {
                 $fontfiles[] = "url('" . $fontfilesvg . "') format('svg')";
             }
             if (!empty($fontfiles)) {
                 $familyreplacement = '"' . $fontname . '"';
                 $facereplacement = '@font-face {' . PHP_EOL . 'font-family: "' . $fontname . '";' . PHP_EOL;
                 $facereplacement .= !empty($fontfileeot) ? "src: url('" . $fontfileeot . "');" . PHP_EOL : '';
                 $facereplacement .= "src: ";
                 $facereplacement .= implode("," . PHP_EOL . " ", $fontfiles);
                 $facereplacement .= ";";
                 $facereplacement .= '' . PHP_EOL . "}";
             } else {
                 // No files back to default.
                 $familyreplacement = 'Verdana';
                 $facereplacement = '';
             }
         } else {
             $familyreplacement = '"' . $fontname . '"';
             $facereplacement = '';
         }
     }
     $css = str_replace($familytag, $familyreplacement, $css);
     $css = str_replace($facetag, $facereplacement, $css);
     return $css;
 }
 public function test_pix()
 {
     $ouricon = \theme_essential\toolbox::pix_url('essential_button', 'theme');
     $this->assertEquals('http://www.example.com/moodle/theme/image.php/_s/essential/theme/1/essential_button', $ouricon->out(false));
 }
예제 #13
0
    $iphoneicon = \theme_essential\toolbox::get_setting('iphoneicon', 'format_file_url');
} else {
    $iphoneicon = $OUTPUT->pix_url('homeicon/iphone', 'theme');
}
if (\theme_essential\toolbox::get_setting('ipadicon')) {
    $ipadicon = \theme_essential\toolbox::get_setting('ipadicon', 'format_file_url');
} else {
    $ipadicon = $OUTPUT->pix_url('homeicon/ipad', 'theme');
}
if (\theme_essential\toolbox::get_setting('iphoneretinaicon')) {
    $iphoneretinaicon = \theme_essential\toolbox::get_setting('iphoneretinaicon', 'format_file_url');
} else {
    $iphoneretinaicon = $OUTPUT->pix_url('homeicon/iphone_retina', 'theme');
}
if (\theme_essential\toolbox::get_setting('ipadretinaicon')) {
    $ipadretinaicon = \theme_essential\toolbox::get_setting('ipadretinaicon', 'format_file_url');
} else {
    $ipadretinaicon = $OUTPUT->pix_url('homeicon/ipad_retina', 'theme');
}
?>

<link rel="apple-touch-icon-precomposed" sizes="57x57" href="<?php 
echo $iphoneicon;
?>
"/>
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php 
echo $ipadicon;
?>
"/>
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php 
echo $iphoneretinaicon;
    echo \theme_essential\toolbox::get_setting('marketing' . $mspot, true);
    ?>
            </span></h5></div>
            <?php 
    if ($spotimage[$mspot]) {
        ?>
                <div class="marketing-image-container">
                    <div class="marketing-image" id="marketing-image<?php 
        echo $mspot;
        ?>
"></div>
                </div>
            <?php 
    }
    ?>
            <div class="content<?php 
    echo $additionalmarketingcontentclass ? ' withbutton' : '';
    ?>
">
                <?php 
    echo \theme_essential\toolbox::get_setting('marketing' . $mspot . 'content', 'format_html');
    echo $spotbutton[$mspot];
    ?>
            </div>
        </div>
        <?php 
}
?>
    </div>
</div>
 public function print_single_section_page($course, $sections, $mods, $modnames, $modnamesused, $displaysection)
 {
     return \theme_essential\toolbox::print_single_section_page($this, $this->courserenderer, $course, $sections, $mods, $modnames, $modnamesused, $displaysection);
 }
예제 #16
0
// 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 is built using the bootstrapbase template to allow for new theme's using
 * Moodle's new Bootstrap theme engine
 *
 * @package     theme_essential
 * @copyright   2013 Julian Ridden
 * @copyright   2014 Gareth J Barnard, David Bezemer
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
if (\theme_essential\toolbox::get_setting('analyticsenabled')) {
    $analytics = \theme_essential\toolbox::get_setting('analytics');
    if ($analytics === "piwik") {
        require_once \theme_essential\toolbox::get_tile_file('piwik');
    } else {
        if ($analytics === "guniversal") {
            require_once \theme_essential\toolbox::get_tile_file('guniversal');
        }
    }
}
 public function get_title($location)
 {
     global $CFG, $SITE;
     $title = '';
     if ($location === 'navbar') {
         $url = preg_replace("(https?:)", "", $CFG->wwwroot);
         switch (\theme_essential\toolbox::get_setting('navbartitle')) {
             case 0:
                 return false;
                 break;
             case 1:
                 $title = '<a class="brand" href="' . $url . '">' . format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID))) . '</a>';
                 break;
             case 2:
                 $title = '<a class="brand" href="' . $url . '">' . format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))) . '</a>';
                 break;
             default:
                 $title = '<a class="brand" href="' . $url . '">' . format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))) . '</a>';
                 break;
         }
     } else {
         if ($location === 'header') {
             switch (\theme_essential\toolbox::get_setting('headertitle')) {
                 case 0:
                     return false;
                     break;
                 case 1:
                     $title = '<h1 id="title">' . format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID))) . '</h1>';
                     break;
                 case 2:
                     $title = '<h1 id="title">' . format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))) . '</h1>';
                     break;
                 case 3:
                     $title = '<h1 id="smalltitle">' . format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID))) . '</h2>';
                     $title .= '<h2 id="subtitle">' . strip_tags($SITE->summary) . '</h3>';
                     break;
                 case 4:
                     $title = '<h1 id="smalltitle">' . format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))) . '</h2>';
                     $title .= '<h2 id="subtitle">' . strip_tags($SITE->summary) . '</h3>';
                     break;
                 default:
                     break;
             }
         }
     }
     return $title;
 }
예제 #18
0
파일: secure.php 프로젝트: RobsonTK/Moodle
    </section>
</div>

<footer>
    <a href="#top" class="back-to-top" ><i class="fa fa-angle-up "></i></a>
    <script type="text/javascript">
        jQuery(document).ready(function () {
            <?php 
if (\theme_essential\toolbox::not_lte_ie9()) {
    echo "jQuery('#essentialnavbar').affix({";
    echo "offset: {";
    echo "top: \$('#page-header').height()";
    echo "}";
    echo "});";
    if ($breadcrumbstyle == '1') {
        echo "\$('.breadcrumb').jBreadCrumb();";
    }
}
if (\theme_essential\toolbox::get_setting('fitvids')) {
    echo "\$('#page').fitVids();";
}
?>
        });
    </script>
</footer>

<?php 
echo $OUTPUT->standard_end_of_body_html();
?>
</body>
</html>
 public function test_render_slide()
 {
     set_config('slide1url', 'https://about.me/gjbarnard', 'theme_essential');
     set_config('slide1target', '_blank', 'theme_essential');
     set_config('slide1', 'Test slide one', 'theme_essential');
     set_config('slide1caption', '<p>Test of link in caption: <a href="https://about.me/gjbarnard" target="_blank">me.</a></p>', 'theme_essential');
     set_config('slide2target', '_blank', 'theme_essential');
     set_config('slide2', 'Test slide two', 'theme_essential');
     set_config('slide2caption', '<p>Test of link in caption: <a href="https://about.me/gjbarnard" target="_blank">me.</a></p>', 'theme_essential');
     $this->resetAfterTest(true);
     $this->setup_renderer();
     $theslide1 = \theme_essential\toolbox::render_slide(1, 0);
     $thecontent1 = '<a href="https://about.me/gjbarnard" target="_blank" class="item side-caption active">';
     $thecontent1 .= '<div class="container-fluid"><div class="row-fluid"><div class="span5 the-side-caption">';
     $thecontent1 .= '<div class="the-side-caption-content"><h4>Test slide one</h4><div><p>Test of link in caption: me.</p>';
     $thecontent1 .= '</div></div></div><div class="span7"><div class="carousel-image-container">';
     $thecontent1 .= '<img src="http://www.example.com/moodle/theme/image.php/_s/essential/theme/1/default_slide" ';
     $thecontent1 .= 'alt="Test slide one" class="carousel-image"></div></div></div></div></a>';
     $this->assertEquals($thecontent1, $theslide1);
     $theslide2 = \theme_essential\toolbox::render_slide(2, 0);
     $thecontent2 = '<div class="item side-caption">';
     $thecontent2 .= '<div class="container-fluid"><div class="row-fluid"><div class="span5 the-side-caption">';
     $thecontent2 .= '<div class="the-side-caption-content"><h4>Test slide two</h4><div>';
     $thecontent2 .= '<p>Test of link in caption: <a href="https://about.me/gjbarnard" target="_blank">me.</a></p>';
     $thecontent2 .= '</div></div></div><div class="span7"><div class="carousel-image-container">';
     $thecontent2 .= '<img src="http://www.example.com/moodle/theme/image.php/_s/essential/theme/1/default_slide" ';
     $thecontent2 .= 'alt="Test slide two" class="carousel-image"></div></div></div></div></div>';
     $this->assertEquals($thecontent2, $theslide2);
 }
예제 #20
0
function theme_essential_process_css($css, $theme)
{
    // Set the theme width.
    $pagewidth = \theme_essential\toolbox::get_setting('pagewidth', false, $theme);
    $css = \theme_essential\toolbox::set_pagewidth($css, $pagewidth);
    // Set the theme font.
    $css = \theme_essential\toolbox::set_font($css, 'heading', \theme_essential\toolbox::get_setting('fontnameheading'));
    $css = \theme_essential\toolbox::set_font($css, 'body', \theme_essential\toolbox::get_setting('fontnamebody'));
    // Set the theme colour.
    $themecolor = \theme_essential\toolbox::get_setting('themecolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $themecolor, '[[setting:themecolor]]', '#30add1');
    // Set the theme text colour.
    $themetextcolor = \theme_essential\toolbox::get_setting('themetextcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $themetextcolor, '[[setting:themetextcolor]]', '#047797');
    // Set the theme url colour.
    $themeurlcolor = \theme_essential\toolbox::get_setting('themeurlcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $themeurlcolor, '[[setting:themeurlcolor]]', '#FF5034');
    // Set the theme hover colour.
    $themehovercolor = \theme_essential\toolbox::get_setting('themehovercolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $themehovercolor, '[[setting:themehovercolor]]', '#F32100');
    // Set the theme header text colour.
    $themetextcolor = \theme_essential\toolbox::get_setting('headertextcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $themetextcolor, '[[setting:headertextcolor]]', '#217a94');
    // Set the theme icon colour.
    $themeiconcolor = \theme_essential\toolbox::get_setting('themeiconcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $themeiconcolor, '[[setting:themeiconcolor]]', '#30add1');
    // Set the theme navigation colour.
    $themenavcolor = \theme_essential\toolbox::get_setting('themenavcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $themenavcolor, '[[setting:themenavcolor]]', '#ffffff');
    // Set the footer colour.
    $footercolor = \theme_essential\toolbox::hex2rgba(\theme_essential\toolbox::get_setting('footercolor', false, $theme), '0.95');
    $css = \theme_essential\toolbox::set_color($css, $footercolor, '[[setting:footercolor]]', '#30add1');
    // Set the footer text colour.
    $footertextcolor = \theme_essential\toolbox::get_setting('footertextcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $footertextcolor, '[[setting:footertextcolor]]', '#ffffff');
    // Set the footer block background colour.
    $footerheadingcolor = \theme_essential\toolbox::get_setting('footerblockbackgroundcolour', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $footerheadingcolor, '[[setting:footerblockbackgroundcolour]]', '#cccccc');
    // Set the footer block heading colour.
    $footerheadingcolor = \theme_essential\toolbox::get_setting('footerheadingcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $footerheadingcolor, '[[setting:footerheadingcolor]]', '#cccccc');
    // Set the footer text colour.
    $footertextcolor = \theme_essential\toolbox::get_setting('footerblocktextcolour', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $footertextcolor, '[[setting:footerblocktextcolour]]', '#000000');
    // Set the footer block URL colour.
    $footerurlcolor = \theme_essential\toolbox::get_setting('footerblockurlcolour', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $footerurlcolor, '[[setting:footerblockurlcolour]]', '#000000');
    // Set the footer block hover colour.
    $footerhovercolor = \theme_essential\toolbox::get_setting('footerblockhovercolour', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $footerhovercolor, '[[setting:footerblockhovercolour]]', '#555555');
    // Set the footer separator colour.
    $footersepcolor = \theme_essential\toolbox::get_setting('footersepcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $footersepcolor, '[[setting:footersepcolor]]', '#313131');
    // Set the footer URL colour.
    $footerurlcolor = \theme_essential\toolbox::get_setting('footerurlcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $footerurlcolor, '[[setting:footerurlcolor]]', '#cccccc');
    // Set the footer hover colour.
    $footerhovercolor = \theme_essential\toolbox::get_setting('footerhovercolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $footerhovercolor, '[[setting:footerhovercolor]]', '#bbbbbb');
    // Set the slide header colour.
    $slideshowcolor = \theme_essential\toolbox::get_setting('slideshowcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $slideshowcolor, '[[setting:slideshowcolor]]', '#30add1');
    // Set the slide header colour.
    $slideheadercolor = \theme_essential\toolbox::get_setting('slideheadercolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $slideheadercolor, '[[setting:slideheadercolor]]', '#30add1');
    // Set the slide caption text colour.
    $slidecaptiontextcolor = \theme_essential\toolbox::get_setting('slidecaptiontextcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $slidecaptiontextcolor, '[[setting:slidecaptiontextcolor]]', '#ffffff');
    // Set the slide caption background colour.
    $slidecaptionbackgroundcolor = \theme_essential\toolbox::get_setting('slidecaptionbackgroundcolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $slidecaptionbackgroundcolor, '[[setting:slidecaptionbackgroundcolor]]', '#30add1');
    // Set the slide button colour.
    $slidebuttoncolor = \theme_essential\toolbox::get_setting('slidebuttoncolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $slidebuttoncolor, '[[setting:slidebuttoncolor]]', '#30add1');
    // Set the slide button hover colour.
    $slidebuttonhcolor = \theme_essential\toolbox::get_setting('slidebuttonhovercolor', false, $theme);
    $css = \theme_essential\toolbox::set_color($css, $slidebuttonhcolor, '[[setting:slidebuttonhovercolor]]', '#217a94');
    if (\theme_essential\toolbox::get_setting('enablealternativethemecolors1', false, $theme) || \theme_essential\toolbox::get_setting('enablealternativethemecolors2', false, $theme) || \theme_essential\toolbox::get_setting('enablealternativethemecolors3', false, $theme) || \theme_essential\toolbox::get_setting('enablealternativethemecolors4', false, $theme)) {
        // Set theme alternative colours.
        $defaultcolors = array('#a430d1', '#d15430', '#5dd130', '#006b94');
        $defaulthovercolors = array('#9929c4', '#c44c29', '#53c429', '#4090af');
        foreach (range(1, 4) as $alternative) {
            $default = $defaultcolors[$alternative - 1];
            $defaulthover = $defaulthovercolors[$alternative - 1];
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'color' . $alternative, \theme_essential\toolbox::get_setting('alternativethemecolor' . $alternative, false, $theme), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'textcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemetextcolor' . $alternative, false, $theme), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'urlcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeurlcolor' . $alternative, false, $theme), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'iconcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeiconcolor' . $alternative, false, $theme), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'navcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemenavcolor' . $alternative, false, $theme), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'hovercolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemehovercolor' . $alternative, false, $theme), $defaulthover);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footercolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefootercolor' . $alternative, false, $theme), '#30add1');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footertextcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefootertextcolor' . $alternative, false, $theme), '#30add1');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerblockbackgroundcolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterblockbackgroundcolour' . $alternative, false, $theme), '#cccccc');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerblocktextcolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterblocktextcolour' . $alternative, false, $theme), '#000000');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerblockurlcolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterblockurlcolour' . $alternative, false, $theme), '#000000');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerblockhovercolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterblockhovercolour' . $alternative, false, $theme), '#555555');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerheadingcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterheadingcolor' . $alternative, false, $theme), '#cccccc');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footersepcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefootersepcolor' . $alternative, false, $theme), '#313131');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerurlcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterurlcolor' . $alternative, false, $theme), '#cccccc');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerhovercolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterhovercolor' . $alternative, false, $theme), '#bbbbbb');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'slidecaptiontextcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeslidecaptiontextcolor' . $alternative, false, $theme), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'slidecaptionbackgroundcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeslidecaptionbackgroundcolor' . $alternative, false, $theme), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'slidebuttoncolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeslidebuttoncolor' . $alternative, false, $theme), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'slidebuttonhovercolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeslidebuttonhovercolor' . $alternative, false, $theme), $defaulthover);
        }
    }
    // Set the background image for the logo.
    $logo = \theme_essential\toolbox::setting_file_url('logo', 'logo', $theme);
    $css = \theme_essential\toolbox::set_logo($css, $logo);
    // Set the logo height.
    $logoheight = \theme_essential\toolbox::get_setting('logoheight');
    $css = \theme_essential\toolbox::set_logoheight($css, $logoheight);
    // Set the background image for the header.
    $headerbackground = \theme_essential\toolbox::setting_file_url('headerbackground', 'headerbackground', $theme);
    $css = \theme_essential\toolbox::set_headerbackground($css, $headerbackground);
    // Set the background image for the page.
    $pagebackground = \theme_essential\toolbox::setting_file_url('pagebackground', 'pagebackground', $theme);
    $css = \theme_essential\toolbox::set_pagebackground($css, $pagebackground);
    // Set the background style for the page.
    $pagebgstyle = \theme_essential\toolbox::get_setting('pagebackgroundstyle', false, $theme);
    $css = \theme_essential\toolbox::set_pagebackgroundstyle($css, $pagebgstyle);
    // Set marketing height.
    $marketingheight = \theme_essential\toolbox::get_setting('marketingheight', false, $theme);
    $marketingimageheight = \theme_essential\toolbox::get_setting('marketingimageheight');
    $css = \theme_essential\toolbox::set_marketingheight($css, $marketingheight, $marketingimageheight);
    // Set marketing images.
    $setting = 'marketing1image';
    $marketingimage = \theme_essential\toolbox::setting_file_url($setting, $setting, $theme);
    $css = \theme_essential\toolbox::set_marketingimage($css, $marketingimage, $setting);
    $setting = 'marketing2image';
    $marketingimage = \theme_essential\toolbox::setting_file_url($setting, $setting, $theme);
    $css = \theme_essential\toolbox::set_marketingimage($css, $marketingimage, $setting);
    $setting = 'marketing3image';
    $marketingimage = \theme_essential\toolbox::setting_file_url($setting, $setting, $theme);
    $css = \theme_essential\toolbox::set_marketingimage($css, $marketingimage, $setting);
    // Set custom CSS.
    $customcss = \theme_essential\toolbox::get_setting('customcss', false, $theme);
    $css = \theme_essential\toolbox::set_customcss($css, $customcss);
    // Finally return processed CSS.
    return $css;
}
예제 #21
0
// 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/>.
/**
 * Essential is a clean and customizable theme.
 *
 * @package     theme_essential
 * @copyright   2016 Gareth J Barnard
 * @copyright   2013 Julian Ridden
 * @copyright   2014 Gareth J Barnard, David Bezemer
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once \theme_essential\toolbox::get_tile_file('additionaljs');
echo $OUTPUT->doctype();
?>
<html <?php 
echo $OUTPUT->htmlattributes();
?>
>

<head>
    <title><?php 
echo $OUTPUT->page_title();
?>
</title>
    <link rel="shortcut icon" href="<?php 
echo $OUTPUT->favicon();
?>
예제 #22
0
파일: login.php 프로젝트: syedhameed/sc
    $background_image1 = '';
    $loginimage = (!empty($PAGE->theme->settings->loginpage_background_image));
    if ($loginimage) {
        //$background_image1 = $PAGE->theme->setting_file_url('loginpage_background_image', 'loginpage_background_image');
    }
    ?>
    <?php
    //echo '<img src="'.$background_image1.'">';
    //echo '<img src="'.$CFG->wwwroot.'/theme/essential/pix/logo.png">';
    echo '<div class="login-logo_container" ><a class="login_logo" href="'.preg_replace("(https?:)", "", $CFG->wwwroot).'" title="'.get_string('home').'"></a></div>';
    ?>
    <section role="main-content">
        <!-- Start Main Regions -->
        <div id="page-content" class="row-fluid">
            <section id="region-main" class="span12">
                <?php
                
                echo $OUTPUT->course_content_header();
                echo $OUTPUT->main_content();
                echo $OUTPUT->course_content_footer();
                ?>
            </section>
        </div>
        <!-- End Main Regions -->
    </section>
</div>

<?php require_once(\theme_essential\toolbox::get_tile_file('footer')); ?>
</body>
</html>
    $hastitle = true;
    switch ($PAGE->pagetype) {
        case 'grade-report-overview-index':
            $hastitle = false;
            break;
        default:
            break;
    }
    return $hastitle;
}
/* Group Page Footer Region */
function essential_has_footer_region()
{
    global $PAGE;
    $hasregion = false;
    switch ($PAGE->pagetype) {
        case 'admin-plugins':
        case 'course-management':
        case 'mod-assign-view':
        case 'mod-quiz-edit':
            $hasregion = true;
            break;
        default:
            break;
    }
    return $hasregion;
}
/* Group Footer */
$hascopyright = \theme_essential\toolbox::get_setting('copyright', true);
$hasfootnote = \theme_essential\toolbox::get_setting('footnote', 'format_html');
예제 #24
0
?>
<html <?php 
echo $OUTPUT->htmlattributes();
?>
>
<head>
    <title><?php 
echo $OUTPUT->page_title();
?>
</title>
    <link rel="shortcut icon" href="<?php 
echo $OUTPUT->favicon();
?>
" />
    <?php 
echo \theme_essential\toolbox::get_csswww();
echo $OUTPUT->standard_head_html();
?>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Google web fonts -->
    <?php 
require_once dirname(__FILE__) . '/includes/fonts.php';
?>
    <!-- Start Analytics -->
    <?php 
require_once dirname(__FILE__) . '/includes/analytics.php';
?>
    <!-- End Analytics -->
</head>

<body <?php 
예제 #25
0
    $iphoneicon = \theme_essential\toolbox::get_setting('iphoneicon');
} else {
    $iphoneicon = $OUTPUT->pix_url('homeicon/iphone', 'theme');
}
if (\theme_essential\toolbox::get_setting('ipadicon')) {
    $ipadicon = \theme_essential\toolbox::get_setting('ipadicon');
} else {
    $ipadicon = $OUTPUT->pix_url('homeicon/ipad', 'theme');
}
if (\theme_essential\toolbox::get_setting('iphoneretinaicon')) {
    $iphoneretinaicon = \theme_essential\toolbox::get_setting('iphoneretinaicon');
} else {
    $iphoneretinaicon = $OUTPUT->pix_url('homeicon/iphone_retina', 'theme');
}
if (\theme_essential\toolbox::get_setting('ipadretinaicon')) {
    $ipadretinaicon = \theme_essential\toolbox::get_setting('ipadretinaicon');
} else {
    $ipadretinaicon = $OUTPUT->pix_url('homeicon/ipad_retina', 'theme');
}
?>

<link rel="apple-touch-icon-precomposed" sizes="57x57" href="<?php 
echo $iphoneicon;
?>
"/>
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php 
echo $ipadicon;
?>
"/>
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php 
echo $iphoneretinaicon;
예제 #26
0
echo \theme_essential\toolbox::get_setting('marketing2target');
?>
" class="marketing-button">
            <?php 
echo \theme_essential\toolbox::get_setting('marketing2buttontext', true);
?>
        </a>
        <?php 
echo $OUTPUT->essential_edit_button('theme_essential_frontpage');
?>
    </div>

    <!-- Advert Button #3 -->
    <div class="span4">
        <a href="<?php 
echo \theme_essential\toolbox::get_setting('marketing3buttonurl');
?>
"
           target="<?php 
echo \theme_essential\toolbox::get_setting('marketing3target');
?>
" class="marketing-button">
            <?php 
echo \theme_essential\toolbox::get_setting('marketing3buttontext', true);
?>
        </a>
        <?php 
echo $OUTPUT->essential_edit_button('theme_essential_frontpage');
?>
    </div>
</div>
예제 #27
0
?>
">
        <div class="container-fluid">
            <div class="row-fluid">
                <!-- HEADER: LOGO AREA -->
                <div class="<?php 
echo $logoclass;
echo !$left ? ' pull-right' : ' pull-left';
?>
">
<?php 
if (!$haslogo) {
    echo '<a class="textlogo" href="';
    echo preg_replace("(https?:)", "", $CFG->wwwroot);
    echo '">';
    echo '<i id="headerlogo" class="fa fa-' . \theme_essential\toolbox::get_setting('siteicon') . '"></i>';
    echo '<div class="titlearea">' . $OUTPUT->get_title('header') . '</div>';
    echo '</a>';
} else {
    echo '<a class="logo" href="' . preg_replace("(https?:)", "", $CFG->wwwroot) . '" title="' . get_string('home') . '"></a>';
}
?>
                </div>
                <?php 
if ($hassocialnetworks || $hasmobileapps) {
    ?>
                <a class="btn btn-icon" data-toggle="collapse" data-target="#essentialicons">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
예제 #28
0
</li>
                    <li class="navbar-text"><?php 
echo $OUTPUT->user_menu();
?>
</li>
                </ul>
            </div>
        </div>
    </nav>
</header>

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

    <header id="page-header" class="clearfix">
        <?php 
require_once \theme_essential\toolbox::get_tile_file('pagenavbar');
echo $OUTPUT->page_heading();
?>
        <div id="course-header">
            <?php 
echo $OUTPUT->course_header();
?>
        </div>
    </header>

    <div id="page-content" class="row-fluid">
        <section id="region-main" class="span12">
            <?php 
echo $OUTPUT->course_content_header();
echo $OUTPUT->main_content();
echo $OUTPUT->course_content_footer();
예제 #29
0
function theme_essential_process_css($css, $theme)
{
    global $PAGE;
    $outputus = $PAGE->get_renderer('theme_essential', 'core');
    \theme_essential\toolbox::set_core_renderer($outputus);
    // Set the theme width.
    $pagewidth = \theme_essential\toolbox::get_setting('pagewidth');
    $css = \theme_essential\toolbox::set_pagewidth($css, $pagewidth);
    // Set the theme font.
    $css = \theme_essential\toolbox::set_font($css, 'heading', \theme_essential\toolbox::get_setting('fontnameheading'));
    $css = \theme_essential\toolbox::set_font($css, 'body', \theme_essential\toolbox::get_setting('fontnamebody'));
    // Set the theme colour.
    $themecolor = \theme_essential\toolbox::get_setting('themecolor');
    $css = \theme_essential\toolbox::set_color($css, $themecolor, '[[setting:themecolor]]', '#30add1');
    // Input focus colour.
    $css = \theme_essential\toolbox::set_color($css, $themecolor, '[[setting:inputfocusbordercolor]]', '#30add1', '0.8');
    $css = \theme_essential\toolbox::set_color($css, $themecolor, '[[setting:inputfocusshadowcolor]]', '#30add1', '0.6');
    // Set the theme text colour.
    $themetextcolor = \theme_essential\toolbox::get_setting('themetextcolor');
    $css = \theme_essential\toolbox::set_color($css, $themetextcolor, '[[setting:themetextcolor]]', '#047797');
    // Set the theme url colour.
    $themeurlcolor = \theme_essential\toolbox::get_setting('themeurlcolor');
    $css = \theme_essential\toolbox::set_color($css, $themeurlcolor, '[[setting:themeurlcolor]]', '#FF5034');
    // Set the theme hover colour.
    $themehovercolor = \theme_essential\toolbox::get_setting('themehovercolor');
    $css = \theme_essential\toolbox::set_color($css, $themehovercolor, '[[setting:themehovercolor]]', '#F32100');
    // Set the theme header text colour.
    $themetextcolor = \theme_essential\toolbox::get_setting('headertextcolor');
    $css = \theme_essential\toolbox::set_color($css, $themetextcolor, '[[setting:headertextcolor]]', '#217a94');
    // Set the theme icon colour.
    $themeiconcolor = \theme_essential\toolbox::get_setting('themeiconcolor');
    $css = \theme_essential\toolbox::set_color($css, $themeiconcolor, '[[setting:themeiconcolor]]', '#30add1');
    // Set the theme default button text colour.
    $themedefaultbuttontextcolour = \theme_essential\toolbox::get_setting('themedefaultbuttontextcolour');
    $css = \theme_essential\toolbox::set_color($css, $themedefaultbuttontextcolour, '[[setting:themedefaultbuttontextcolour]]', '#ffffff');
    // Set the theme default button text hover colour.
    $themedefaultbuttontexthovercolour = \theme_essential\toolbox::get_setting('themedefaultbuttontexthovercolour');
    $css = \theme_essential\toolbox::set_color($css, $themedefaultbuttontexthovercolour, '[[setting:themedefaultbuttontexthovercolour]]', '#ffffff');
    // Set the theme default button background colour.
    $themedefaultbuttonbackgroundcolour = \theme_essential\toolbox::get_setting('themedefaultbuttonbackgroundcolour');
    $css = \theme_essential\toolbox::set_color($css, $themedefaultbuttonbackgroundcolour, '[[setting:themedefaultbuttonbackgroundcolour]]', '#30add1');
    $css = \theme_essential\toolbox::set_color($css, $themedefaultbuttonbackgroundcolour, '[[setting:themedefaultbuttonbackgroundcolourimage]]', '#30add1');
    $css = \theme_essential\toolbox::set_color($css, \theme_essential\toolbox::hexadjust($themedefaultbuttonbackgroundcolour, 10), '[[setting:themedefaultbuttonbackgroundcolourrgba]]', '#30add1', '0.25');
    // Set the theme default button background hover colour.
    $themedefaultbuttonbackgroundhovercolour = \theme_essential\toolbox::get_setting('themedefaultbuttonbackgroundhovercolour');
    $css = \theme_essential\toolbox::set_color($css, $themedefaultbuttonbackgroundhovercolour, '[[setting:themedefaultbuttonbackgroundhovercolour]]', '#3ad4ff');
    $css = \theme_essential\toolbox::set_color($css, $themedefaultbuttonbackgroundhovercolour, '[[setting:themedefaultbuttonbackgroundhovercolourimage]]', '#3ad4ff');
    $css = \theme_essential\toolbox::set_color($css, \theme_essential\toolbox::hexadjust($themedefaultbuttonbackgroundhovercolour, 10), '[[setting:themedefaultbuttonbackgroundhovercolourrgba]]', '#3ad4ff', '0.25');
    // Set the theme navigation colour.
    $themenavcolor = \theme_essential\toolbox::get_setting('themenavcolor');
    $css = \theme_essential\toolbox::set_color($css, $themenavcolor, '[[setting:themenavcolor]]', '#ffffff');
    // Set the theme stripe text colour.
    $themestripetextcolour = \theme_essential\toolbox::get_setting('themestripetextcolour');
    $css = \theme_essential\toolbox::set_color($css, $themestripetextcolour, '[[setting:themestripetextcolour]]', '#ffffff');
    // Set the theme stripe background colour.
    $themestripebackgroundcolour = \theme_essential\toolbox::get_setting('themestripebackgroundcolour');
    $css = \theme_essential\toolbox::set_color($css, $themestripebackgroundcolour, '[[setting:themestripebackgroundcolour]]', '#ff9a34');
    // Set the footer colour.
    $footercolor = \theme_essential\toolbox::get_setting('footercolor');
    $css = \theme_essential\toolbox::set_color($css, $footercolor, '[[setting:footercolor]]', '#30add1', '0.95');
    // Set the footer text colour.
    $footertextcolor = \theme_essential\toolbox::get_setting('footertextcolor');
    $css = \theme_essential\toolbox::set_color($css, $footertextcolor, '[[setting:footertextcolor]]', '#ffffff');
    // Set the footer block background colour.
    $footerheadingcolor = \theme_essential\toolbox::get_setting('footerblockbackgroundcolour');
    $css = \theme_essential\toolbox::set_color($css, $footerheadingcolor, '[[setting:footerblockbackgroundcolour]]', '#cccccc');
    // Set the footer block heading colour.
    $footerheadingcolor = \theme_essential\toolbox::get_setting('footerheadingcolor');
    $css = \theme_essential\toolbox::set_color($css, $footerheadingcolor, '[[setting:footerheadingcolor]]', '#cccccc');
    // Set the footer text colour.
    $footertextcolor = \theme_essential\toolbox::get_setting('footerblocktextcolour');
    $css = \theme_essential\toolbox::set_color($css, $footertextcolor, '[[setting:footerblocktextcolour]]', '#000000');
    // Set the footer block URL colour.
    $footerurlcolor = \theme_essential\toolbox::get_setting('footerblockurlcolour');
    $css = \theme_essential\toolbox::set_color($css, $footerurlcolor, '[[setting:footerblockurlcolour]]', '#000000');
    // Set the footer block hover colour.
    $footerhovercolor = \theme_essential\toolbox::get_setting('footerblockhovercolour');
    $css = \theme_essential\toolbox::set_color($css, $footerhovercolor, '[[setting:footerblockhovercolour]]', '#555555');
    // Set the footer separator colour.
    $footersepcolor = \theme_essential\toolbox::get_setting('footersepcolor');
    $css = \theme_essential\toolbox::set_color($css, $footersepcolor, '[[setting:footersepcolor]]', '#313131');
    // Set the footer URL colour.
    $footerurlcolor = \theme_essential\toolbox::get_setting('footerurlcolor');
    $css = \theme_essential\toolbox::set_color($css, $footerurlcolor, '[[setting:footerurlcolor]]', '#cccccc');
    // Set the footer hover colour.
    $footerhovercolor = \theme_essential\toolbox::get_setting('footerhovercolor');
    $css = \theme_essential\toolbox::set_color($css, $footerhovercolor, '[[setting:footerhovercolor]]', '#bbbbbb');
    // Set the slide header colour.
    $slideshowcolor = \theme_essential\toolbox::get_setting('slideshowcolor');
    $css = \theme_essential\toolbox::set_color($css, $slideshowcolor, '[[setting:slideshowcolor]]', '#30add1');
    // Set the slide header colour.
    $slideheadercolor = \theme_essential\toolbox::get_setting('slideheadercolor');
    $css = \theme_essential\toolbox::set_color($css, $slideheadercolor, '[[setting:slideheadercolor]]', '#30add1');
    // Set the slide caption text colour.
    $slidecaptiontextcolor = \theme_essential\toolbox::get_setting('slidecaptiontextcolor');
    $css = \theme_essential\toolbox::set_color($css, $slidecaptiontextcolor, '[[setting:slidecaptiontextcolor]]', '#ffffff');
    // Set the slide caption background colour.
    $slidecaptionbackgroundcolor = \theme_essential\toolbox::get_setting('slidecaptionbackgroundcolor');
    $css = \theme_essential\toolbox::set_color($css, $slidecaptionbackgroundcolor, '[[setting:slidecaptionbackgroundcolor]]', '#30add1');
    // Set the slide button colour.
    $slidebuttoncolor = \theme_essential\toolbox::get_setting('slidebuttoncolor');
    $css = \theme_essential\toolbox::set_color($css, $slidebuttoncolor, '[[setting:slidebuttoncolor]]', '#30add1');
    // Set the slide button hover colour.
    $slidebuttonhcolor = \theme_essential\toolbox::get_setting('slidebuttonhovercolor');
    $css = \theme_essential\toolbox::set_color($css, $slidebuttonhcolor, '[[setting:slidebuttonhovercolor]]', '#217a94');
    if (\theme_essential\toolbox::get_setting('enablealternativethemecolors1') || \theme_essential\toolbox::get_setting('enablealternativethemecolors2') || \theme_essential\toolbox::get_setting('enablealternativethemecolors3') || \theme_essential\toolbox::get_setting('enablealternativethemecolors4')) {
        // Set theme alternative colours.
        $defaultcolors = array('#a430d1', '#d15430', '#5dd130', '#006b94');
        $defaulthovercolors = array('#9929c4', '#c44c29', '#53c429', '#4090af');
        foreach (range(1, 4) as $alternative) {
            $default = $defaultcolors[$alternative - 1];
            $defaulthover = $defaulthovercolors[$alternative - 1];
            $alternativethemecolour = \theme_essential\toolbox::get_setting('alternativethemecolor' . $alternative);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'color' . $alternative, $alternativethemecolour, $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'inputfocusbordercolor' . $alternative, $alternativethemecolour, $default, '0.8');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'inputfocusshadowcolor' . $alternative, $alternativethemecolour, $default, '0.6');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'textcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemetextcolor' . $alternative), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'urlcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeurlcolor' . $alternative), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'defaultbuttontextcolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemedefaultbuttontextcolour' . $alternative), '#ffffff');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'defaultbuttontexthovercolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemedefaultbuttontexthovercolour' . $alternative), '#ffffff');
            $alternativethemedefaultbuttonbackgroundcolour = \theme_essential\toolbox::get_setting('alternativethemedefaultbuttonbackgroundcolour' . $alternative);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'defaultbuttonbackgroundcolour' . $alternative, $alternativethemedefaultbuttonbackgroundcolour, '#30add1');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'defaultbuttonbackgroundcolourimage' . $alternative, $alternativethemedefaultbuttonbackgroundcolour, '#30add1');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'defaultbuttonbackgroundcolourrgba' . $alternative, \theme_essential\toolbox::hexadjust($alternativethemedefaultbuttonbackgroundcolour, 10), '#30add1', '0.25');
            $alternativethemedefaultbuttonbackgroundhovercolour = \theme_essential\toolbox::get_setting('alternativethemedefbuttonbackgroundhvrcolour' . $alternative);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'defaultbuttonbackgroundhovercolour' . $alternative, $alternativethemedefaultbuttonbackgroundhovercolour, '#3ad4ff');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'defaultbuttonbackgroundhovercolourimage' . $alternative, $alternativethemedefaultbuttonbackgroundhovercolour, '#3ad4ff');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'defaultbuttonbackgroundhovercolourrgba' . $alternative, \theme_essential\toolbox::hexadjust($alternativethemedefaultbuttonbackgroundhovercolour, 10), '#3ad4ff', '0.25');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'iconcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeiconcolor' . $alternative), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'navcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemenavcolor' . $alternative), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'hovercolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemehovercolor' . $alternative), $defaulthover);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'stripetextcolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemestripetextcolour' . $alternative), '#ffffff');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'stripebackgroundcolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemestripebackgroundcolour' . $alternative), '#ff9a34');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footercolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefootercolor' . $alternative), '#30add1');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footertextcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefootertextcolor' . $alternative), '#30add1');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerblockbackgroundcolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterblockbackgroundcolour' . $alternative), '#cccccc');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerblocktextcolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterblocktextcolour' . $alternative), '#000000');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerblockurlcolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterblockurlcolour' . $alternative), '#000000');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerblockhovercolour' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterblockhovercolour' . $alternative), '#555555');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerheadingcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterheadingcolor' . $alternative), '#cccccc');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footersepcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefootersepcolor' . $alternative), '#313131');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerurlcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterurlcolor' . $alternative), '#cccccc');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'footerhovercolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemefooterhovercolor' . $alternative), '#bbbbbb');
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'slidecaptiontextcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeslidecaptiontextcolor' . $alternative), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'slidecaptionbackgroundcolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeslidecaptionbackgroundcolor' . $alternative), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'slidebuttoncolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeslidebuttoncolor' . $alternative), $default);
            $css = \theme_essential\toolbox::set_alternativecolor($css, 'slidebuttonhovercolor' . $alternative, \theme_essential\toolbox::get_setting('alternativethemeslidebuttonhovercolor' . $alternative), $defaulthover);
        }
    }
    // Set the background image for the logo.
    $logo = \theme_essential\toolbox::setting_file_url('logo', 'logo');
    $css = \theme_essential\toolbox::set_logo($css, $logo);
    // Set the logo width and height.
    $logowidth = \theme_essential\toolbox::get_setting('logowidth');
    $logoheight = \theme_essential\toolbox::get_setting('logoheight');
    $css = \theme_essential\toolbox::set_logodimensions($css, $logowidth, $logoheight);
    // Set the background image for the header.
    $headerbackground = \theme_essential\toolbox::setting_file_url('headerbackground', 'headerbackground');
    $css = \theme_essential\toolbox::set_headerbackground($css, $headerbackground);
    // Set the background image for the page.
    $pagebackground = \theme_essential\toolbox::setting_file_url('pagebackground', 'pagebackground');
    $css = \theme_essential\toolbox::set_pagebackground($css, $pagebackground);
    // Set the background style for the page.
    $pagebgstyle = \theme_essential\toolbox::get_setting('pagebackgroundstyle');
    $css = \theme_essential\toolbox::set_pagebackgroundstyle($css, $pagebgstyle);
    // Set marketing height.
    $marketingheight = \theme_essential\toolbox::get_setting('marketingheight');
    $marketingimageheight = \theme_essential\toolbox::get_setting('marketingimageheight');
    $css = \theme_essential\toolbox::set_marketingheight($css, $marketingheight, $marketingimageheight);
    // Set marketing images.
    $setting = 'marketing1image';
    $marketingimage = \theme_essential\toolbox::setting_file_url($setting, $setting);
    $css = \theme_essential\toolbox::set_marketingimage($css, $marketingimage, $setting);
    $setting = 'marketing2image';
    $marketingimage = \theme_essential\toolbox::setting_file_url($setting, $setting);
    $css = \theme_essential\toolbox::set_marketingimage($css, $marketingimage, $setting);
    $setting = 'marketing3image';
    $marketingimage = \theme_essential\toolbox::setting_file_url($setting, $setting);
    $css = \theme_essential\toolbox::set_marketingimage($css, $marketingimage, $setting);
    // Category course title images.
    $css = \theme_essential\toolbox::set_categorycoursetitleimages($css);
    // Set custom CSS.
    $customcss = \theme_essential\toolbox::get_setting('customcss');
    $css = \theme_essential\toolbox::set_customcss($css, $customcss);
    // Finally return processed CSS.
    return $css;
}