MDL-16075 adding support for embedded Glossary images

This commit is contained in:
skodak
2009-04-16 06:36:11 +00:00
parent 2f5f73d014
commit ccde17c3eb
14 changed files with 72 additions and 72 deletions
+13 -8
View File
@@ -17,12 +17,11 @@ class mod_glossary_entry_form extends moodleform {
$mform->setType('concept', PARAM_TEXT);
$mform->addRule('concept', null, 'required', null, 'client');
$mform->addElement('htmleditor', 'definition', get_string('definition', 'glossary'), array('rows'=>20));
$mform->setType('definition', PARAM_RAW);
$mform->addRule('definition', null, 'required', null, 'client');
$mform->setHelpButton('definition', array('writing', 'richtext2'), false, 'editorhelpbutton');
$mform->addElement('format');
$mform->addElement('editor', 'entry', get_string('definition', 'glossary'),
array('maxfiles' => EDITOR_UNLIMITED_FILES, 'filearea' => 'glossary_entry'));
$mform->setType('entry', PARAM_RAW);
$mform->addRule('entry', get_string('required'), 'required', null, 'client');
$mform->setHelpButton('entry', array('reading', 'writing', 'questions', 'richtext2'), false, 'editorhelpbutton');
if ($categories = $DB->get_records_menu('glossary_categories', array('glossaryid'=>$glossary->id), 'name ASC', 'id, name')){
$categories = array(0 => get_string('notcategorised', 'glossary')) + $categories;
@@ -35,8 +34,14 @@ class mod_glossary_entry_form extends moodleform {
$mform->setType('aliases', PARAM_TEXT);
$mform->setHelpButton('aliases', array('aliases2', strip_tags(get_string('aliases', 'glossary')), 'glossary'));
$mform->addElement('file', 'attachment', get_string('attachment', 'forum'));
$mform->setHelpButton('attachment', array('attachment', get_string('attachment', 'glossary'), 'glossary'));
$mform->addElement('filemanager', 'attachments', get_string('attachment', 'glossary'),
array('subdirs'=>0,
// 'maxbytes'=>$glossary->maxbytes,
// 'maxfiles'=>-1,
'filetypes'=>'*',
'returnvalue'=>'ref_id'
));
$mform->setHelpButton('attachments', array('attachment2', get_string('attachment', 'glossary'), 'glossary'));
if (!$glossary->usedynalink) {
$mform->addElement('hidden', 'usedynalink', $CFG->glossary_linkentries);