]> git.mjollnir.org Git - moodle.git/commitdiff
editor formslib element: symbolic constant EDITOR_UNLIMITED_FILES instead of hard...
authortjhunt <tjhunt>
Mon, 30 Mar 2009 10:01:39 +0000 (10:01 +0000)
committertjhunt <tjhunt>
Mon, 30 Mar 2009 10:01:39 +0000 (10:01 +0000)
lib/formslib.php
mod/forum/post_form.php

index 2e5e1d724545e5dd57785009e7cc591f393cb872..8c368190b603858f7998bb67d16be979d4babfc6 100644 (file)
@@ -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
  *
index 6ac5f4aa9229f883593c4dec8ba58155b38def77..a5238a2c4d417a81c1798e3fdeb154f6c3c8f670 100644 (file)
@@ -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');