本文整理汇总了PHP中moodleform::render方法的典型用法代码示例。如果您正苦于以下问题:PHP moodleform::render方法的具体用法?PHP moodleform::render怎么用?PHP moodleform::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moodleform
的用法示例。
在下文中一共展示了moodleform::render方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_course_enrolment_users_table
public function render_course_enrolment_users_table(course_enrolment_users_table $table, moodleform $mform)
{
$table->initialise_javascript();
// Added for the Bootstrap theme. Make this table responsive.
$table->attributes['class'] .= ' table table-responsive';
$buttons = $table->get_manual_enrol_buttons();
$buttonhtml = '';
if (count($buttons) > 0) {
$buttonhtml .= html_writer::start_tag('div', array('class' => 'enrol_user_buttons'));
foreach ($buttons as $button) {
$buttonhtml .= $this->render($button);
}
$buttonhtml .= html_writer::end_tag('div');
}
$content = '';
if (!empty($buttonhtml)) {
$content .= $buttonhtml;
}
$content .= $mform->render();
$content .= $this->output->render($table->get_paging_bar());
// Check if the table has any bulk operations. If it does we want to wrap the table in a
// form so that we can capture and perform any required bulk operations.
if ($table->has_bulk_user_enrolment_operations()) {
$content .= html_writer::start_tag('form', array('action' => new moodle_url('/enrol/bulkchange.php'), 'method' => 'post'));
foreach ($table->get_combined_url_params() as $key => $value) {
if ($key == 'action') {
continue;
}
$content .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $key, 'value' => $value));
}
$content .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'action', 'value' => 'bulkchange'));
$content .= html_writer::table($table);
$content .= html_writer::start_tag('div', array('class' => 'singleselect bulkuserop'));
$content .= html_writer::start_tag('select', array('name' => 'bulkuserop'));
$content .= html_writer::tag('option', get_string('withselectedusers', 'enrol'), array('value' => ''));
$options = array('' => get_string('withselectedusers', 'enrol'));
foreach ($table->get_bulk_user_enrolment_operations() as $operation) {
$content .= html_writer::tag('option', $operation->get_title(), array('value' => $operation->get_identifier()));
}
$content .= html_writer::end_tag('select');
$content .= html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('go')));
$content .= html_writer::end_tag('div');
$content .= html_writer::end_tag('form');
} else {
// Added for the Bootstrap theme, a no-overflow wrapper.
$content .= html_writer::start_tag('div', array('class' => 'no-overflow'));
$content .= html_writer::table($table);
$content .= html_writer::end_tag('div');
}
$content .= $this->output->render($table->get_paging_bar());
if (!empty($buttonhtml)) {
$content .= $buttonhtml;
}
return $content;
}
示例2: get_coupon_form_page
/**
* Get form page output (includes header/footer).
*
* @param \moodleform $mform
*/
protected function get_coupon_form_page($mform)
{
$out = '';
$out .= $this->header();
$out .= html_writer::start_div('block-coupon-container');
$out .= html_writer::start_div();
$out .= $this->get_tabs($this->page->context, 'wzcoupons', array('id' => $this->page->url->param('id')));
$out .= html_writer::end_div();
$out .= $mform->render();
$out .= html_writer::end_div();
$out .= $this->footer();
return $out;
}
示例3: render
public function render()
{
// Override render so we can output js to page.
global $PAGE;
if (isset($this->type)) {
$PAGE->requires->yui_module('moodle-mod_oublog-statsupdate', 'M.mod_oublog.statsupdate.init', array($this->type));
}
return parent::render();
}