~chameleon.php contains all code neccessary to add the Chameleon engine to any theme.
[moodle.git] / theme / chameleon / ui / chameleon.php
CommitLineData
59902901 1<?php
2
3
4if (isset($THEME->chameleonenabled) && $THEME->chameleonenabled) {
5 $chameleon_isadmin = isadmin();
6 $chameleon_isteacher = false;
7 if (isset($course->id)) {
8 $chameleon_courseparam = '?id=' . $course->id;
9 if (!$chameleon_isadmin) {
10 $chameleon_isteacher = (isteacher($course->id) && isset($CFG->coursetheme));
11 }
12 } else {
13 $chameleon_courseparam = '';
14 }
15
16 if ($chameleon_isadmin || $chameleon_isteacher) {
17 // either we're an admin or we're a teacher and this is being used as the course theme
18 // if we're on a page using a course theme edit that, otherwise edit the main chameleon theme
19 // $chameleon_theme = (isset($CFG->coursetheme)) ? $CFG->coursetheme : $CFG->theme;
20 $chameleon_theme = (isset($CFG->coursetheme)) ? $CFG->coursetheme : current_theme();
21?>
22
23<style type="text/css"> @import '<?php echo "$CFG->wwwroot/theme/$chameleon_theme" ?>/ui/chameleon_ui.css'; </style>
24
25<script type="text/javascript" src="<?php echo "$CFG->wwwroot/theme/$chameleon_theme/ui/css_query.js" ?>"> </script>
26<script type="text/javascript" src="<?php echo "$CFG->wwwroot/theme/$chameleon_theme/ui/sarissa.js" ?>"> </script>
27<script type="text/javascript" src="<?php echo "$CFG->wwwroot/theme/$chameleon_theme/ui/chameleon_js.php$chameleon_courseparam" ?>"> </script>
28
29<?php
30 }
31}
32?>
33
34