コード例 #1
0
 function definition()
 {
     $mform =& $this->_form;
     /// Add some extra hidden fields
     $mform->addElement('hidden', 's', 'field');
     $mform->setType('s', PARAM_ACTION);
     $mform->addElement('hidden', 'id');
     $mform->setType('id', PARAM_INT);
     $mform->addElement('hidden', 'action', 'frommoodle');
     $mform->setType('action', PARAM_ACTION);
     $categories = field_category::get_all();
     $choices = array();
     foreach ($categories as $category) {
         $choices[$category->id] = $category->name;
     }
     $mform->addElement('select', 'categoryid', get_string('profilecategory', 'admin'), $choices);
     $choices = array();
     $choices[field::no_sync] = get_string('field_no_sync', 'block_curr_admin');
     $choices[field::sync_to_moodle] = get_string('field_sync_to_moodle', 'block_curr_admin');
     $choices[field::sync_from_moodle] = get_string('field_sync_from_moodle', 'block_curr_admin');
     $mform->addElement('select', 'syncwithmoodle', get_string('field_syncwithmoodle', 'block_curr_admin'), $choices);
     $this->add_action_buttons(true);
 }