本文整理汇总了PHP中moodleform::display方法的典型用法代码示例。如果您正苦于以下问题:PHP moodleform::display方法的具体用法?PHP moodleform::display怎么用?PHP moodleform::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moodleform
的用法示例。
在下文中一共展示了moodleform::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_stepsdefinitions
/**
* Renders the list of available steps according to the submitted filters
*
* @param string $stepsdefinitions HTML from behat with the available steps
* @param moodleform $form
* @return string HTML code
*/
public function render_stepsdefinitions($stepsdefinitions, $form)
{
$title = get_string('pluginname', 'tool_behat');
// Header.
$html = $this->output->header();
$html .= $this->output->heading($title);
// Info.
$installurl = behat_command::DOCS_URL . '#Installation';
$installlink = html_writer::tag('a', $installurl, array('href' => $installurl, 'target' => '_blank'));
$writetestsurl = behat_command::DOCS_URL . '#Writting_features';
$writetestslink = html_writer::tag('a', $writetestsurl, array('href' => $writetestsurl, 'target' => '_blank'));
$writestepsurl = behat_command::DOCS_URL . '#Adding_steps_definitions';
$writestepslink = html_writer::tag('a', $writestepsurl, array('href' => $writestepsurl, 'target' => '_blank'));
$infos = array(get_string('installinfo', 'tool_behat', $installlink), get_string('newtestsinfo', 'tool_behat', $writetestslink), get_string('newstepsinfo', 'tool_behat', $writestepslink));
// List of steps
$html .= $this->output->box_start();
$html .= html_writer::tag('h1', 'Info');
$html .= html_writer::empty_tag('div');
$html .= html_writer::empty_tag('ul');
$html .= html_writer::empty_tag('li');
$html .= implode(html_writer::end_tag('li') . html_writer::empty_tag('li'), $infos);
$html .= html_writer::end_tag('li');
$html .= html_writer::end_tag('ul');
$html .= html_writer::end_tag('div');
$html .= $this->output->box_end();
// Form.
ob_start();
$form->display();
$html .= ob_get_contents();
ob_end_clean();
// Steps definitions.
$html .= html_writer::tag('div', $stepsdefinitions, array('class' => 'steps-definitions'));
$html .= $this->output->footer();
return $html;
}
示例2: moodleform
/**
* Use this since we can't fetch the output of a moodle form
* @param moodleform $mform
* @return type string HTML
*/
protected function moodleform(moodleform $mform)
{
ob_start();
$mform->display();
$o = ob_get_contents();
ob_end_clean();
return $o;
}
示例3: capability_form
/**
* Render a formslib form.
* @param moodleform $form
* @return string the HTML to output.
*/
protected function capability_form(moodleform $form)
{
ob_start();
$form->display();
$output = ob_get_contents();
ob_end_clean();
return $output;
}
示例4: render_stepsdefinitions
/**
* Renders the list of available steps according to the submitted filters.
*
* @param mixed $stepsdefinitions Available steps array.
* @param moodleform $form
* @return string HTML code
*/
public function render_stepsdefinitions($stepsdefinitions, $form)
{
$title = get_string('pluginname', 'tool_behat');
// Header.
$html = $this->output->header();
$html .= $this->output->heading($title);
// Info.
$installurl = behat_command::DOCS_URL . '#Installation';
$installlink = html_writer::tag('a', $installurl, array('href' => $installurl, 'target' => '_blank'));
$writetestsurl = behat_command::DOCS_URL . '#Writting_features';
$writetestslink = html_writer::tag('a', $writetestsurl, array('href' => $writetestsurl, 'target' => '_blank'));
$writestepsurl = behat_command::DOCS_URL . '#Adding_steps_definitions';
$writestepslink = html_writer::tag('a', $writestepsurl, array('href' => $writestepsurl, 'target' => '_blank'));
$infos = array(get_string('installinfo', 'tool_behat', $installlink), get_string('newtestsinfo', 'tool_behat', $writetestslink), get_string('newstepsinfo', 'tool_behat', $writestepslink));
// List of steps.
$html .= $this->output->box_start();
$html .= html_writer::tag('h1', get_string('infoheading', 'tool_behat'));
$html .= html_writer::tag('div', get_string('aim', 'tool_behat'));
$html .= html_writer::start_tag('div');
$html .= html_writer::start_tag('ul');
$html .= html_writer::start_tag('li');
$html .= implode(html_writer::end_tag('li') . html_writer::start_tag('li'), $infos);
$html .= html_writer::end_tag('li');
$html .= html_writer::end_tag('ul');
$html .= html_writer::end_tag('div');
$html .= $this->output->box_end();
// Form.
ob_start();
$form->display();
$html .= ob_get_contents();
ob_end_clean();
if (empty($stepsdefinitions)) {
$stepsdefinitions = get_string('nostepsdefinitions', 'tool_behat');
} else {
$stepsdefinitions = implode('', $stepsdefinitions);
// Replace text selector type arguments with a user-friendly select.
$stepsdefinitions = preg_replace_callback('/(TEXT_SELECTOR\\d?_STRING)/', function ($matches) {
return html_writer::select(behat_selectors::get_allowed_text_selectors(), uniqid());
}, $stepsdefinitions);
// Replace selector type arguments with a user-friendly select.
$stepsdefinitions = preg_replace_callback('/(SELECTOR\\d?_STRING)/', function ($matches) {
return html_writer::select(behat_selectors::get_allowed_selectors(), uniqid());
}, $stepsdefinitions);
// Replace simple OR options.
$regex = '#\\(\\?P<[^>]+>([^\\)|]+\\|[^\\)]+)\\)#';
$stepsdefinitions = preg_replace_callback($regex, function ($matches) {
return html_writer::select(explode('|', $matches[1]), uniqid());
}, $stepsdefinitions);
}
// Steps definitions.
$html .= html_writer::tag('div', $stepsdefinitions, array('class' => 'steps-definitions'));
$html .= $this->output->footer();
return $html;
}
示例5: display
/**
* Intercept the display of form so can format errors as notifications
*
* @global type $OUTPUT
*/
public function display()
{
global $OUTPUT;
if ($this->_form->_errors) {
foreach ($this->_form->_errors as $error) {
echo $OUTPUT->notification($error, 'notifyproblem');
}
unset($this->_form->_errors);
}
parent::display();
}
示例6: render_stepsdefinitions
/**
* Renders the list of available steps according to the submitted filters.
*
* @param mixed $stepsdefinitions Available steps array.
* @param moodleform $form
* @return string HTML code
*/
public function render_stepsdefinitions($stepsdefinitions, $form) {
$html = $this->generic_info();
// Form.
ob_start();
$form->display();
$html .= ob_get_contents();
ob_end_clean();
if (empty($stepsdefinitions)) {
$stepsdefinitions = get_string('nostepsdefinitions', 'tool_behat');
} else {
$stepsdefinitions = implode('', $stepsdefinitions);
// Replace text selector type arguments with a user-friendly select.
$stepsdefinitions = preg_replace_callback('/(TEXT_SELECTOR\d?_STRING)/',
function ($matches) {
return html_writer::select(behat_selectors::get_allowed_text_selectors(), uniqid());
},
$stepsdefinitions
);
// Replace selector type arguments with a user-friendly select.
$stepsdefinitions = preg_replace_callback('/(SELECTOR\d?_STRING)/',
function ($matches) {
return html_writer::select(behat_selectors::get_allowed_selectors(), uniqid());
},
$stepsdefinitions
);
// Replace simple OR options.
$regex = '#\(\?P<[^>]+>([^\)|]+\|[^\)]+)\)#';
$stepsdefinitions = preg_replace_callback($regex,
function($matches){
return html_writer::select(explode('|', $matches[1]), uniqid());
},
$stepsdefinitions
);
}
// Steps definitions.
$html .= html_writer::tag('div', $stepsdefinitions, array('class' => 'steps-definitions'));
$html .= $this->output->footer();
return $html;
}
示例7: organizer_display_form
function organizer_display_form(moodleform $mform, $title, $addcalendar = true)
{
global $OUTPUT;
if ($addcalendar) {
organizer_add_calendar();
}
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
echo $OUTPUT->box_start('', 'organizer_main_cointainer');
$mform->display();
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
die;
}
示例8: render_stepsdefinitions
/**
* Renders the list of available steps according to the submitted filters.
*
* @param mixed $stepsdefinitions Available steps array.
* @param moodleform $form
* @return string HTML code
*/
public function render_stepsdefinitions($stepsdefinitions, $form)
{
$html = $this->generic_info();
// Form.
ob_start();
$form->display();
$html .= ob_get_contents();
ob_end_clean();
if (empty($stepsdefinitions)) {
$stepsdefinitions = get_string('nostepsdefinitions', 'tool_behat');
} else {
$stepsdefinitions = implode('', $stepsdefinitions);
// Replace text selector type arguments with a user-friendly select.
$stepsdefinitions = preg_replace_callback('/(TEXT_SELECTOR\\d?_STRING)/', function ($matches) {
return html_writer::select(behat_selectors::get_allowed_text_selectors(), uniqid());
}, $stepsdefinitions);
// Replace selector type arguments with a user-friendly select.
$stepsdefinitions = preg_replace_callback('/(SELECTOR\\d?_STRING)/', function ($matches) {
return html_writer::select(behat_selectors::get_allowed_selectors(), uniqid());
}, $stepsdefinitions);
// Replace simple OR options.
$regex = '#\\(\\?P<[^>]+>([^\\)|]+\\|[^\\)]+)\\)#';
$stepsdefinitions = preg_replace_callback($regex, function ($matches) {
return html_writer::select(explode('|', $matches[1]), uniqid());
}, $stepsdefinitions);
$stepsdefinitions = preg_replace_callback('/(FIELD_VALUE_STRING)/', function ($matches) {
global $CFG;
// Creating a link to a popup with the help.
$url = new moodle_url('/help.php', array('component' => 'tool_behat', 'identifier' => 'fieldvalueargument', 'lang' => current_language()));
// Note: this title is displayed only if JS is disabled,
// otherwise the link will have the new ajax tooltip.
$title = get_string('fieldvalueargument', 'tool_behat');
$title = get_string('helpprefix2', '', trim($title, ". \t"));
$attributes = array('href' => $url, 'title' => $title, 'aria-haspopup' => 'true', 'target' => '_blank');
$output = html_writer::tag('a', 'FIELD_VALUE_STRING', $attributes);
return html_writer::tag('span', $output, array('class' => 'helptooltip'));
}, $stepsdefinitions);
}
// Steps definitions.
$html .= html_writer::tag('div', $stepsdefinitions, array('class' => 'steps-definitions'));
$html .= $this->output->footer();
return $html;
}
示例9: display
function display()
{
parent::display();
form_init_date_js();
}
示例10: display
/**
* Displays the form
*/
public function display()
{
global $PAGE, $COURSE;
$this->require_definition_after_data();
$config = new stdClass();
$config->title = get_string('confirmcancel', 'backup');
$config->question = get_string('confirmcancelquestion', 'backup');
$config->yesLabel = get_string('confirmcancelyes', 'backup');
$config->noLabel = get_string('confirmcancelno', 'backup');
$config->closeButtonTitle = get_string('close', 'editor');
$PAGE->requires->yui_module('moodle-backup-confirmcancel', 'M.core_backup.confirmcancel.watch_cancel_buttons', array($config));
// Get list of module types on course.
$modinfo = get_fast_modinfo($COURSE);
$modnames = $modinfo->get_used_module_names(true);
$PAGE->requires->yui_module('moodle-backup-backupselectall', 'M.core_backup.backupselectall', array($modnames));
$PAGE->requires->strings_for_js(array('select', 'all', 'none'), 'moodle');
$PAGE->requires->strings_for_js(array('showtypes', 'hidetypes'), 'backup');
parent::display();
}
示例11: display
function display()
{
parent::display();
echo "<script>\n\t function showFullForm(form) {\n\t var e = document.getElementById('id_period');\n if(!e) {\n return;\n }\n var period = e.options[e.selectedIndex].value;\n // Custom period shows dates\n\t if (period == 50) {\n document.getElementById('fitem_id_startdate').style.display = 'block';\n document.getElementById('fitem_id_enddate').style.display = 'block';\n document.getElementById('fitem_id_submitbutton').style.display = 'block';\t \n } else {\n document.getElementById('fitem_id_startdate').style.display = 'none';\n document.getElementById('fitem_id_enddate').style.display = 'none';\n document.getElementById('fitem_id_submitbutton').style.display = 'none';\t \n\t if(period > 0)\n\t form.submit();\n }\t\n\t }\n showFullForm();\n\t </script>";
}
示例12: display
/**
* Displays the form
*/
public function display()
{
global $PAGE;
$this->require_definition_after_data();
$config = new stdClass();
$config->title = get_string('confirmcancel', 'backup');
$config->question = get_string('confirmcancelquestion', 'backup');
$config->yesLabel = get_string('confirmcancelyes', 'backup');
$config->noLabel = get_string('confirmcancelno', 'backup');
$PAGE->requires->yui_module('moodle-backup-confirmcancel', 'M.core_backup.watch_cancel_buttons', array($config));
parent::display();
}
示例13: display
/**
* Displays the form
*/
public function display()
{
$this->require_definition_after_data();
parent::display();
}
示例14: editrender_addquestionform
/**
* renders the add question form
*
* @param moodleform $mform
*/
public function editrender_addquestionform($mform)
{
echo $mform->display();
}
示例15: display
/**
* Display the form, saving the contents of the output buffer overiding Moodle's
* display function that prints to screen when called
*
* @return the form as an object to print to screen at our convenience
*/
public function display()
{
ob_start();
parent::display();
$form = ob_get_contents();
ob_end_clean();
return $form;
}