mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-19580 cleanup of require css and js filepicker code
This commit is contained in:
parent
b14e77c966
commit
ff5fe31160
14 changed files with 169 additions and 121 deletions
|
@ -15,6 +15,7 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
|
|||
|
||||
function MoodleQuickForm_editor($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
|
||||
global $CFG;
|
||||
require_once("$CFG->dirroot/repository/lib.php");
|
||||
|
||||
$options = (array)$options;
|
||||
foreach ($options as $name=>$value) {
|
||||
|
@ -29,6 +30,9 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
|
|||
$this->_options['context'] = get_context_instance(CONTEXT_SYSTEM);
|
||||
}
|
||||
parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
|
||||
|
||||
repository_head_setup();
|
||||
editors_head_setup();
|
||||
}
|
||||
|
||||
function setName($name) {
|
||||
|
@ -171,9 +175,9 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
|
|||
|
||||
require_once($CFG->dirroot.'/repository/lib.php');
|
||||
$client_id = uniqid();
|
||||
$ret = repository_get_client($ctx, $client_id, array('image', 'video', 'media'), '*');
|
||||
$repojs = repository_get_client($ctx, $client_id, array('image', 'video', 'media'), '*');
|
||||
|
||||
$str .= $ret['css'].$ret['js'];
|
||||
$str .= $repojs;
|
||||
$str .= <<<EOD
|
||||
<script type="text/javascript">
|
||||
id2clientid['$id'] = '$client_id';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue