/**
- * Print standard form elements on module setup forms in mod/.../mod.html
+ * Print standard form elements on module setup forms in mod/.../mod_form.php
*/
function print_standard_coursemodule_settings($form, $features=null) {
global $DB;
}
/**
- * Print groupmode form element on module setup forms in mod/.../mod.html
+ * Print groupmode form element on module setup forms in mod/.../mod_form.php
*/
function print_groupmode_setting($form, $course=NULL) {
global $DB;
}
/**
- * Print groupmode form element on module setup forms in mod/.../mod.html
+ * Print groupmode form element on module setup forms in mod/.../mod_form.php
*/
function print_grouping_settings($form, $course=NULL) {
global $DB;
}
/**
- * Print visibility setting form element on module setup forms in mod/.../mod.html
+ * Print visibility setting form element on module setup forms in mod/.../mod_form.php
*/
function print_visible_setting($form, $course=NULL) {
global $DB;
require_once ($CFG->libdir.'/formslib.php');
/**
* This class adds extra methods to form wrapper specific to be used for module
- * add / update forms (mod/{modname}.mod_form.php replaces deprecated mod/{modname}/mod.html
+ * add / update forms (mod/{modname}.mod_form.php replaces deprecated mod/{modname}/mod_form.php
*
*/
class moodleform_mod extends moodleform {
Each of these modules contains a number of expected components:
- mod.html: a form to setup/update a module instance
+ mod_form.php: a form to setup/update a module instance
version.php: defines some meta-info and provides upgrading code
* Create a new assignment activity
*
* Given an object containing all the necessary data,
- * (defined by the form in mod.html) this function
+ * (defined by the form in mod_form.php) this function
* will create a new instance and return the id number
* of the new instance.
* The due data is added to the calendar
* This is common to all assignment types.
*
- * @param $assignment object The data from the form on mod.html
+ * @param $assignment object The data from the form on mod_form.php
* @return int The id of the assignment
*/
function add_instance($assignment) {
* Updates a new assignment activity
*
* Given an object containing all the necessary data,
- * (defined by the form in mod.html) this function
+ * (defined by the form in mod_form.php) this function
* will update the assignment instance and return the id number
* The due date is updated in the calendar
* This is common to all assignment types.
*
- * @param $assignment object The data from the form on mod.html
+ * @param $assignment object The data from the form on mod_form.php
* @return int The assignment id
*/
function update_instance($assignment) {
function chat_add_instance($chat) {
/// Given an object containing all the necessary data,
-/// (defined by the form in mod.html) this function
+/// (defined by the form in mod_form.php) this function
/// will create a new instance and return the id number
/// of the new instance.
function chat_update_instance($chat) {
/// Given an object containing all the necessary data,
-/// (defined by the form in mod.html) this function
+/// (defined by the form in mod_form.php) this function
/// will update an existing instance with new data.
$chat->timemodified = time();
function choice_add_instance($choice) {
// Given an object containing all the necessary data,
-// (defined by the form in mod.html) this function
+// (defined by the form in mod_form.php) this function
// will create a new instance and return the id number
// of the new instance.
function choice_update_instance($choice) {
// Given an object containing all the necessary data,
-// (defined by the form in mod.html) this function
+// (defined by the form in mod_form.php) this function
// will update an existing instance with new data.
$choice->id = $choice->instance;
/**
* Given an object containing all the necessary data,
- * (defined by the form in mod.html) this function
+ * (defined by the form in mod_form.php) this function
* will create a new instance and return the id number
* of the new instance.
* @param object $forum add forum instance (with magic quotes)
/**
* Given an object containing all the necessary data,
- * (defined by the form in mod.html) this function
+ * (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
* @param object $forum forum instance (with magic quotes)
* @return bool success
function glossary_add_instance($glossary) {
/// Given an object containing all the necessary data,
-/// (defined by the form in mod.html) this function
+/// (defined by the form in mod_form.php) this function
/// will create a new instance and return the id number
/// of the new instance.
function glossary_update_instance($glossary) {
/// Given an object containing all the necessary data,
-/// (defined by the form in mod.html) this function
+/// (defined by the form in mod_form.php) this function
/// will update an existing instance with new data.
global $CFG;
// true (or non-zero number):
// continue to $hotpot->redirect (if set) OR hotpot/view.php (to displsay quiz)
-// $hotpot is an object containing the values of the form in mod.html
+// $hotpot is an object containing the values of the form in mod_form.php
// i.e. all the fields in the 'hotpot' table, plus the following:
// $hotpot->course : an id in the 'course' table
// $hotpot->coursemodule : an id in the 'course_modules' table
function label_add_instance($label) {
/// Given an object containing all the necessary data,
-/// (defined by the form in mod.html) this function
+/// (defined by the form in mod_form.php) this function
/// will create a new instance and return the id number
/// of the new instance.
$textlib = textlib_get_instance();
function label_update_instance($label) {
/// Given an object containing all the necessary data,
-/// (defined by the form in mod.html) this function
+/// (defined by the form in mod_form.php) this function
/// will update an existing instance with new data.
$textlib = textlib_get_instance();
/**
* Given an object containing all the necessary data,
- * (defined by the form in mod.html) this function
+ * (defined by the form in mod_form.php) this function
* will create a new instance and return the id number
* of the new instance.
*
/**
* Given an object containing all the necessary data,
- * (defined by the form in mod.html) this function
+ * (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
*
* @param object $quiz the data that came from the form.
function add_instance($resource) {
// Given an object containing all the necessary data,
- // (defined by the form in mod.html) this function
+ // (defined by the form in mod_form.php) this function
// will create a new instance and return the id number
// of the new instance.
function update_instance($resource) {
// Given an object containing all the necessary data,
- // (defined by the form in mod.html) this function
+ // (defined by the form in mod_form.php) this function
// will update an existing instance with new data.
$resource->id = $resource->instance;
/**
* Given an object containing all the necessary data,
-* (defined by the form in mod.html) this function
+* (defined by the form in mod_form.php) this function
* will create a new instance and return the id number
* of the new instance.
*
return $id;
} else {
- error(get_string('badpackage','scorm'));
+ print_error('badpackage','scorm');
}
}
/**
* Given an object containing all the necessary data,
-* (defined by the form in mod.html) this function
+* (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
*
* @param mixed $scorm Form data
function survey_add_instance($survey) {
// Given an object containing all the necessary data,
-// (defined by the form in mod.html) this function
+// (defined by the form in mod_form.php) this function
// will create a new instance and return the id number
// of the new instance.
function survey_update_instance($survey) {
// Given an object containing all the necessary data,
-// (defined by the form in mod.html) this function
+// (defined by the form in mod_form.php) this function
// will update an existing instance with new data.
if (!$template = get_record("survey", "id", $survey->template)) {
function wiki_add_instance($wiki) {
/// Given an object containing all the necessary data,
-/// (defined by the form in mod.html) this function
+/// (defined by the form in mod_form.php) this function
/// will create a new instance and return the id number
/// of the new instance.
function wiki_update_instance($wiki) {
/// Given an object containing all the necessary data,
-/// (defined by the form in mod.html) this function
+/// (defined by the form in mod_form.php) this function
/// will update an existing instance with new data.
/// Determine the pagename for this wiki.
Each of these modules contains a number of expected components:
- mod.html: a form to setup/update a module instance
+ mod_form.php: a form to setup/update a module instance
version.php: defines some meta-info and provides upgrading code