Namespaces |
| namespace | report |
Variables |
| | $userid = required_param('id', PARAM_INT) |
| | $courseid = required_param('course', PARAM_INT) |
| | $user = $DB->get_record('user', array('id'=>$userid, 'deleted'=>0), '*', MUST_EXIST) |
| | $course = $DB->get_record('course', array('id'=>$courseid), '*', MUST_EXIST) |
| | $coursecontext = context_course::instance($course->id) |
| | $personalcontext = context_user::instance($user->id) |
| | $stractivityreport = get_string('activityreport') |
| if(empty($CFG->enablestats)) | $statsstatus = stats_check_uptodate($course->id) |
| if($statsstatus!==NULL) | $earliestday = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_daily}') |
| | $earliestweek = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_weekly}') |
| | $earliestmonth = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_monthly}') |
if(empty($earliestday)) if(empty($earliestweek))
if(empty($earliestmonth)) | $now = stats_get_base_daily() |
| | $lastweekend = stats_get_base_weekly() |
| | $lastmonthend = stats_get_base_monthly() |
| | $timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth) |
| if(empty($timeoptions)) | $time = array_pop(array_keys($timeoptions)) |
| | $param = stats_get_parameters($time,STATS_REPORT_USER_VIEW,$course->id,STATS_MODE_DETAILED) |
| | $params = $param->params |
| $param | table = 'user_'.$param->table |
| | $sql |
| | $stats = $DB->get_records_sql($sql, $params) |
| | $table = new html_table() |
| $table | align = array('left','center','center','center') |
| switch($param->table) $table | head = array(get_string('periodending','moodle',$period),$param->line1,$param->line2,$param->line3) |
| | foreach ($stats as $stat) |
A class to manage calendar events
This class provides the required functionality in order to manage calendar events. It was introduced as part of Moodle 2.0 and was created in order to provide a better framework for dealing with calendar events in particular regard to file handling through the new file API
if this page is not within a module.
Definition at line 104 of file user.php.