chat MDL-16673 Clean up inline script and output calls
[moodle.git] / theme / chameleon / ui / chameleon.php
CommitLineData
59902901 1<?php
2
3
9152fc99 4if (!empty($THEME->chameleonenabled)) {
957f6fc9 5 $chameleon_isadmin = has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
59902901 6 $chameleon_isteacher = false;
9152fc99 7 if ($COURSE->id == SITEID) {
59902901 8 $chameleon_courseparam = '';
9152fc99 9 } else {
10 $chameleon_courseparam = '?id=' . $COURSE->id;
11 $chameleon_isteacher = !empty($COURSE->theme) and has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $COURSE->id));
59902901 12 }
b08c4173 13
9152fc99 14 if ($chameleon_isadmin or ($chameleon_isteacher and !empty($CFG->allowcoursethemes) and !empty($THEME->chameleonteachereditenabled))) {
59902901 15 // either we're an admin or we're a teacher and this is being used as the course theme
16 // if we're on a page using a course theme edit that, otherwise edit the main chameleon theme
9152fc99 17 $chameleon_theme = current_theme();
59902901 18?>
19
a44091bf 20<style type="text/css"> @import '<?php echo "$CFG->themewww/$chameleon_theme" ?>/ui/chameleon_ui.css'; </style>
59902901 21
a44091bf 22<script type="text/javascript" src="<?php echo "$CFG->themewww/$chameleon_theme/ui/css_query.js" ?>"> </script>
23<script type="text/javascript" src="<?php echo "$CFG->themewww/$chameleon_theme/ui/sarissa.js" ?>"> </script>
24<script type="text/javascript" src="<?php echo "$CFG->themewww/$chameleon_theme/ui/chameleon_js.php$chameleon_courseparam" ?>"> </script>
59902901 25
26<?php
27 }
28}
29?>