Created
November 10, 2015 03:45
-
-
Save marinaglancy/8c9071a5cbd7bd198b4f to your computer and use it in GitHub Desktop.
Test for MDL-52081
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "config.php"; | |
require_once($CFG->libdir.'/formslib.php'); | |
$PAGE->set_url(new moodle_url('/test.php')); | |
$PAGE->set_context(context_system::instance()); | |
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'); | |
$this->add_action_buttons(); | |
} | |
} | |
$form = new test_form(); | |
echo $OUTPUT->header(); | |
if ($data = $form->get_data()) { | |
echo "<pre>";print_r($data); echo "</pre>"; | |
} | |
$form->display(); | |
echo $OUTPUT->footer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment