Skip to content

Commit

Permalink
MDL-21189 yui2/3 combo loader implemented - yay! admin settings in th…
Browse files Browse the repository at this point in the history
…e next commit; yui libs stored in more standard locations
  • Loading branch information
skodak committed Dec 25, 2009
1 parent 60f2c86 commit aa42314
Show file tree
Hide file tree
Showing 842 changed files with 137 additions and 12 deletions.
12 changes: 8 additions & 4 deletions lib/ajax/ajaxlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,17 @@ public function __construct() {
$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);
}

/**
Expand Down
15 changes: 13 additions & 2 deletions lib/configonlylib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -59,5 +71,4 @@ function min_optional_param($name, $default, $type) {
}

return $value;
}

}
7 changes: 3 additions & 4 deletions lib/outputlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ public function css_content() {

// 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;
Expand All @@ -627,14 +627,13 @@ public function css_content() {
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;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit aa42314

Please sign in to comment.