*/
public $editor_sheets = array();
+ /**
+ * The names of all the javascript files this theme that you would
+ * like included, in order. Give the names of the files without .js.
+ *
+ * @var array
+ */
+ public $javascripts = array();
+
+ /**
+ * The names of all the javascript files from parents that should be expcluded.
+ * true value may be used to specify all parents or all themes from one parent.
+ * If no value specified value from parent theme used.
+ *
+ * @var array or arrays, true means all, null means use value from parent
+ */
+ public $parents_exclude_javascripts = null;
+
/**
* Which file to use for each page layout.
*
$baseconfig = $config;
}
- $configurable = array('parents', 'sheets', 'parents_exclude_sheets', 'plugins_exclude_sheets', 'layouts', 'resource_mp3player_colors',
+ $configurable = array('parents', 'sheets', 'parents_exclude_sheets', 'plugins_exclude_sheets', 'javascripts',
+ 'parents_exclude_javascripts', 'layouts', 'resource_mp3player_colors',
'filter_mediaplugin_colors', 'rendererfactory', 'csspostprocess', 'editor_sheets', 'rarrow', 'larrow');
foreach ($config as $key=>$value) {
/**
* Get the stylesheet URL of this theme
* @param bool $encoded false means use & and true use & in URLs
- * @return string
+ * @return array of moodle_url
*/
public function css_urls() {
global $CFG;
}
}
+ /**
+ * Get the javascript URL of this theme
+ * @param bool $encoded false means use & and true use & in URLs
+ * @return moodle_url
+ */
+ public function javascript_url() {
+ global $CFG;
+
+ $rev = theme_get_revision();
+
+ $params = array('theme'=>$this->name,'rev'=>$rev);
+ return new moodle_url($CFG->httpswwwroot.'/theme/javascripts.php', $params);
+ }
+
/**
* Returns the content of the one huge CSS merged from all style sheets.
* @return string
$output .= '<link rel="stylesheet" type="text/css" href="' . $url->out() . '" />' . "\n";
}
+ // Get the theme javascript
+ $jsurl = $this->page->theme->javascript_url();
+ $this->page->requires->js($jsurl->out_raw(), true)->in_head();
+
// Perform a browser environment check for the flash version. Should only run once per login session.
if (isloggedin() && !empty($CFG->excludeoldflashclients) && empty($SESSION->flashversion)) {
$this->page->requires->yui2_lib('event')->in_head();
--- /dev/null
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// 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 file is responsible for serving the one huge CSS of each theme.
+ *
+ * @package moodlecore
+ * @copyright 2009 Petr Skoda (skodak) {@link http://skodak.org}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+//TODO
\ No newline at end of file