Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Classes | Functions | Variables
lib.php File Reference

Classes

class  data_field_base
 
class  data_preset_existing_importer
 Data preset importer for existing presets. More...
 
class  data_preset_importer
 Abstract class used for data preset importers. More...
 
class  data_preset_upload_importer
 Data preset importer for uploaded presets. More...
 

Functions

 data_add_instance ($data, $mform=null)
 Adds an instance of a data. More...
 
object data_add_record ($data, $groupid=0, $userid=null)
 function that takes in a dataid and adds a record this is used everytime an add template is submitted More...
 
object data_append_new_field_to_templates ($data, $newfieldname)
 Appends a new field at the end of the form template. More...
 
 data_atmaxentries ($data)
 has a user reached the max number of entries? More...
 
 data_check_updates_since (cm_info $cm, $from, $filter=array())
 
 data_comment_permissions ($comment_param)
 
 data_comment_validate ($comment_param)
 
 data_convert_arrays_to_strings (&$fieldinput)
 
object data_convert_to_roles ($data, $teacherroles=array(), $studentroles=array(), $cmid=NULL)
 Converts a database (module instance) to use the Roles System. More...
 
object data_delete_instance ($id)
 deletes an instance of a data More...
 
 data_delete_record ($recordid, $data, $courseid, $cmid)
 Delete a record entry. More...
 
 data_delete_site_preset ($name)
 Deletes a saved preset. More...
 
object data_export_csv ($export, $delimiter_name, $database, $count, $return=false)
 
object data_export_ods ($export, $dataname, $count)
 
object data_export_xls ($export, $dataname, $count)
 
 data_extend_navigation ($navigation, $course, $module, $cm)
 
 data_extend_settings_navigation (settings_navigation $settings, navigation_node $datanode)
 Adds module specific settings to the settings block. More...
 
 data_fieldname_exists ($name, $dataid, $fieldid=0)
 
object data_generate_default_template (&$data, $template, $recordid=0, $form=false, $update=true)
 Given a template and a dataid, generate a default case template. More...
 
 data_generate_tag_form ($recordid=false, $selected=[])
 Build the form elements to manage tags for a record. More...
 
 data_get_advance_search_ids ($recordids, $searcharray, $dataid)
 Get the ids of all the records that match that advanced search criteria This goes and loops through each criterion one at a time until it either runs out of records or returns a subset of records. More...
 
 data_get_advanced_search_sql ($sort, $data, $recordids, $selectdata, $sortorder)
 Returns an array with an sql string for advanced searches and the parameters that go with them. More...
 
 data_get_all_recordids ($dataid, $selectdata='', $params=null)
 Get all of the record ids from a database activity. More...
 
 data_get_available_presets ($context)
 Returns an array of all the available presets. More...
 
 data_get_available_site_presets ($context, array $presets=array())
 Gets an array of all of the presets that users have saved to the site. More...
 
 data_get_completion_state ($course, $cm, $userid, $type)
 Obtains the automatic completion state for this database item based on any conditions on its settings. More...
 
 data_get_config ($database, $key=null, $default=null)
 Fetch the configuration for this database activity. More...
 
 data_get_coursemodule_info ($coursemodule)
 Add a get_coursemodule_info function in case any database type wants to add 'extra' information for the course (see resource). More...
 
object data_get_exportdata ($dataid, $fields, $selectedfields, $currentgroup=0, $context=null, $userdetails=false, $time=false, $approval=false, $tags=false)
 
 data_get_extra_capabilities ()
 Returns all other caps used in module. More...
 
object data_get_field ($field, $data, $cm=null)
 returns a subclass field object given a record of the field, used to invoke plugin methods input: $param $field - record from db More...
 
object data_get_field_from_id ($fieldid, $data)
 given a field id this function creates an instance of the particular subfield class More...
 
object data_get_field_from_name ($name, $data)
 given a field name this function creates an instance of the particular subfield class More...
 
object data_get_field_new ($type, $data)
 given a field id this function creates an instance of the particular subfield class More...
 
 data_get_file_areas ($course, $cm, $context)
 
 data_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename)
 File browsing support for data module. More...
 
 data_get_post_actions ()
 List the actions that correspond to a post of this module. More...
 
 data_get_recordids ($alias, $searcharray, $dataid, $recordids)
 Gets the record IDs given the search criteria. More...
 
object data_get_user_grades ($data, $userid=0)
 Return grade for given user or all users. More...
 
 data_get_view_actions ()
 List the actions that correspond to a view of this module. More...
 
 data_grade_item_delete ($data)
 
 data_grade_item_update ($data, $grades=NULL)
 
 data_import_csv ($cm, $data, &$csvdata, $encoding, $fielddelimiter)
 Import records for a data instance from csv data. More...
 
 data_in_readonly_period ($data)
 Check whether the specified database activity is currently in a read-only period. More...
 
object data_isowner ($record)
 Given record object (or id), returns true if the record belongs to the current user. More...
 
object data_numentries ($data, $userid=null)
 returns the number of entries already made by this user More...
 
 data_page_type_list ($pagetype, $parentcontext, $currentcontext)
 Return a list of page types. More...
 
 data_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array())
 
 data_preset_name ($shortname, $path)
 Returns the best name to show for a preset. More...
 
