|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
Variables | |
| $id = optional_param('id', 0, PARAM_INT) | |
| One of these is necessary! | |
| $d = optional_param('d', 0, PARAM_INT) | |
| $rid = optional_param('rid', 0, PARAM_INT) | |
| $mode = optional_param('mode', '', PARAM_ALPHA) | |
| $filter = optional_param('filter', 0, PARAM_BOOL) | |
| $edit = optional_param('edit', -1, PARAM_BOOL) | |
| $page = optional_param('page', 0, PARAM_INT) | |
| $approve = optional_param('approve', 0, PARAM_INT) | |
| These can be added to perform an action on a record. | |
| $delete = optional_param('delete', 0, PARAM_INT) | |
| $context = get_context_instance(CONTEXT_MODULE, $cm->id) | |
| if(has_capability('mod/data:managetemplates', $context)) if(!isset($SESSION-> dataprefs)) if(!isset($SESSION-> dataprefs[$data->id])) if(!is_null(optional_param('resetadv', null, PARAM_RAW))) | $advanced = optional_param('advanced', -1, PARAM_INT) |
| If we have an empty Database then redirect because this page is useless without data. | |
| if($textlib->strlen($search) < 2) $SESSION | dataprefs [$data->id]['search'] = $search |
| $sort = optional_param('sort', $SESSION->dataprefs[$data->id]['sort'], PARAM_INT) | |
| $SESSION | dataprefs [$data->id]['sort'] = $sort |
| $order = (optional_param('order', $SESSION->dataprefs[$data->id]['order'], PARAM_ALPHA) == 'ASC') ? 'ASC': 'DESC' | |
| $SESSION | dataprefs [$data->id]['order'] = $order |
| $oldperpage = get_user_preferences('data_perpage_'.$data->id, 10) | |
| $perpage = optional_param('perpage', $oldperpage, PARAM_INT) | |
| $urlparams = array('d' => $data->id) | |
| if(($edit!=-1) and $PAGE-> user_allowed_editing()) | $courseshortname = format_string($course->shortname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id))) |
| $meta = '' | |
| RSS and CSS and JS meta. | |
| if(!empty($CFG->enablerssfeeds)&&!empty($CFG-> data_enablerssfeeds)&&$data-> rssarticles > 0) if($data-> csstemplate) if($data-> jstemplate) | $completion = new completion_info($course) |
| $title = $courseshortname.': ' . format_string($data->name) | |
| Print the page header. | |
| $returnurl = $CFG->wwwroot . '/mod/data/view.php?d='.$data->id.'&search='.s($search).'&sort='.s($sort).'&order='.s($order).'&' | |
| Check to see if groups are being used here. | |
| $currentgroup = groups_get_activity_group($cm) | |
| $groupmode = groups_get_activity_groupmode($cm) | |
| if ($record and $data->approval and!$record->approved and $record->userid!=$USER->id and!has_capability('mod/data:manageentries', $context)) | |
| if($data->intro and empty($page) and empty($record) and $mode!= 'single') if($delete &&confirm_sesskey()&&(has_capability('mod/data:manageentries', $context) or data_isowner($delete))) | $showactivity = true |
| Delete any requested records. | |
| if (has_capability('mod/data:managetemplates', $context)) if (!isset($SESSION->dataprefs)) if (!isset($SESSION->dataprefs[$data->id])) if (!is_null(optional_param('resetadv', null, PARAM_RAW))) $advanced = optional_param('advanced', -1, PARAM_INT) |
| $approve = optional_param('approve', 0, PARAM_INT) |
| if (($edit!=-1) and $PAGE->user_allowed_editing()) $courseshortname = format_string($course->shortname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id))) |
| $currentgroup = groups_get_activity_group($cm) |
| $d = optional_param('d', 0, PARAM_INT) |
| $edit = optional_param('edit', -1, PARAM_BOOL) |
| $filter = optional_param('filter', 0, PARAM_BOOL) |
| $id = optional_param('id', 0, PARAM_INT) |
| $mode = optional_param('mode', '', PARAM_ALPHA) |
| $oldperpage = get_user_preferences('data_perpage_'.$data->id, 10) |
| $order = (optional_param('order', $SESSION->dataprefs[$data->id]['order'], PARAM_ALPHA) == 'ASC') ? 'ASC': 'DESC' |
| $perpage = optional_param('perpage', $oldperpage, PARAM_INT) |
| $rid = optional_param('rid', 0, PARAM_INT) |
| if ($data->intro and empty($page) and empty($record) and $mode!= 'single') if ($delete &&confirm_sesskey()&&(has_capability('mod/data:manageentries', $context) or data_isowner($delete))) $showactivity = true |
| $title = $courseshortname.': ' . format_string($data->name) |
| if (!has_capability('mod/data:manageentries', $context)) if($showactivity) |
Approve any requested records
Check the number of entries required against the number of entries already made (doesn't apply to teachers)
Check the number of entries required before to view other participant's entries against the number of entries already made (doesn't apply to teachers)
setup group and approve restrictions
Find the field we are sorting on
To actually fetch the records
Work out the paging numbers and counts
Get the actual records