Skip to content

Commit

Permalink
Merge branch 'wip-MDL-33446-master' of git://github.com/marinaglancy/…
Browse files Browse the repository at this point in the history
…moodle
  • Loading branch information
danpoltawski committed Jun 12, 2012
2 parents 502be9a + c469b39 commit 760c063
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions lib/form/editor.php
Expand Up @@ -52,7 +52,8 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {

/** @var array options provided to initalize filepicker */
protected $_options = array('subdirs'=>0, 'maxbytes'=>0, 'maxfiles'=>0, 'changeformat'=>0,
'context'=>null, 'noclean'=>0, 'trusttext'=>0);
'context'=>null, 'noclean'=>0, 'trusttext'=>0, 'return_types'=>7);
// $_options['return_types'] = FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE

/** @var array values for editor */
protected $_values = array('text'=>null, 'format'=>null, 'itemid'=>null);
Expand Down Expand Up @@ -303,7 +304,7 @@ function toHtml() {
$args = new stdClass();
// need these three to filter repositories list
$args->accepted_types = array('web_image');
$args->return_types = (FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE);
$args->return_types = $this->_options['return_types'];
$args->context = $ctx;
$args->env = 'filepicker';
// advimage plugin
Expand Down
3 changes: 2 additions & 1 deletion mod/assign/submission/onlinetext/locallib.php
Expand Up @@ -106,7 +106,8 @@ private function get_edit_options() {
'noclean' => false,
'maxfiles' => EDITOR_UNLIMITED_FILES,
'maxbytes' => $this->assignment->get_course()->maxbytes,
'context' => $this->assignment->get_context()
'context' => $this->assignment->get_context(),
'return_types' => FILE_INTERNAL | FILE_EXTERNAL
);
return $editoroptions;
}
Expand Down
3 changes: 2 additions & 1 deletion mod/assignment/type/online/assignment.class.php
Expand Up @@ -42,7 +42,8 @@ function view() {
'noclean' => false,
'maxfiles' => EDITOR_UNLIMITED_FILES,
'maxbytes' => $this->course->maxbytes,
'context' => $this->context
'context' => $this->context,
'return_types' => FILE_INTERNAL | FILE_EXTERNAL
);

$data = new stdClass();
Expand Down
3 changes: 2 additions & 1 deletion mod/forum/post_form.php
Expand Up @@ -45,7 +45,8 @@ function definition() {
$forum->maxbytes = $course->maxbytes;
}
// TODO: add max files and max size support
$editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'trusttext'=>true, 'context'=>$modcontext);
$editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'trusttext'=>true,
'context'=>$modcontext, 'return_types'=>FILE_INTERNAL | FILE_EXTERNAL);

$mform->addElement('header', 'general', '');//fill in the data depending on page params later using set_data
$mform->addElement('text', 'subject', get_string('subject', 'forum'), 'size="48"');
Expand Down
3 changes: 0 additions & 3 deletions mod/resource/mod_form.php
Expand Up @@ -61,9 +61,6 @@ function definition() {
$mform->addElement('header', 'contentsection', get_string('contentheader', 'resource'));

$filemanager_options = array();
// 3 == FILE_EXTERNAL | FILE_INTERNAL | FILE_REFERENCE
// These two constant names are defined in repository/lib.php
$filemanager_options['return_types'] = 7;
$filemanager_options['accepted_types'] = '*';
$filemanager_options['maxbytes'] = 0;
$filemanager_options['maxfiles'] = -1;
Expand Down
3 changes: 2 additions & 1 deletion mod/workshop/submission.php
Expand Up @@ -144,7 +144,8 @@
'subdirs' => false,
'maxfiles' => $maxfiles,
'maxbytes' => $maxbytes,
'context' => $workshop->context
'context' => $workshop->context,
'return_types' => FILE_INTERNAL | FILE_EXTERNAL
);

$attachmentopts = array('subdirs' => true, 'maxfiles' => $maxfiles, 'maxbytes' => $maxbytes, 'return_types' => FILE_INTERNAL);
Expand Down
3 changes: 2 additions & 1 deletion question/type/essay/renderer.php
Expand Up @@ -109,6 +109,7 @@ public function files_input(question_attempt $qa, $numallowed,
$pickeroptions->itemid = $qa->prepare_response_files_draft_itemid(
'attachments', $options->context->id);
$pickeroptions->context = $options->context;
$pickeroptions->return_types = FILE_INTERNAL;

$pickeroptions->itemid = $qa->prepare_response_files_draft_itemid(
'attachments', $options->context->id);
Expand Down Expand Up @@ -280,7 +281,7 @@ protected function get_editor_options($context) {
* @return array filepicker options for the editor.
*/
protected function get_filepicker_options($context, $draftitemid) {
return array();
return array('return_types' => FILE_INTERNAL | FILE_EXTERNAL);
}

/**
Expand Down

0 comments on commit 760c063

Please sign in to comment.