diff --git a/mod/data/lib.php b/mod/data/lib.php index 88827767a6a..090263597ac 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -1208,14 +1208,13 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r $cm = get_coursemodule_from_instance('data', $data->id); $context = context_module::instance($cm->id); - static $fields = NULL; - static $isteacher; - static $dataid = NULL; + static $fields = array(); + static $dataid = null; if (empty($dataid)) { $dataid = $data->id; } else if ($dataid != $data->id) { - $fields = NULL; + $fields = array(); } if (empty($fields)) { @@ -1223,7 +1222,6 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r foreach ($fieldrecords as $fieldrecord) { $fields[]= data_get_field($fieldrecord, $data); } - $isteacher = has_capability('mod/data:managetemplates', $context); } if (empty($records)) { @@ -1698,14 +1696,13 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order=' data_generate_default_template($data, 'asearchtemplate'); } - static $fields = NULL; - static $isteacher; - static $dataid = NULL; + static $fields = array(); + static $dataid = null; if (empty($dataid)) { $dataid = $data->id; } else if ($dataid != $data->id) { - $fields = NULL; + $fields = array(); } if (empty($fields)) { @@ -1713,8 +1710,6 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order=' foreach ($fieldrecords as $fieldrecord) { $fields[]= data_get_field($fieldrecord, $data); } - - $isteacher = has_capability('mod/data:managetemplates', $context); } // Replacing tags