object data_preset_path ($course, $userid, $shortname)
 @global object More...
 
 data_presets_export ($course, $cm, $data, $tostorage=false)
 
moodle_database data_presets_generate_xml ($course, $cm, $data)
 Generates the XML for the database module provided. More...
 
 data_presets_save ($course, $cm, $data, $path)
 Save the database configuration as a preset. More...
 
 data_print_header ($course, $cm, $data, $currenttab='')
 Prints the heads for a page. More...
 
object data_print_preference_form ($data, $perpage, $search, $sort='', $order='ASC', $search_array='', $advanced=0, $mode='')
 function that takes in the current data, number of items per page, a search string and prints a preference box in view.php More...
 
object data_print_ratings ($data, $record)
 @global object More...
 
object data_print_template ($template, $records, $data, $search='', $page=0, $return=false, moodle_url $jumpurl=null)
 takes a list of records, the current data, a search string, and mode to display prints the translated template More...
 
 data_process_submission (stdClass $mod, $fields, stdClass $datarecord)
 Check for required fields, and build a list of fields to be updated in a submission. More...
 
 data_rating_permissions ($contextid, $component, $ratingarea)
 Return rating related permissions. More...
 
 data_rating_validate ($params)
 Validates a submitted rating. More...
 
 data_refresh_events ($courseid=0, $instance=null, $cm=null)
 This standard function will check all instances of this module and make sure there are up-to-date events created for each of them. More...
 
object data_replace_field_in_templates ($data, $searchfieldname, $newfieldname)
 Search for a field name and replaces it with another one in all the form templates. More...
 
 data_reset_course_form_defaults ($course)
 Course reset form defaults. More...
 
 data_reset_course_form_definition (&$mform)
 Implementation of the function for printing the form elements that control whether the course reset functionality affects the data. More...
 
object data_reset_gradebook ($courseid, $type='')
 Removes all grades from gradebook. More...
 
object data_reset_userdata ($data)
 Actual implementation of the reset course functionality, delete all the data responses for course $data->courseid. More...
 
 data_set_config (&$database, $key, $value)
 Update the configuration for this database activity. More...
 
 data_supports ($feature)
 
object data_tags_check ($dataid, $template)
 check the multple existence any tag in a template More...
 
 data_update_completion_state ($data, $course, $cm)
 Sets the automatic completion state for this database item based on the count of on its entries. More...
 
 data_update_grades ($data, $userid=0, $nullifnone=true)
 
object data_update_instance ($data)
 updates an instance of a data More...
 
 data_user_can_add_entry ($data, $currentgroup, $groupmode, $context=null)
 Can user add more entries? More...
 
 data_user_can_delete_preset ($context, $preset)
 Checks to see if the user has permission to delete the preset. More...
 
 data_user_can_manage_entry ($record, $data, $context)
 Check whether the current user is allowed to manage the given record considering manageentries capability, data_in_readonly_period() result, ownership (determined by data_isowner()) and manageapproved setting. More...
 
object data_user_complete ($course, $user, $mod, $data)
 Prints all the records uploaded by this user. More...
 
object data_user_outline ($course, $user, $mod, $data)
 returns a summary of data activity of this user More...
 
 data_view ($data, $course, $cm, $context)
 Mark the activity completed (if required) and trigger the course_module_viewed event. More...
 
 is_directory_a_preset ($directory)
 
 mod_data_core_calendar_event_timestart_updated (\calendar_event $event, stdClass $data)
 This function will update the data module according to the event that has been modified. More...
 
 mod_data_core_calendar_get_valid_event_timestart_range (\calendar_event $event, stdClass $instance)
 This function calculates the minimum and maximum cutoff values for the timestart of the given event. More...
 
 mod_data_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, int $userid=0)
 This function receives a calendar event and returns the action associated with it, or null if there is none. More...
 
 mod_data_get_completion_active_rule_descriptions ($cm)
 Callback which returns human-readable strings describing the active completion custom rules for the module instance. More...
 
 mod_data_get_fontawesome_icon_map ()
 Get icon mapping for font-awesome.
 
 mod_data_rating_can_see_item_ratings ($params)
 Can the current user see ratings for a given itemid? More...
 

Variables

const DATA_APPROVED -3
 
const DATA_CAP_EXPORT 'mod/data:viewalluserpresets'
 
const DATA_EVENT_TYPE_CLOSE 'close'
 
const DATA_EVENT_TYPE_OPEN 'open'
 
const DATA_FIRSTNAME -1
 
const DATA_LASTNAME -2
 
const DATA_MAX_ENTRIES 50
 
const DATA_PERPAGE_SINGLE 1
 
const DATA_PRESET_COMPONENT 'mod_data'
 
const DATA_PRESET_CONTEXT SYSCONTEXTID
 
const DATA_PRESET_FILEAREA 'site_presets'
 
const DATA_TAGS -5
 
const DATA_TIMEADDED 0
 
const DATA_TIMEMODIFIED -4
 

Detailed Description

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later