Beispiel #1
0
 /**
  * Creates a new drawing on the screen
  * @param $screen
  */
 private function add_drawing($screen)
 {
     $this->load->library('form_validation');
     $this->form_validation->set_rules('data', 'Data', 'trim');
     if ($this->form_validation->run() == FALSE) {
         json_error('There was a problem with your submission: ' . validation_errors(' ', ' '));
     } else {
         $drawing_id = $this->Drawing->add(array('screen_id' => $screen->id, 'ordering' => $this->Drawing->get_max_ordering_for_screen($screen->id) + 1, 'creator_id' => get_user_id(), 'data' => $this->post('data', TRUE)));
         activity_add_drawing_screen($drawing_id);
         $drawing = decorate_drawing($this->Drawing->load($drawing_id));
         $this->response($drawing);
     }
 }
Beispiel #2
0
function decorate_drawings($objects)
{
    $updated = array();
    foreach ($objects as $object) {
        $updated[] = decorate_drawing($object);
    }
    return $updated;
}
Beispiel #3
0
 protected function decorate_object($object)
 {
     return decorate_drawing($object);
 }