Exemple #1
0
 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;
 }
 /**
  * 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;
 }
 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();
 }