Browse Source

Tidy up some PHP, unsed functions, vars etc.

MOODLE_29_STABLE
Dan Marsden 9 years ago
parent
commit
c4b4dcb26f
  1. 4
      backup/moodle2/restore_attendance_stepslib.php
  2. 3
      duration_form.php
  3. 13
      lib.php

4
backup/moodle2/restore_attendance_stepslib.php

@ -75,7 +75,6 @@ class restore_attendance_activity_structure_step extends restore_activity_struct
global $DB; global $DB;
$data = (object)$data; $data = (object)$data;
$oldid = $data->id;
$data->course = $this->get_courseid(); $data->course = $this->get_courseid();
// Insert the attendance record. // Insert the attendance record.
@ -132,7 +131,6 @@ class restore_attendance_activity_structure_step extends restore_activity_struct
global $DB; global $DB;
$data = (object)$data; $data = (object)$data;
$oldid = $data->id;
$data->sessionid = $this->get_mappingid('attendance_session', $data->sessionid); $data->sessionid = $this->get_mappingid('attendance_session', $data->sessionid);
$data->studentid = $this->get_mappingid('user', $data->studentid); $data->studentid = $this->get_mappingid('user', $data->studentid);
@ -145,7 +143,7 @@ class restore_attendance_activity_structure_step extends restore_activity_struct
$data->timetaken = $this->apply_date_offset($data->timetaken); $data->timetaken = $this->apply_date_offset($data->timetaken);
$data->takenby = $this->get_mappingid('user', $data->takenby); $data->takenby = $this->get_mappingid('user', $data->takenby);
$newitemid = $DB->insert_record('attendance_log', $data); $DB->insert_record('attendance_log', $data);
} }
/** /**

3
duration_form.php

@ -39,12 +39,9 @@ class mod_attendance_duration_form extends moodleform {
*/ */
public function definition() { public function definition() {
global $CFG;
$mform =& $this->_form; $mform =& $this->_form;
$course = $this->_customdata['course'];
$cm = $this->_customdata['cm']; $cm = $this->_customdata['cm'];
$modcontext = $this->_customdata['modcontext'];
$ids = $this->_customdata['ids']; $ids = $this->_customdata['ids'];
$mform->addElement('header', 'general', get_string('changeduration', 'attendance')); $mform->addElement('header', 'general', get_string('changeduration', 'attendance'));

13
lib.php

@ -253,13 +253,6 @@ function attendance_user_complete($course, $user, $mod, $attendance) {
echo construct_full_user_stat_html_table($attendance, $course, $user, $mod); echo construct_full_user_stat_html_table($attendance, $course, $user, $mod);
} }
} }
function attendance_print_recent_activity($course, $isteacher, $timestart) {
return false;
}
function attendance_cron () {
return true;
}
function attendance_update_grades($attendance, $userid=0, $nullifnone=true) { function attendance_update_grades($attendance, $userid=0, $nullifnone=true) {
// We need this function to exist so that quick editing of module name is passed to gradebook. // We need this function to exist so that quick editing of module name is passed to gradebook.
@ -375,7 +368,7 @@ function attendance_scale_used_anywhere($scaleid) {
* @return bool false if file not found, does not return if found - justsend the file * @return bool false if file not found, does not return if found - justsend the file
*/ */
function attendance_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload) { function attendance_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload) {
global $CFG, $DB; global $DB;
if ($context->contextlevel != CONTEXT_MODULE) { if ($context->contextlevel != CONTEXT_MODULE) {
return false; return false;
@ -383,7 +376,7 @@ function attendance_pluginfile($course, $cm, $context, $filearea, $args, $forced
require_login($course, false, $cm); require_login($course, false, $cm);
if (!$att = $DB->get_record('attendance', array('id' => $cm->instance))) { if (!$DB->record_exists('attendance', array('id' => $cm->instance))) {
return false; return false;
} }
@ -394,7 +387,7 @@ function attendance_pluginfile($course, $cm, $context, $filearea, $args, $forced
} }
$sessid = (int)array_shift($args); $sessid = (int)array_shift($args);
if (!$sess = $DB->get_record('attendance_sessions', array('id' => $sessid))) { if (!$DB->record_exists('attendance_sessions', array('id' => $sessid))) {
return false; return false;
} }

Loading…
Cancel
Save