protected function modifyAction()
 {
     if ($this->sticky_id) {
         $data = array();
         $fields = array('content' => waRequest::TYPE_STRING, 'size' => waRequest::TYPE_INT, 'color' => waRequest::TYPE_STRING, 'font_size' => waRequest::TYPE_INT, 'position_top' => waRequest::TYPE_INT, 'position_left' => waRequest::TYPE_INT, 'size_width' => waRequest::TYPE_INT, 'size_height' => waRequest::TYPE_INT, 'sheet_id' => waRequest::TYPE_INT);
         foreach ($fields as $field => $type) {
             $value = waRequest::post($field, false, $type);
             if ($value !== false) {
                 $data[$field] = $value;
             }
         }
         if (isset($data['size']) && $data['size']) {
             $data['size_height'] = $data['size_width'] = $data['size'];
             unset($data['size']);
         }
         $sticky = $this->sticky_model->getById($this->sticky_id);
         if ($sticky) {
             //				if ( isset($data['size_width']) && $data['size_width'] != $sticky['size_width'] ||
             //					isset($data['size_height']) && $data['size_height'] != $sticky['size_height'])
             //				{
             //					$this->log('sticky_resize', 1);
             //				}
             //				if ( isset($data['position_top']) && $data['position_top'] != $sticky['position_top'] ||
             //					isset($data['position_left']) && $data['position_left'] != $sticky['position_left'])
             //				{
             //					$this->log('sticky_move', 1);
             //				}
             if (isset($data['sheet_id']) && $data['sheet_id'] != $sticky['sheet_id']) {
                 $this->log('sticky_move_to_board', 1);
             }
             if (isset($data['content']) && $data['content'] != $sticky['content']) {
                 $this->log('sticky_edit', 1);
             }
         }
         if ($res = $this->sticky_model->modify($this->sticky_id, $data)) {
             $data['id'] = $this->sticky_id;
             $this->response = $data;
         } else {
             $this->response = $res;
             $this->errors = _w('Error while save sticky');
         }
     } else {
         $this->errors = _w('Invalid sticky ID');
     }
 }
 public function execute()
 {
     $id = $this->get('id', true);
     $this->getSticky($id);
     $data = waRequest::post();
     if (isset($data['id'])) {
         unset($data['id']);
     }
     if (isset($data['sheet_id'])) {
         $this->checkRights($data['sheet_id']);
     }
     $sticky_model = new stickiesStickyModel();
     if ($sticky_model->modify($id, $data)) {
         $method = new stickiesSheetGetInfoMethod();
         $this->response = $method->getResponse(true);
     } else {
         throw new waAPIException('server_error', 500);
     }
 }