/** * This function renders the form elements when adding a customcert element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function render_form_elements($mform) { $mform->addElement('textarea', 'text', get_string('text', 'customcertelement_text')); $mform->setType('text', PARAM_RAW); $mform->addHelpButton('text', 'text', 'customcertelement_text'); parent::render_form_elements($mform); }
/** * This function renders the form elements when adding a customcert element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function render_form_elements($mform) { // Get the possible date options. $dateoptions = array(); $dateoptions[CUSTOMCERT_DATE_ISSUE] = get_string('issueddate', 'customcertelement_date'); $dateoptions[CUSTOMCERT_DATE_COMPLETION] = get_string('completiondate', 'customcertelement_date'); $dateoptions = $dateoptions + customcert_element_grade::get_grade_items(); $mform->addElement('select', 'dateitem', get_string('dateitem', 'customcertelement_date'), $dateoptions); $mform->addHelpButton('dateitem', 'dateitem', 'customcertelement_date'); $mform->addElement('select', 'dateformat', get_string('dateformat', 'customcertelement_date'), self::get_date_formats()); $mform->addHelpButton('dateformat', 'dateformat', 'customcertelement_date'); parent::render_form_elements($mform); }
/** * This function renders the form elements when adding a customcert element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function render_form_elements($mform) { // Get the grade items we can display. $gradeitems = array(); $gradeitems[CUSTOMCERT_GRADE_COURSE] = get_string('coursegrade', 'customcertelement_grade'); $gradeitems = $gradeitems + self::get_grade_items(); // The grade items. $mform->addElement('select', 'gradeitem', get_string('gradeitem', 'customcertelement_grade'), $gradeitems); $mform->setType('gradeitem', PARAM_INT); $mform->addHelpButton('gradeitem', 'gradeitem', 'customcertelement_grade'); // The grade format. $mform->addElement('select', 'gradeformat', get_string('gradeformat', 'customcertelement_grade'), self::get_grade_format_options()); $mform->setType('gradeformat', PARAM_INT); $mform->addHelpButton('gradeformat', 'gradeformat', 'customcertelement_grade'); parent::render_form_elements($mform); }
/** * This function renders the form elements when adding a customcert element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function render_form_elements($mform) { // Get the user profile fields. $userfields = array('firstname' => get_user_field_name('firstname'), 'lastname' => get_user_field_name('lastname'), 'email' => get_user_field_name('email'), 'city' => get_user_field_name('city'), 'country' => get_user_field_name('country'), 'url' => get_user_field_name('url'), 'icq' => get_user_field_name('icq'), 'skype' => get_user_field_name('skype'), 'aim' => get_user_field_name('aim'), 'yahoo' => get_user_field_name('yahoo'), 'msn' => get_user_field_name('msn'), 'idnumber' => get_user_field_name('idnumber'), 'institution' => get_user_field_name('institution'), 'department' => get_user_field_name('department'), 'phone1' => get_user_field_name('phone1'), 'phone2' => get_user_field_name('phone2'), 'address' => get_user_field_name('address')); // Get the user custom fields. $arrcustomfields = \availability_profile\condition::get_custom_profile_fields(); $customfields = array(); foreach ($arrcustomfields as $key => $customfield) { $customfields[$customfield->id] = $key; } // Combine the two. $fields = $userfields + $customfields; core_collator::asort($fields); // Create the select box where the user field is selected. $mform->addElement('select', 'userfield', get_string('userfield', 'customcertelement_userfield'), $fields); $mform->setType('userfield', PARAM_ALPHANUM); $mform->addHelpButton('userfield', 'userfield', 'customcertelement_userfield'); parent::render_form_elements($mform); }
/** * This function renders the form elements when adding a customcert element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function render_form_elements($mform) { $mform->addElement('select', 'teacher', get_string('teacher', 'customcertelement_teachername'), $this->get_list_of_teachers()); $mform->addHelpButton('teacher', 'teacher', 'customcertelement_teachername'); parent::render_form_elements($mform); }
/** * This function renders the form elements when adding a customcert element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function render_form_elements($mform) { $mform->addElement('select', 'gradeitem', get_string('gradeitem', 'customcertelement_gradeitemname'), customcert_element_grade::get_grade_items()); $mform->addHelpButton('gradeitem', 'gradeitem', 'customcertelement_gradeitemname'); parent::render_form_elements($mform); }