Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

"MDL-21141, fixed yui connection file and let requires->css ignore ex…

…isting css files"
  • Loading branch information...
commit 70f83b5803a7dddc3cfe2bafba02bf63cdd695f5 1 parent 1fc216f
@dcai dcai authored
Showing with 16 additions and 12 deletions.
  1. +16 −12 lib/ajax/ajaxlib.php
View
28 lib/ajax/ajaxlib.php
@@ -186,18 +186,20 @@ public function yui2_lib($libname) {
public function css($stylesheet, $fullurl = false) {
global $CFG;
- 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;
+ if (isset($this->linkedrequirements[$url])) {
+ return;
} else {
- $url = $stylesheet;
- }
- if (!isset($this->linkedrequirements[$url])) {
+ 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);
}
}
@@ -1239,8 +1241,10 @@ function ajax_resolve_yui2_lib($libname) {
$jsurls[] = $libpath . '/'. $js . '/' . $js . '.js';
}
} else if ($js == 'connection') {
+ // connection.js provides full features of HTTP transaction
$jsurls[] = $libpath . '/' . $js . '/' . $js . $suffix;
- $jsurls[] = $libpath . '/' . $js . '/' . $js . '_core' . $suffix;
+ // connnection_core.js prvides base HTTP transaction support
+ //$jsurls[] = $libpath . '/' . $js . '/' . $js . '_core' . $suffix;
} else {
$jsurls[] = $libpath . '/' . $js . '/' . $js . $suffix;
}
Please sign in to comment.
Something went wrong with that request. Please try again.