remove json lib. depriciate Tools::json function use php function

This commit is contained in:
shreesh arora
2021-03-05 19:35:08 +05:30
parent 82b30db256
commit 659d5b312f
94 changed files with 381 additions and 1248 deletions

View File

@@ -961,14 +961,14 @@ class AdminCategoriesControllerCore extends AdminController
public function ajaxProcessStatusCategory()
{
if (!$id_category = (int)Tools::getValue('id_category')) {
die(Tools::jsonEncode(array('success' => false, 'error' => true, 'text' => $this->l('Failed to update the status'))));
die(json_encode(array('success' => false, 'error' => true, 'text' => $this->l('Failed to update the status'))));
} else {
$category = new Category((int)$id_category);
if (Validate::isLoadedObject($category)) {
$category->active = $category->active == 1 ? 0 : 1;
$category->save() ?
die(Tools::jsonEncode(array('success' => true, 'text' => $this->l('The status has been updated successfully')))) :
die(Tools::jsonEncode(array('success' => false, 'error' => true, 'text' => $this->l('Failed to update the status'))));
die(json_encode(array('success' => true, 'text' => $this->l('The status has been updated successfully')))) :
die(json_encode(array('success' => false, 'error' => true, 'text' => $this->l('Failed to update the status'))));
}
}
}