editor formslib element: symbolic constant EDITOR_UNLIMITED_FILES instead of hard-coded -1.

This commit is contained in:
tjhunt 2009-03-30 10:01:39 +00:00
parent 5977e635a1
commit 832e13f144
2 changed files with 4 additions and 1 deletions

View 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
*

View 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');