mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-21404 RIP $PAGE->requires->*()->now()
This commit is contained in:
parent
88515081c8
commit
7d7a7e908f
@ -1063,25 +1063,6 @@ class required_js extends linked_requirement {
|
||||
return html_writer::script('', $this->url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the required JavaScript immediately, so it can be included in some
|
||||
* HTML that is being built.
|
||||
*
|
||||
* This is not really recommeneded. But is necessary in some legacy code that
|
||||
* includes a .js files that does document.write.
|
||||
*
|
||||
* @return string The HTML for the script tag. The caller
|
||||
* is responsible for making sure it is output.
|
||||
*/
|
||||
public function now() {
|
||||
if ($this->is_done()) {
|
||||
return '';
|
||||
}
|
||||
$output = $this->get_html();
|
||||
$this->mark_done();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the link to this JavaScript file should be output in the
|
||||
* <head> section of the HTML. If it too late for this request to be
|
||||
@ -1122,21 +1103,6 @@ abstract class required_js_code extends requirement_base {
|
||||
*/
|
||||
abstract public function get_js_code();
|
||||
|
||||
/**
|
||||
* Return the required JavaScript immediately, so it can be included in some
|
||||
* HTML that is being built.
|
||||
* @return string The HTML for the script tag. The caller
|
||||
* is responsible for making sure it is output.
|
||||
*/
|
||||
public function now() {
|
||||
if ($this->is_done()) {
|
||||
return '';
|
||||
}
|
||||
$output = html_writer::script($this->get_js_code());
|
||||
$this->mark_done();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the link to this JavaScript file should be output in the
|
||||
* <head> section of the HTML. If it too late for this request to be
|
||||
|
Loading…
x
Reference in New Issue
Block a user