]> git.mjollnir.org Git - moodle.git/commitdiff
*** empty log message ***
authorjamiesensei <jamiesensei>
Mon, 13 Nov 2006 09:20:42 +0000 (09:20 +0000)
committerjamiesensei <jamiesensei>
Mon, 13 Nov 2006 09:20:42 +0000 (09:20 +0000)
mod/label/mod.html [deleted file]
mod/label/mod_form.php [new file with mode: 0644]

diff --git a/mod/label/mod.html b/mod/label/mod.html
deleted file mode 100644 (file)
index e67856f..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-    if (!isset($form->content)) {
-        $form->content = '';
-    }
-?>
-
-<form name="form" method="post" action="mod.php">
-<center>
-<table cellpadding="5">
-<tr valign="top">
-    <td align="right"><p><b><?php  print_string("labeltext", "label") ?>:</b></p>
-    <font size="1">
-     <?php
-        helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
-        echo "<br />";
-        if ($usehtmleditor) {
-           helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
-        } else {
-           emoticonhelpbutton("form", "description");
-        }
-      ?>
-      <br />
-    </font>
-    </td>
-    <td>
-    <?php
-       print_textarea($usehtmleditor, 20, 60, 680, 400, "content", $form->content);
-    ?>
-    </td>
-</tr>
-<?php print_visible_setting($form); ?>
-</table>
-<!-- these hidden variables are always the same -->
-<input type="hidden" name="course"        value="<?php  p($form->course) ?>" />
-<input type="hidden" name="sesskey"       value="<?php  p($form->sesskey) ?>" />
-<input type="hidden" name="coursemodule"  value="<?php  p($form->coursemodule) ?>" />
-<input type="hidden" name="section"       value="<?php  p($form->section) ?>" />
-<input type="hidden" name="module"        value="<?php  p($form->module) ?>" />
-<input type="hidden" name="modulename"    value="<?php  p($form->modulename) ?>" />
-<input type="hidden" name="instance"      value="<?php  p($form->instance) ?>" />
-<input type="hidden" name="mode"          value="<?php  p($form->mode) ?>" />
-<input type="submit" value="<?php  print_string("savechanges") ?>" />
-</center>
-</form>
diff --git a/mod/label/mod_form.php b/mod/label/mod_form.php
new file mode 100644 (file)
index 0000000..ac4c519
--- /dev/null
@@ -0,0 +1,26 @@
+<?php // $Id$
+require_once ($CFG->libdir.'/formslib.php');
+class label_mod_form extends moodleform_mod {
+
+       function definition() {
+
+               $mform    =& $this->_form;
+               $renderer =& $mform->defaultRenderer();
+
+               $mform->addElement('htmleditor', 'content', get_string('labeltext', 'label'));
+               $mform->setType('content', PARAM_RAW);
+               $mform->addRule('content', get_string('required'), 'required', null, 'client');
+
+               $this->standard_hidden_coursemodule_elements();
+
+        $mform->addElement('modvisible', 'visible', get_string('visible'));
+
+        $buttonarray=array();
+        $buttonarray[] = &MoodleQuickForm::createElement('submit', 'submit', get_string('savechanges'));
+        $buttonarray[] = &MoodleQuickForm::createElement('submit', 'cancel', get_string('cancel'));
+        $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
+               $renderer->addStopFieldsetElements('buttonar');
+       }
+
+}
+?>
\ No newline at end of file