From 832e13f144662c104e2324caceb98cc68620374c Mon Sep 17 00:00:00 2001 From: tjhunt Date: Mon, 30 Mar 2009 10:01:39 +0000 Subject: [PATCH] editor formslib element: symbolic constant EDITOR_UNLIMITED_FILES instead of hard-coded -1. --- lib/formslib.php | 2 ++ mod/forum/post_form.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/formslib.php b/lib/formslib.php index 2e5e1d7245..8c368190b6 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -28,6 +28,8 @@ require_once 'HTML/QuickForm/Renderer/Tableless.php'; require_once $CFG->libdir.'/filelib.php'; require_once $CFG->libdir.'/uploadlib.php'; // TODO: remove +define('EDITOR_UNLIMITED_FILES', -1); + /** * Callback called when PEAR throws an error * diff --git a/mod/forum/post_form.php b/mod/forum/post_form.php index 6ac5f4aa92..a5238a2c4d 100644 --- a/mod/forum/post_form.php +++ b/mod/forum/post_form.php @@ -23,7 +23,8 @@ class mod_forum_post_form extends moodleform { $mform->addRule('subject', get_string('required'), 'required', null, 'client'); $mform->addRule('subject', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); - $mform->addElement('editor', 'message', get_string('message', 'forum'), array('maxfiles'=>-1, 'filearea'=>'forum_post')); + $mform->addElement('editor', 'message', get_string('message', 'forum'), + array('maxfiles' => EDITOR_UNLIMITED_FILES, 'filearea' => 'forum_post')); $mform->setType('message', PARAM_RAW); $mform->addRule('message', get_string('required'), 'required', null, 'client'); $mform->setHelpButton('message', array('reading', 'writing', 'questions', 'richtext2'), false, 'editorhelpbutton'); -- 2.39.5