<?php //$Id: comment.html,v 1.13 2006/08/27 18:38:16 skodak Exp $

// TODO - THE HELP BUTTON FOR FORMATTING TO BE PLACED IN FRONT OF FORMATTING - HTML FORMAT
include_once $CFG->libdir.'/formslib.php';
class glossary_comment_form extends moodleform {
    function definition() {
        $mform    =& $this->_form;
        $comments = '';
        if(isset($this->_customdata['comment'])) {
            $comment   = $this->_customdata['comment'];
            $comments = $comment->entrycomment;
        }
        //WRONG
        $form   = $this->_customdata['form'];
        $entry   = $this->_customdata['entry'];
        $cm   = $this->_customdata['cm'];
        $action = $this->_customdata['action'];
        $mform    =& $this->_form;
        $mform->addElement('htmleditor','comment',get_string("comment", "glossary"));
        $mform->setDefault('comment',$comments);
        if (isset($comment->id)) {
            $mform->addElement('hidden','cid',$comment->id);
        }
        $mform->addElement('hidden','id',$cm->id);
        $mform->addElement('hidden','eid',$entry->id);
        $mform->addElement('hidden','action',$action);
        $mform->addElement('hidden','format',$form->format);
        $buttonarray[] = &MoodleQuickForm::createElement('submit','submit',get_string("savechanges"));
        $buttonarray[] = &MoodleQuickForm::createElement('reset','reset',get_string("revert"));
        $mform->addGroup($buttonarray,'buttonar','', array(" "), false);
    }
}
?>
