Permalink
Browse files

Merge branch 'w41_MDL-28454_m21_yuibackport' of git://github.com/skod…

…ak/moodle into MOODLE_21_STABLE
  • Loading branch information...
2 parents a258bda + a6bb036 commit 7edd6c250ddd79ed05da00a5f6fa072c9e729e9f @stronk7 stronk7 committed Oct 17, 2011
Showing 2,886 changed files with 654,272 additions and 540,099 deletions.
@@ -105,7 +105,7 @@ class page_requirements_manager {
protected $yui2loader;
/** YUI PHPLoader instance responsible for YUI3 loading from PHP only */
protected $yui3loader;
- /** YUI PHPLoader instance responsible for YUI3 loading from javascript */
+ /** YUI loader information for YUI3 loading from javascript */
protected $M_yui_loader;
/** some config vars exposed in JS, please no secret stuff there */
protected $M_cfg;
@@ -120,7 +120,7 @@ public function __construct() {
require_once("$CFG->libdir/yui/phploader/phploader/loader.php");
- $this->yui3loader = new YAHOO_util_Loader($CFG->yui3version);
+ $this->yui3loader = new stdClass();
$this->yui2loader = new YAHOO_util_Loader($CFG->yui2version);
// set up some loader options
@@ -201,11 +201,6 @@ public function __construct() {
$this->js_module($this->find_module('core_filepicker'));
$this->js_module($this->find_module('core_dock'));
- // YUI3 init code
- $libs = array('cssreset', 'cssbase', 'cssfonts', 'cssgrids', 'node', 'loader'); // full CSS reset + basic libs
- foreach ($libs as $lib) {
- $this->yui3loader->load($lib);
- }
}
/**
@@ -965,10 +960,29 @@ protected function get_javascript_init_code() {
* @return string
*/
protected function get_yui3lib_headcode() {
- $code = $this->yui3loader->tags();
- // unfortunately yui loader does not produce xhtml strict code, so let's fix it for now
- $code = str_replace('&', '&', $code);
- $code = str_replace('&', '&', $code);
+ global $CFG;
+
+ $code = '';
+
+ if ($this->yui3loader->combine) {
+ $code .= '<link rel="stylesheet" type="text/css" href="'.$this->yui3loader->comboBase
+ .$CFG->yui3version.'/build/cssreset/reset-min.css&amp;'
+ .$CFG->yui3version.'/build/cssfonts/fonts-min.css&amp;'
+ .$CFG->yui3version.'/build/cssgrids/grids-min.css&amp;'
+ .$CFG->yui3version.'/build/cssbase/base-min.css" />';
+ } else {
+ $code .= '<link rel="stylesheet" type="text/css" href="'.$this->yui3loader->base.'cssreset/reset-min.css" />';
+ $code .= '<link rel="stylesheet" type="text/css" href="'.$this->yui3loader->base.'cssfonts/fonts-min.css" />';
+ $code .= '<link rel="stylesheet" type="text/css" href="'.$this->yui3loader->base.'cssgrids/grids-min.css" />';
+ $code .= '<link rel="stylesheet" type="text/css" href="'.$this->yui3loader->base.'cssbase/base-min.css" />';
+ }
+
+ if (debugging('', DEBUG_DEVELOPER)) {
+ $code .= '<script src="'.$this->yui3loader->base.'yui/yui-debug.js"></script>';
+ } else {
+ $code .= '<script src="'.$this->yui3loader->base.'yui/yui-min.js"></script>';
+ }
+
return $code;
}
View
@@ -210,8 +210,8 @@
umask(0000);
// exact version of currently used yui2 and 3 library
-$CFG->yui2version = '2.8.2';
-$CFG->yui3version = '3.2.0';
+$CFG->yui2version = '2.9.0';
+$CFG->yui3version = '3.4.1';
// special support for highly optimised scripts that do not need libraries and DB connection
View
@@ -228,7 +228,7 @@
<location>yui</location>
<name>YUI</name>
<license>BSD</license>
- <version>3.3.2</version>
+ <version>3.4.1</version>
<licenseversion></licenseversion>
</library>
<library>
Oops, something went wrong.

0 comments on commit 7edd6c2

Please sign in to comment.