Permalink
Browse files

Merge branch 'w51_MDL-30659_m22_yuidebug' of git://github.com/skodak/…

…moodle into MOODLE_22_STABLE
  • Loading branch information...
2 parents 6aabb69 + 5cb418e commit ba9489ce912fb4b8fcc463aa43eefa6a5762210e Sam Hemelryk committed Dec 12, 2011
Showing with 17 additions and 9 deletions.
  1. +17 −9 lib/outputrequirementslib.php
@@ -160,7 +160,7 @@ public function __construct() {
$this->M_yui_loader->base = $this->yui3loader->base;
$this->M_yui_loader->comboBase = $this->yui3loader->comboBase;
$this->M_yui_loader->combine = $this->yui3loader->combine;
- $this->M_yui_loader->filter = ($this->yui3loader->filter == YUI_DEBUG) ? 'debug' : '';
+ $this->M_yui_loader->filter = (string)$this->yui3loader->filter;
$this->M_yui_loader->insertBefore = 'firstthemesheet';
$this->M_yui_loader->modules = array();
$this->M_yui_loader->groups = array(
@@ -267,7 +267,7 @@ protected function add_yui2_modules() {
* Initialise with the bits of JavaScript that every Moodle page should have.
*
* @param moodle_page $page
- * @param core_renderer $output
+ * @param core_renderer $renderer
*/
protected function init_requirements_data(moodle_page $page, core_renderer $renderer) {
global $CFG;
@@ -547,7 +547,7 @@ public function js_module($module) {
/**
* Returns true if the module has already been loaded.
*
- * @param string|array $modulename
+ * @param string|array $module
* @return bool True if the module has already been loaded
*/
protected function js_module_loaded($module) {
@@ -818,7 +818,7 @@ public function js_init_code($jscode, $ondomready = false, array $module = null)
* (e.g. and array) that you pass to JavaScript with {@link data_for_js()}.
*
* @param string $identifier the desired string.
- * @param string $module the language file to look in.
+ * @param string $component the language file to look in.
* @param mixed $a any extra data to add into the string (optional).
*/
public function string_for_js($identifier, $component, $a = NULL) {
@@ -918,7 +918,8 @@ protected function get_event_handler_code() {
/**
* Get the inline JavaScript code that need to appear in a particular place.
- * @return bool $ondomready
+ * @param bool $ondomready
+ * @return string
*/
protected function get_javascript_code($ondomready) {
$where = $ondomready ? 'ondomready' : 'normal';
@@ -972,10 +973,14 @@ protected function get_yui3lib_headcode() {
$code .= '<link rel="stylesheet" type="text/css" href="'.$this->yui3loader->base.'cssbase/base-min.css" />';
}
- if (debugging('', DEBUG_DEVELOPER)) {
- $code .= '<script type="text/javascript" src="'.$this->yui3loader->base.'yui/yui-debug.js"></script>';
- } else {
- $code .= '<script type="text/javascript" src="'.$this->yui3loader->base.'yui/yui-min.js"></script>';
+ $code .= '<script type="text/javascript" src="'.$this->yui3loader->base.'yui/yui-min.js"></script>';
+
+ if ($this->yui3loader->filter === YUI_RAW) {
+ $code = str_replace('-min.css', '.css', $code);
+ $code = str_replace('-min.js', '.js', $code);
+ } else if ($this->yui3loader->filter === YUI_DEBUG) {
+ $code = str_replace('-min.css', '.css', $code);
+ $code = str_replace('-min.js', '-debug.js', $code);
}
return $code;
@@ -1045,6 +1050,7 @@ protected function get_css_code() {
/**
* Adds extra modules specified after printing of page header
+ * @return string
*/
protected function get_extra_modules_code() {
if (empty($this->extramodules)) {
@@ -1059,6 +1065,8 @@ protected function get_extra_modules_code() {
* Normally, this method is called automatically by the code that prints the
* <head> tag. You should not normally need to call it in your own code.
*
+ * @param moodle_page $page
+ * @param core_renderer $renderer
* @return string the HTML code to to inside the <head> tag.
*/
public function get_head_code(moodle_page $page, core_renderer $renderer) {

0 comments on commit ba9489c

Please sign in to comment.