Exemplo n.º 1
0
Arquivo: lib.php Projeto: rrusso/EARS
 function __construct($course, $key, $id = null, $page = 0, $per_page = 50, $export = false)
 {
     if (!$id and $course) {
         $id = $course->id;
     }
     if ($course) {
         $this->courseid = $course->id;
     }
     $this->course = $course;
     $this->id = $id;
     $this->obj = $this->create_obj($id);
     $this->key = $key;
     $this->define_cps_user();
     $this->page = $page;
     $this->per_page = $per_page;
     $params = array('key' => $this->key, 'keyid' => $this->id, 'per_page' => $this->per_page);
     if ($this->courseid) {
         $params['id'] = $this->courseid;
     }
     $this->filters = cps_user_component::build_filters_from_array('', array_filter(array('section', 'source', 'date_referred', 'firstname', 'lastname'), array($this, 'prune_filters')), $params, array('section' => array('user' => $this->cps_user, 'course' => $course) + $this->section_params()));
     $this->baseurl = $this->filters->flatten_params();
     $this->perform_prune();
     $this->refresh_function_map();
     $this->mentor = $this->master_caps();
     $this->exporting = $export;
     if (!$this->is_capable()) {
         error(get_string('no_permission', 'block_student_gradeviewer'));
     }
 }