From e78e71fd613cea8174af5887ebd495753eadfcda Mon Sep 17 00:00:00 2001 From: dongsheng Date: Thu, 18 Jun 2009 06:52:26 +0000 Subject: [PATCH] "MDL-16698, use non-js filepicker to pick up files" --- lib/form/editor.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/form/editor.php b/lib/form/editor.php index 26718e8169..72a7e2b65a 100644 --- a/lib/form/editor.php +++ b/lib/form/editor.php @@ -161,18 +161,18 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element { } $str .= '
'; + if (empty($COURSE->context)) { + $ctx = get_context_instance(CONTEXT_SYSTEM); + } else { + $ctx = $COURSE->context; + } /// embedded image files - TODO: hide on the fly when switching editors $str .= '
'; - $editorurl = "$CFG->wwwroot/files/draftfiles.php?itemid=$draftitemid&subdirs=$subdirs&maxbytes=$maxbytes"; + $editorurl = "$CFG->wwwroot/repository/filepicker.php?action=embedded&itemid=$draftitemid&subdirs=$subdirs&maxbytes=$maxbytes&ctx_id=".$ctx->id; $str .= 'Error'; // TODO: localise, fix styles, etc. $str .= '
'; require_once($CFG->dirroot.'/repository/lib.php'); - if (empty($COURSE->context)) { - $ctx = get_context_instance(CONTEXT_SYSTEM); - } else { - $ctx = $COURSE->context; - } $client_id = uniqid(); $ret = repository_get_client($ctx, $client_id, array('image', 'video', 'media'), '*'); -- 2.39.5