From 5990290185fd7fafe26bfa4df987d4b72776cd77 Mon Sep 17 00:00:00 2001 From: urs_hunkler Date: Mon, 10 Apr 2006 17:40:28 +0000 Subject: [PATCH] ~chameleon.php contains all code neccessary to add the Chameleon engine to any theme. --- theme/chameleon/ui/chameleon.php | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 theme/chameleon/ui/chameleon.php diff --git a/theme/chameleon/ui/chameleon.php b/theme/chameleon/ui/chameleon.php new file mode 100644 index 0000000000..e5f2676132 --- /dev/null +++ b/theme/chameleon/ui/chameleon.php @@ -0,0 +1,34 @@ +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; + $chameleon_theme = (isset($CFG->coursetheme)) ? $CFG->coursetheme : current_theme(); +?> + + + + + + + + + + -- 2.39.5