/** * Returns a form element for this rule. * * @param string $basename The form element base name. * @return string */ public function get_form($basename) { $o = block_xp_rule::get_form($basename); $modules = html_writer::select(self::get_events_list(), $basename . '[value]', $this->value, '', array('id' => '', 'class' => '')); $o .= get_string('eventis', 'block_xp', $modules); return $o; }
/** * Returns a form element for this rule. * * @param string $basename The form element base name. * @return string */ public function get_form($basename) { global $COURSE; $options = array(); $modinfo = get_fast_modinfo($this->courseid); $courseformat = course_get_format($this->courseid); foreach ($modinfo->get_sections() as $sectionnum => $cmids) { $modules = array(); foreach ($cmids as $cmid) { $cm = $modinfo->get_cm($cmid); $modules[$cm->context->id] = $cm->name; } $options[] = array($courseformat->get_section_name($sectionnum) => $modules); } $o = block_xp_rule::get_form($basename); $modules = html_writer::select($options, $basename . '[value]', $this->value, '', array('id' => '', 'class' => '')); $o .= get_string('activityoresourceis', 'block_xp', $modules); return $o; }
/** * Returns a form element for this rule. * * @param string $basename The form element base name. * @return string */ public function get_form($basename) { $o = parent::get_form($basename); $o .= html_writer::select(array(self::ALL => get_string('ruleset:all', 'block_xp'), self::ANY => get_string('ruleset:any', 'block_xp'), self::NONE => get_string('ruleset:none', 'block_xp')), $basename . '[method]', $this->method, '', array('class' => '', 'id' => '')); return $o; }