MDL-21189 yui2/3 combo loader implemented - yay! admin settings in the next commit; yui libs stored in more standard locations
@ -137,13 +137,17 @@ class page_requirements_manager {
|
||||
$this->yui3loader->base = 'http://yui.yahooapis.com/' . $CFG->yui3version . '/build/';
|
||||
$this->yui2loader->base = 'http://yui.yahooapis.com/' . $CFG->yui2version . '/build/';
|
||||
} else {
|
||||
$this->yui3loader->base = $CFG->httpswwwroot . '/lib/yui/'. $CFG->yui3version . '/';
|
||||
$this->yui2loader->base = $CFG->httpswwwroot . '/lib/yui/'. $CFG->yui2version . '/';
|
||||
$this->yui3loader->base = $CFG->httpswwwroot . '/lib/yui/'. $CFG->yui3version . '/build/';
|
||||
$this->yui2loader->base = $CFG->httpswwwroot . '/lib/yui/'. $CFG->yui2version . '/build/';
|
||||
}
|
||||
|
||||
// This file helps to minimise number of http requests and implements proper caching
|
||||
//$this->yui3loader->comboBase = $CFG->httpswwwroot . '/theme/yui_combo.php?file=';
|
||||
//$this->yui2loader->comboBase = $CFG->httpswwwroot . '/theme/yui_combo.php?file=';
|
||||
$this->yui3loader->comboBase = $CFG->httpswwwroot . '/theme/yui_combo.php?';
|
||||
$this->yui2loader->comboBase = $CFG->httpswwwroot . '/theme/yui_combo.php?';
|
||||
|
||||
// enable combo loader? this significantly helps with caching and performance
|
||||
$this->yui3loader->combine = !empty($CFG->yuicomboloading);
|
||||
$this->yui2loader->combine = !empty($CFG->yuicomboloading);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,6 +45,18 @@ function min_optional_param($name, $default, $type) {
|
||||
$value = $_GET['amp;'.$name];
|
||||
}
|
||||
|
||||
return min_clean_param($value, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimalistic parameter cleaning function.
|
||||
* Can not use optional param because moodlelib.php is not loaded yet
|
||||
* @param string $name
|
||||
* @param mixed $default
|
||||
* @param string $type
|
||||
* @return mixed
|
||||
*/
|
||||
function min_clean_param($value, $type) {
|
||||
switch($type) {
|
||||
case 'RAW': break;
|
||||
case 'INT': $value = (int)$value;
|
||||
@ -59,5 +71,4 @@ function min_optional_param($name, $default, $type) {
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
}
|
@ -618,7 +618,7 @@ class theme_config {
|
||||
|
||||
// legacy YUI2 stylesheets, YUI3 stylesheets are loaded on the fly
|
||||
$yui2_sheets = "\n\n/*** Standard YUI2 sheets ***/\n\n";
|
||||
$items = new DirectoryIterator("$CFG->libdir/yui/$CFG->yui2version/assets/skins/sam");
|
||||
$items = new DirectoryIterator("$CFG->libdir/yui/$CFG->yui2version/build/assets/skins/sam");
|
||||
foreach ($items as $item) {
|
||||
if ($item->isDot() or !$item->isFile()) {
|
||||
continue;
|
||||
@ -627,14 +627,13 @@ class theme_config {
|
||||
if (substr($filename, -4) !== '.css') {
|
||||
continue;
|
||||
}
|
||||
$yui2_sheets .= file_get_contents("$CFG->libdir/yui/$CFG->yui2version/assets/skins/sam/$filename");
|
||||
$yui2_sheets .= file_get_contents("$CFG->libdir/yui/$CFG->yui2version/build/assets/skins/sam/$filename");
|
||||
}
|
||||
unset($item);
|
||||
unset($items);
|
||||
|
||||
// search for all images in yui2 CSS and serve them through the yui_image.php script
|
||||
$yui2_sheets = preg_replace('/([a-z-]+)\.(png|gif)/', 'yui_image.php?file='.$CFG->yui2version.'/$1.$2', $yui2_sheets);
|
||||
$css['yui2'][] = $this->post_process($yui2_sheets);
|
||||
$css['yui2'][] = preg_replace('/([a-z-]+)\.(png|gif)/', 'yui_image.php?file='.$CFG->yui2version.'/$1.$2', $yui2_sheets);
|
||||
|
||||
// get all plugin sheets
|
||||
$excludes = null;
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 177 B |
Before Width: | Height: | Size: 334 B After Width: | Height: | Size: 334 B |
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 338 B |
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 365 B |
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
Before Width: | Height: | Size: 481 B After Width: | Height: | Size: 481 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 622 B After Width: | Height: | Size: 622 B |
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 609 B |
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 177 B |
Before Width: | Height: | Size: 116 B After Width: | Height: | Size: 116 B |
Before Width: | Height: | Size: 116 B After Width: | Height: | Size: 116 B |
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 280 B After Width: | Height: | Size: 280 B |
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 280 B After Width: | Height: | Size: 280 B |
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 497 B |
Before Width: | Height: | Size: 93 B After Width: | Height: | Size: 93 B |
Before Width: | Height: | Size: 94 B After Width: | Height: | Size: 94 B |
Before Width: | Height: | Size: 88 B After Width: | Height: | Size: 88 B |