|
| _process_submission ($method) |
| Internal method. More...
|
|
| _validate_files (&$files) |
| Internal method. More...
|
|
| add_action_buttons ($cancel=true, $submitlabel=null) |
| Use this method to a cancel and submit button to the end of your form. More...
|
|
| add_checkbox_controller ($groupid, $text=null, $attributes=null, $originalValue=0) |
| Adds a link/button that controls the checked state of a group of checkboxes. More...
|
|
| definition_after_data () |
| Dummy stub method - override if you need to setup the form depending on current values. More...
|
|
| display () |
| Print html form.
|
|
| focus ($name=NULL) |
| To autofocus on first form element or first element with error. More...
|
|
| get_data () |
| Return submitted data if properly submitted or returns NULL if validation fails or if there is no submitted data. More...
|
|
| get_file_content ($elname) |
| Get content of uploaded file. More...
|
|
| get_new_filename ($elname=null) |
| Returns name of uploaded file. More...
|
|
| get_submitted_data () |
| Return submitted data without validation or NULL if there is no submitted data. More...
|
|
| init_javascript_enhancement ($element, $enhancement, array $options=array(), array $strings=null) |
| Adds an initialisation call for a standard JavaScript enhancement. More...
|
|
| is_cancelled () |
| Return true if a cancel button has been pressed resulting in the form being submitted. More...
|
|
| is_submitted () |
| Check that form was submitted. More...
|
|
| is_validated () |
| Check that form data is valid. More...
|
|
| moodleform ($action=null, $customdata=null, $method='post', $target='', $attributes=null, $editable=true) |
| Old syntax of class constructor. More...
|
|
| no_submit_button_pressed () |
| Checks if button pressed is not for submitting the form. More...
|
|
| optional_param ($name, $default, $type) |
| Checks if a parameter was passed in the previous form submission. More...
|
|
| render () |
| Renders the html form (same as display, but returns the result). More...
|
|
| repeat_elements ($elementobjs, $repeats, $options, $repeathiddenname, $addfieldsname, $addfieldsno=5, $addstring=null, $addbuttoninside=false) |
| Method to add a repeating group of elements to a form. More...
|
|
| repeat_elements_fix_clone ($i, $elementclone, &$namecloned) |
| Helper used by repeat_elements(). More...
|
|
| save_file ($elname, $pathname, $override=false) |
| Save file to standard filesystem. More...
|
|
| save_files ($destination) |
| Save verified uploaded files into directory. More...
|
|
| save_stored_file ($elname, $newcontextid, $newcomponent, $newfilearea, $newitemid, $newfilepath='/', $newfilename=null, $overwrite=false, $newuserid=null) |
| Save file to local filesystem pool. More...
|
|
| save_temp_file ($elname) |
| Returns a temporary file, do not forget to delete after not needed any more. More...
|
|
| set_data ($default_values) |
| Load in existing data as form defaults. More...
|
|
| set_display_vertical () |
| Set display mode for the form when labels take full width of the form and above the elements even on big screens. More...
|
|
| set_initial_dirty_state ($state=false) |
| Set the initial 'dirty' state of the form. More...
|
|
| validate_defined_fields ($validateonnosubmit=false) |
| Validate the form. More...
|
|
| validation ($data, $files) |
| Dummy stub method - override if you needed to perform some extra validation. More...
|
|
moodleform::definition |
( |
| ) |
|
|
abstractprotectedinherited |
Form definition.
Abstract method - always override!
Reimplemented in field_form, category_form, user_edit_language_form, user_edit_forum_form, user_active_filter_form, user_add_filter_form, user_files_form, user_edit_editor_form, user_editadvanced_form, user_edit_form, core_user\form\defaulthomepage_form, core_user\form\calendar_form, core_user\course_form, tag_edit_form, core_search\output\form\search, repository_type_form, repository_instance_form, report_outline\filter_form, report_eventlist_filter_form, core_question\form\tags, qtype_random_edit_form, question_edit_form, question_dataset_dependent_items_form, question_dataset_dependent_definitions_form, preview_options_form, question_move_form, question_import_form, question_export_form, question_category_edit_form, note_edit_form, workshop_submission_form, mod_workshop_mod_form, workshop_edit_strategy_form, workshop_assessment_form, workshop_feedbackreviewer_form, workshop_feedbackauthor_form, workshop_evaluation_settings_form, workshop_scheduled_allocator_form, workshop_random_allocator_form, mod_wiki_mod_form, mod_wiki_filesedit_form, mod_wiki_edit_form, mod_wiki_create_form, mod_wiki_comments_form, mod_url_mod_form, mod_survey_mod_form, mod_scorm_report_settings, mod_scorm_report_objectives_settings, mod_scorm_report_interactions_settings, mod_scorm_mod_form, mod_resource_mod_form, quiz_statistics_settings_form, quiz_grading_settings_form, mod_quiz_attempts_report_form, quiz_override_form, mod_quiz_mod_form, mod_quiz\form\randomquestion_form, quiz_add_random_form, mod_quiz_preflight_check_form, mod_page_mod_form, mod_lti_register_types_form, mod_lti_mod_form, mod_lti_edit_types_form, lesson_page_without_answers, lesson_display_answer_form_truefalse, lesson_display_answer_form_shortanswer, lesson_display_answer_form_numerical, lesson_display_answer_form_multichoice_multianswer, lesson_display_answer_form_multichoice_singleanswer, lesson_display_answer_form_matching, lesson_display_answer_form_essay, lesson_override_form, mod_lesson_mod_form, lesson_add_page_form_base, lesson_import_form, essay_grading_form, mod_label_mod_form, mod_imscp_mod_form, mod_glossary_mod_form, mod_glossary_import_form, mod_glossary_entry_form, forumreport_summary\form\dates_filter_form, mod_forum_mod_form, mod_forum_prune_form, mod_forum_post_form, mod_forum\form\export_form, mod_folder_mod_form, mod_folder_edit_form, mod_feedback_use_templ_form, mod_feedback_mod_form, feedback_textfield_form, feedback_textarea_form, feedback_numeric_form, feedback_multichoicerated_form, feedback_multichoice_form, feedback_label_form, feedback_info_form, feedback_item_form, feedback_captcha_form, feedback_import_form, feedback_edit_create_template_form, feedback_edit_use_template_form, mod_feedback_course_select_form, mod_feedback_course_map_form, mod_feedback_complete_form, data_save_preset_form, data_export_form, data_import_preset_zip_form, data_existing_preset_form, mod_data_mod_form, mod_data_import_form, mod_data_export_form, mod_choice_mod_form, mod_chat_mod_form, booktool_importhtml_form, mod_book_mod_form, book_chapter_edit_form, mod_assignment_mod_form, mod_assign_confirm_submission_form, mod_assign_submission_form, mod_assign_quick_grading_form, assign_override_form, mod_assign_mod_form, mod_assign_grading_options_form, mod_assign_grading_batch_operations_form, mod_assign_grade_form, assignfeedback_offline_upload_grades_form, assignfeedback_offline_import_grades_form, assignfeedback_file_upload_zip_form, assignfeedback_file_import_zip_form, assignfeedback_file_batch_upload_files_form, mod_assign_extension_form, mod_assign_batch_set_marking_workflow_state_form, mod_assign_batch_set_allocatedmarker_form, login_signup_form, login_set_password_form, login_forgot_password_form, login_forgot_password_form, login_change_password_form, portfolio_instance_select, portfolio_user_form, portfolio_admin_form, portfolio_export_form, atto_managefiles_manage_form, core\hub\site_registration_form, core_h5p\form\uploadlibraries_form, groups_import_form, grouping_form, group_form, autogroup_form, gradereport_history\filter_form, grader_report_preferences_form, grade_import_form, key_form, grade_import_mapping_form, grade_import_form, gradeimport_direct_mapping_form, gradeimport_direct_import_form, grading_search_template_form, gradingform_rubric_editrubric, gradingform_guide_editguide, key_form, grade_export_form, edit_outcomeitem_form, edit_item_form, edit_grade_form, edit_category_form, edit_calculation_form, course_settings_form, edit_scale_form, import_outcomes_form, edit_outcome_form, edit_letter_form, filter_local_settings_form, coursefiles_edit_form, enrol_users_filter_form, enrol_users_addmember_form, enrol_users_assign_form, enrol_self_enrol_form, enrol_self_empty_form, enrol_manual_enrol_users_form, enrol_guest_enrol_form, enrol_instance_edit_form, enrol_user_enrolment_form, enrol_bulk_enrolment_confirm_form, enrol_bulk_enrolment_change_form, core_customfield\field_config_form, coursetags_form, switchrole_form, course_reset_form, reject_request_form, course_request_form, recent_form, editsection_form, course_edit_form, course_completion_form, core_course_editcategory_form, core_course_deletecategory_form, core_completion_edit_base_form, core_completion_defaultedit_form, core_completion_bulkedit_form, cohort_upload_form, cohort_edit_form, event_form, core_calendar\local\event\forms\managesubscriptions, core_calendar\local\event\forms\create, core_calendar_export_form, cache_lock_form, cache_mode_mappings_form, cache_definition_sharing_form, cache_definition_mappings_form, cachestore_addinstance_form, blog_preferences_form, blog_edit_external_form, blog_edit_form, block_edit_form, edit_relatedbadge_form, badges_preferences_form, endorsement_form, edit_criteria_form, core_badges\form\message, core_badges\form\external_backpack, core_badges\form\collections, core_badges\form\badge, core_badges\form\backpack, alignment_form, base_moodleform, course_restore_form, backup_files_edit_form, core_auth\form\verify_age_location_form, webservice_test_client_base_form, webservice_test_client_form, web_service_token_form, external_service_functions_form, external_service_form, external_service_authorised_user_settings_form, user_message_form, user_bulk_form, user_bulk_action_form, user_bulk_cohortadd_form, tool_usertours\local\forms\importtour, tool_usertours\local\forms\edittour, tool_usertours\local\forms\editstep, admin_uploaduser_form2, admin_uploaduser_form1, admin_uploadpicture_form, tool_uploadcourse_step2_form, tool_uploadcourse_step1_form, tool_uploadcourse_base_form, tool_task_edit_scheduled_task_form, tool_replace_form, profiling_import_form, tool_policy\form\policydoc, tool_policy\form\accept_policy, tool_oauth2\form\user_field_mapping, tool_oauth2\form\issuer, tool_oauth2\form\endpoint, tool_monitor\rule_form, tool_messageinbound_edit_handler_form, tool_lpmigrate\form\migrate_framework, tool_lpimportcsv\form\import_confirm, tool_lpimportcsv\form\import, tool_lpimportcsv\form\export, tool_lp\form\user_evidence, tool_lp\form\template_plans, tool_lp\form\template_cohorts, tool_lp\form\template, tool_lp\form\plan, tool_lp\form\competency_framework, tool_lp\form\competency, tool_installaddon_installfromzip_form, tool_httpsreplace\form, tool_generator_make_testplan_form, tool_generator_make_course_form, tool_filetypes_form, database_transfer_form, database_export_form, tool_dataprivacy_data_request_form, tool_dataprivacy\form\purpose, tool_dataprivacy\form\contextlevel, tool_dataprivacy\form\context_instance, tool_dataprivacy\form\category, tool_customlang_filter_form, tool_cohortroles\form\assign_role_cohort, tool_capability_settings_form, steps_definitions_form, tool_analytics\output\form\import_model, tool_analytics\output\form\edit_model, core_role_preset_form, core_role_permission_prohibit_form, core_role_permission_allow_form, mnet_services_form, mnet_profile_form, mnet_review_host_form, mnet_simple_host_form, core_admin\form\testoutgoingmailconf_form, core_admin\form\purge_caches, and admin_settings_search_form.
moodleform::validation |
( |
|
$data, |
|
|
|
$files |
|
) |
| |
|
inherited |
Dummy stub method - override if you needed to perform some extra validation.
If there are errors return array of errors ("fieldname"=>"error message"), otherwise true if ok.
Server side rules do not work for uploaded files, implement serverside rules here if needed.
- Parameters
-
array | $data | array of ("fieldname"=>value) of submitted data |
array | $files | array of uploaded files "element_name"=>tmp_file_path |
- Return values
-
array | of "element_name"=>"error_description" if there are errors, or an empty array if everything is OK (true allowed for backwards compatibility too). |
Reimplemented in user_editadvanced_form, user_edit_form, qtype_random_edit_form, qtype_essay_edit_form, question_edit_form, quiz_add_random_form, core_customfield\field_config_form, field_form, category_form, user_files_form, tag_edit_form, repository_type_form, repository_instance_form, qtype_shortanswer_edit_form, qtype_randomsamatch_edit_form, qtype_numerical_edit_form, qtype_multichoice_edit_form, qtype_multianswer_edit_form, qtype_missingtype_edit_form, qtype_match_edit_form, qtype_gapselect_edit_form_base, qtype_ddmarker_edit_form, qtype_ddimageortext_edit_form, qtype_calculatedsimple_edit_form, qtype_calculatedmulti_edit_form, qtype_calculated_edit_form, question_dataset_dependent_items_form, question_dataset_dependent_definitions_form, question_import_form, question_category_edit_form, workshop_submission_form, mod_workshop_mod_form, workshop_rubric_assessment_form, workshop_edit_strategy_form, workshop_feedbackreviewer_form, workshop_feedbackauthor_form, mod_url_mod_form, mod_scorm_mod_form, mod_resource_mod_form, quiz_responses_settings_form, mod_quiz_attempts_report_form, quiz_override_form, mod_quiz_mod_form, mod_quiz_preflight_check_form, mod_lti_edit_types_form, lesson_override_form, mod_lesson_mod_form, lesson_import_form, mod_imscp_mod_form, mod_glossary_entry_form, mod_forum_mod_form, mod_forum_post_form, mod_folder_mod_form, mod_feedback_mod_form, feedback_edit_create_template_form, mod_data_mod_form, mod_choice_mod_form, booktool_importhtml_form, assign_override_form, mod_assign_mod_form, mod_assign_grade_form, mod_assign_extension_form, mod_assign_batch_set_marking_workflow_state_form, login_signup_form, login_set_password_form, login_forgot_password_form, login_change_password_form, portfolio_user_form, portfolio_admin_form, portfolio_export_form, core\hub\site_registration_form, core\form\persistent, grouping_form, group_form, autogroup_form, grader_report_preferences_form, grade_import_form, gradingform_rubric_editrubric, gradingform_guide_editguide, edit_outcomeitem_form, edit_item_form, edit_category_form, edit_calculation_form, edit_scale_form, edit_outcome_form, enrol_self_enrol_form, enrol_manual_enrol_users_form, enrol_guest_enrol_form, enrol_instance_edit_form, enrol_user_enrolment_form, course_reset_form, course_request_form, moodleform_mod, editsection_form, course_edit_form, core_course_editcategory_form, core_course_deletecategory_form, core_completion_edit_base_form, core_completion_bulkedit_form, cohort_upload_form, cohort_edit_form, event_form, core_calendar\local\event\forms\managesubscriptions, core_calendar\local\event\forms\create, cachestore_memcached_addinstance_form, cache_lock_form, cache_definition_sharing_form, cachestore_addinstance_form, blog_edit_external_form, blog_edit_form, edit_relatedbadge_form, endorsement_form, edit_criteria_form, core_badges\form\badge, core_badges\form\backpack, alignment_form, backup_confirmation_form, web_service_token_form, external_service_form, admin_uploaduser_form2, tool_uploadcourse_step2_form, tool_task_edit_scheduled_task_form, tool_replace_form, tool_policy\form\policydoc, tool_monitor\rule_form, tool_lpmigrate\form\migrate_framework, tool_installaddon_installfromzip_form, tool_generator_make_testplan_form, tool_generator_make_course_form, tool_filetypes_form, database_transfer_form, tool_analytics\output\form\edit_model, core_role_preset_form, mnet_review_host_form, mnet_simple_host_form, and core_admin\form\purge_caches.