Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Test for MDL-52081
include "config.php";
$PAGE->set_url(new moodle_url('/test.php'));
class test_form extends moodleform {
* Form definition
public function definition() {
$mform = $this->_form;
$mform->addElement('warning', 'insane', null, 'INSANE');
$mform->addElement('submitlink', 'sl', 'SubmitLink');
$mform->setType('sl', PARAM_RAW);
$mform->addElement('htmleditor', 'test', 'Test');
$mform->setType('test', PARAM_RAW);
$obj = new stdClass();
$obj->mainhtml = 'unknwon';
$obj->rowhtml = 'unknown';
$hubitems = array('unknown' => $obj);
$mform->addElement('listing','huburl', '', '', array('items' => $hubitems,
'showall' => get_string('showall', 'block_community'),
'hideall' => get_string('hideall', 'block_community')));
$mform->setDefault('huburl', 'unknown');
$form = new test_form();
echo $OUTPUT->header();
if ($data = $form->get_data()) {
echo "<pre>";print_r($data); echo "</pre>";
echo $OUTPUT->footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.