Esempio n. 1
0
 /**
  * @param attcontrol $att
  */
 public function __construct(attcontrol $att)
 {
     if ($att->pageparams->grouptype) {
         $this->users = $att->get_users($att->pageparams->grouptype);
     } else {
         $this->users = $att->get_users($att->pageparams->group);
     }
     $this->pageparams = $att->pageparams;
     $this->perm = $att->perm;
     $this->groupmode = $att->get_group_mode();
     $this->cm = $att->cm;
     $this->statuses = $att->get_statuses();
     $this->sessioninfo = $att->get_session_info($att->pageparams->sessionid);
     $this->updatemode = $this->sessioninfo->lasttaken > 0;
     if (isset($att->pageparams->copyfrom)) {
         $this->sessionlog = $att->get_session_log($att->pageparams->copyfrom);
     } else {
         if ($this->updatemode) {
             $this->sessionlog = $att->get_session_log($att->pageparams->sessionid);
         } else {
             $this->sessionlog = array();
         }
     }
     if (!$this->updatemode) {
         $this->sessions4copy = $att->get_today_sessions_for_copy($this->sessioninfo);
     }
     $this->urlpath = $att->url_take()->out_omit_querystring();
     $params = $att->pageparams->get_significant_params();
     $params['id'] = $att->cm->id;
     $this->urlparams = $params;
     $this->att = $att;
 }