"MDL-21141, fixed a regression introduced by last commit, thanks for testing, jerome"

This commit is contained in:
Dongsheng Cai
2009-12-18 07:17:46 +00:00
parent 544bd6cd3b
commit 9f509643f0
+9 -8
View File
@@ -185,21 +185,22 @@ class page_requirements_manager {
*/
public function css($stylesheet, $fullurl = false) {
global $CFG;
if (!$fullurl) {
if (!file_exists($CFG->dirroot . '/' . strtok($stylesheet, '?'))) {
throw new coding_exception('Attempt to require a CSS file that does not exist.', $stylesheet);
}
$url = $CFG->httpswwwroot . '/' . $stylesheet;
} else {
$url = $stylesheet;
}
if (isset($this->linkedrequirements[$url])) {
// already required, ignore it
return;
} else {
if ($this->headdone) {
throw new coding_exception('Cannot require a CSS file after <head> has been printed.', $stylesheet);
}
if (!$fullurl) {
if (!file_exists($CFG->dirroot . '/' . strtok($stylesheet, '?'))) {
throw new coding_exception('Attempt to require a CSS file that does not exist.', $stylesheet);
}
$url = $CFG->httpswwwroot . '/' . $stylesheet;
} else {
$url = $stylesheet;
}
$this->linkedrequirements[$url] = new required_css($this, $url);
}
}