Merge branch 'MDL-59380-master' of git://github.com/damyon/moodle

This commit is contained in:
Jake Dallimore 2017-07-04 16:27:30 +08:00
commit 542933e30a
2 changed files with 7 additions and 7 deletions

View File

@ -34,16 +34,16 @@ namespace core\output;
*/ */
class mustache_javascript_helper { class mustache_javascript_helper {
/** @var page_requirements_manager $requires - Page requirements manager for collecting JS calls. */ /** @var moodle_page $page - Page used to get requirement manager */
private $requires = null; private $page = null;
/** /**
* Create new instance of mustache javascript helper. * Create new instance of mustache javascript helper.
* *
* @param page_requirements_manager $requires Page requirements manager. * @param moodle_page $page Page.
*/ */
public function __construct($requires) { public function __construct($page) {
$this->requires = $requires; $this->page = $page;
} }
/** /**
@ -54,6 +54,6 @@ class mustache_javascript_helper {
* @param \Mustache_LambdaHelper $helper Used to render the content of this block. * @param \Mustache_LambdaHelper $helper Used to render the content of this block.
*/ */
public function help($text, \Mustache_LambdaHelper $helper) { public function help($text, \Mustache_LambdaHelper $helper) {
$this->requires->js_amd_inline($helper->render($text)); $this->page->requires->js_amd_inline($helper->render($text));
} }
} }

View File

@ -89,7 +89,7 @@ class renderer_base {
$loader = new \core\output\mustache_filesystem_loader(); $loader = new \core\output\mustache_filesystem_loader();
$stringhelper = new \core\output\mustache_string_helper(); $stringhelper = new \core\output\mustache_string_helper();
$quotehelper = new \core\output\mustache_quote_helper(); $quotehelper = new \core\output\mustache_quote_helper();
$jshelper = new \core\output\mustache_javascript_helper($this->page->requires); $jshelper = new \core\output\mustache_javascript_helper($this->page);
$pixhelper = new \core\output\mustache_pix_helper($this); $pixhelper = new \core\output\mustache_pix_helper($this);
$shortentexthelper = new \core\output\mustache_shorten_text_helper(); $shortentexthelper = new \core\output\mustache_shorten_text_helper();
$userdatehelper = new \core\output\mustache_user_date_helper(); $userdatehelper = new \core\output\mustache_user_date_helper();