mirror of
https://github.com/moodle/moodle.git
synced 2025-02-25 04:23:22 +01:00
config.php contains a new option, $THEME->chameleonteachereditenabled by default this is false, preventing teachers from editing chameleon course themes. css.php has been changed a little to make use of this new property, it now also checks $CFG->allowcoursethemes before letting a teacher edit anything. There have been some bug fixes in the handling of border shorthands. Some workarounds to avoid a pretty big IE bug - the addRule method in IE's version of DOM 2 CSS (which I use to create the live preview of changes), can crash the browser if the selector being added contains certain characters. Now as chameleon generates the preview it checks the selectors against a list of allowed characters - if the selector contains any character not on the list it will be ignored. I don't think I'm quite there yet, but I made a bit of a change in some of the event handling code which means support for IE 5.5 seems to be getting closer :-)
77 lines
2.8 KiB
HTML
77 lines
2.8 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html<?php echo $direction ?>>
|
|
<head>
|
|
<?php echo $meta ?>
|
|
<meta name="keywords" content="moodle, <?php echo $title ?> " />
|
|
<title><?php echo $title ?></title>
|
|
<link rel="shortcut icon" href="<?php echo "$CFG->wwwroot/theme/$CFG->theme" ?>/favicon.ico" />
|
|
|
|
<?php
|
|
|
|
|
|
if (isset($THEME->chameleonenabled) && $THEME->chameleonenabled) {
|
|
$chameleon_isadmin = isadmin();
|
|
$chameleon_isteacher = false;
|
|
if (isset($course->id)) {
|
|
$chameleon_courseparam = '?id=' . $course->id;
|
|
if (!$chameleon_isadmin) {
|
|
$chameleon_isteacher = (isteacher($course->id) && isset($CFG->coursetheme));
|
|
}
|
|
} else {
|
|
$chameleon_courseparam = '';
|
|
}
|
|
|
|
if ($chameleon_isadmin || $chameleon_isteacher) {
|
|
// either we're an admin or we're a teacher and this is being used as the course theme
|
|
// if we're on a page using a course theme edit that, otherwise edit the main chameleon theme
|
|
$chameleon_theme = (isset($CFG->coursetheme)) ? $CFG->coursetheme : $CFG->theme;
|
|
?>
|
|
|
|
<style type="text/css"> @import '<?php echo "$CFG->wwwroot/theme/$chameleon_theme" ?>/ui/chameleon_ui.css'; </style>
|
|
|
|
<script type="text/javascript" src="<?php echo "$CFG->wwwroot/theme/$chameleon_theme/ui/css_query.js" ?>"> </script>
|
|
<script type="text/javascript" src="<?php echo "$CFG->wwwroot/theme/$chameleon_theme/ui/sarissa.js" ?>"> </script>
|
|
<script type="text/javascript" src="<?php echo "$CFG->wwwroot/theme/$chameleon_theme/ui/chameleon_js.php$chameleon_courseparam" ?>"> </script>
|
|
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
|
|
<?php include("$CFG->javascript"); ?>
|
|
</head>
|
|
|
|
<body<?php
|
|
echo " $bodytags";
|
|
if ($focus) {
|
|
echo " onload=\"setfocus()\"";
|
|
};
|
|
?>>
|
|
|
|
<div id="page">
|
|
|
|
<?php if ($home) { // This is what gets printed on the home page only
|
|
?>
|
|
<div id="header-home">
|
|
<div class="headermain"><?php echo $heading ?></div>
|
|
<div class="headermenu"><?php echo $menu ?></div>
|
|
</div>
|
|
<table class="navbar"><tr><td>
|
|
|
|
</td></tr></table>
|
|
<?php } else { // This is what gets printed on any other page with a heading
|
|
?>
|
|
<div id="header">
|
|
<div class="headermain"><?php echo $heading ?></div>
|
|
<div class="headermenu"><?php echo $menu ?></div>
|
|
</div>
|
|
<table class="navbar"><tr><td>
|
|
<?php if ($navigation) { // This is the navigation table with breadcrumbs ?>
|
|
<div class="breadcrumb"><?php print_navigation($navigation); ?></div>
|
|
<div class="navbutton"><?php echo $button; ?></div>
|
|
<?php } ?>
|
|
</td></tr></table>
|
|
<?php } ?>
|
|
<!-- END OF HEADER -->
|
|
<div id="content">
|