Exemplo n.º 1
0
 public function set_from_data($data)
 {
     if (isset($data->curriculum)) {
         $this->curriculum = $data->curriculum;
     }
     if (isset($data->location)) {
         $this->location = $data->location;
         $this->templateclass = $data->templateclass;
     }
     $fields = field::get_for_context_level('course', 'block_curr_admin');
     $fields = $fields ? $fields : array();
     foreach ($fields as $field) {
         $fieldname = "field_{$field->shortname}";
         if (isset($data->{$fieldname})) {
             $this->{$fieldname} = $data->{$fieldname};
         }
     }
     return parent::set_from_data($data);
 }
Exemplo n.º 2
0
 public function set_from_data($data)
 {
     $fields = field::get_for_context_level('curriculum', 'block_curr_admin');
     $fields = $fields ? $fields : array();
     foreach ($fields as $field) {
         $fieldname = "field_{$field->shortname}";
         if (isset($data->{$fieldname})) {
             $this->{$fieldname} = $data->{$fieldname};
         }
     }
     return parent::set_from_data($data);
 }
Exemplo n.º 3
0
 public function set_from_data($data)
 {
     $this->autocreate = !empty($data->autocreate) ? $data->autocreate : 0;
     $fields = field::get_for_context_level('track', 'block_curr_admin');
     $fields = $fields ? $fields : array();
     foreach ($fields as $field) {
         $fieldname = "field_{$field->shortname}";
         if (isset($data->{$fieldname})) {
             $this->{$fieldname} = $data->{$fieldname};
         }
     }
     parent::set_from_data($data);
 }
Exemplo n.º 4
0
 public function set_from_data($data)
 {
     if (!empty($data->moodleCourses['autocreate'])) {
         $this->autocreate = $data->moodleCourses['autocreate'];
     } else {
         $this->autocreate = false;
     }
     if (isset($data->disablestart)) {
         $this->startdate = 0;
     }
     if (isset($data->disableend)) {
         $this->enddate = 0;
     }
     if (!empty($data->moodleCourses['moodlecourseid']) && !$this->autocreate) {
         $this->moodlecourseid = $data->moodleCourses['moodlecourseid'];
     } else {
         $this->moodlecourseid = 0;
     }
     if (isset($data->track)) {
         $this->track = $data->track;
     }
     $this->oldmax = $this->maxstudents;
     $fields = field::get_for_context_level('class', 'block_curr_admin');
     $fields = $fields ? $fields : array();
     foreach ($fields as $field) {
         $fieldname = "field_{$field->shortname}";
         if (isset($data->{$fieldname})) {
             $this->{$fieldname} = $data->{$fieldname};
         }
     }
     parent::set_from_data($data);
 }
 public function set_from_data($data)
 {
     $fields = array('autoenrol_curricula', 'autoenrol_tracks', 'child_classification');
     foreach ($fields as $field) {
         $fieldname = "param_{$field}";
         if (isset($data->{$fieldname})) {
             $this->{$fieldname} = $data->{$fieldname};
         }
     }
     return parent::set_from_data($data);
 }