Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/data/view.php File Reference

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.'&amp;search='.s($search).'&amp;sort='.s($sort).'&amp;order='.s($order).'&amp;'
 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.

Variable Documentation

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.

Check further parameters that set browsing preferences

Definition at line 118 of file view.php.

$approve = optional_param('approve', 0, PARAM_INT)

These can be added to perform an action on a record.

Definition at line 41 of file view.php.

if (!empty($CFG->enablerssfeeds)&&!empty($CFG->data_enablerssfeeds)&&$data->rssarticles > 0) if ($data->csstemplate) if ($data->jstemplate) $completion = new completion_info($course)

Definition at line 295 of file view.php.

Definition at line 87 of file view.php.

if (($edit!=-1) and $PAGE->user_allowed_editing()) $courseshortname = format_string($course->shortname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)))

Definition at line 279 of file view.php.

$currentgroup = groups_get_activity_group($cm)

Definition at line 323 of file view.php.

$d = optional_param('d', 0, PARAM_INT)

Definition at line 32 of file view.php.

Definition at line 42 of file view.php.

Definition at line 38 of file view.php.

$filter = optional_param('filter', 0, PARAM_BOOL)

Definition at line 35 of file view.php.

Definition at line 324 of file view.php.

One of these is necessary!

Definition at line 31 of file view.php.

$meta = ''

RSS and CSS and JS meta.

Definition at line 282 of file view.php.

Definition at line 34 of file view.php.

$oldperpage = get_user_preferences('data_perpage_'.$data->id, 10)

Definition at line 246 of file view.php.

$order = (optional_param('order', $SESSION->dataprefs[$data->id]['order'], PARAM_ALPHA) == 'ASC') ? 'ASC': 'DESC'

Definition at line 242 of file view.php.

Definition at line 39 of file view.php.

$perpage = optional_param('perpage', $oldperpage, PARAM_INT)

Definition at line 247 of file view.php.

$returnurl = $CFG->wwwroot . '/mod/data/view.php?d='.$data->id.'&amp;search='.s($search).'&amp;sort='.s($sort).'&amp;order='.s($order).'&amp;'

Check to see if groups are being used here.

Definition at line 321 of file view.php.

$rid = optional_param('rid', 0, PARAM_INT)

Definition at line 33 of file view.php.

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.

Definition at line 391 of file view.php.

Definition at line 239 of file view.php.

$title = $courseshortname.': ' . format_string($data->name)

Print the page header.

Definition at line 301 of file view.php.

$urlparams = array('d' => $data->id)

Definition at line 259 of file view.php.

if ($textlib->strlen($search)< 2) $SESSION dataprefs[$data->id]['search'] = $search

Definition at line 237 of file view.php.

$SESSION dataprefs[$data->id]['sort'] = $sort

Definition at line 240 of file view.php.

$SESSION dataprefs[$data->id]['order'] = $order

Definition at line 243 of file view.php.

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

Definition at line 327 of file view.php.

 All Data Structures Namespaces Files Functions Variables Enumerations