public function ajaxProcessUpdateImagePosition() { $response = false; if ($json = Tools::getValue('json')) { $response = true; $json = stripslashes($json); $images = Tools::jsonDecode($json, true); foreach ($images as $id_simpleblog_post_image => $position) { $SimpleBlogPostImage = new SimpleBlogPostImage((int) $id_simpleblog_post_image); $SimpleBlogPostImage->position = (int) $position; $response &= $SimpleBlogPostImage->update(); } } if ($response) { $this->jsonConfirmation($this->_conf[25]); } else { $this->jsonError(Tools::displayError('An error occurred while attempting to move this picture.')); } }