From b6d3bf1bc36b52306887d66937eb3498343fedb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 26 Sep 2013 13:49:17 +0200 Subject: [PATCH] // missing method --- controllers/admin/AdminStatesController.php | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/controllers/admin/AdminStatesController.php b/controllers/admin/AdminStatesController.php index c1b95db7b..57d5f42cc 100644 --- a/controllers/admin/AdminStatesController.php +++ b/controllers/admin/AdminStatesController.php @@ -244,4 +244,35 @@ class AdminStatesControllerCore extends AdminController if (!count($this->errors)) parent::postProcess(); } + + protected function displayAjaxStates() + { + if ($this->tabAccess['view'] === '1') + { + $states = Db::getInstance()->executeS(' + SELECT s.id_state, s.name + FROM '._DB_PREFIX_.'state s + LEFT JOIN '._DB_PREFIX_.'country c ON (s.`id_country` = c.`id_country`) + WHERE s.id_country = '.(int)(Tools::getValue('id_country')).' AND s.active = 1 AND c.`contains_states` = 1 + ORDER BY s.`name` ASC'); + + if (is_array($states) AND !empty($states)) + { + $list = ''; + if (Tools::getValue('no_empty') != true) + { + $empty_value = (Tools::isSubmit('empty_value')) ? Tools::getValue('empty_value') : '----------'; + $list = ''."\n"; + } + + foreach ($states AS $state) + $list .= ''."\n"; + } + else + $list = 'false'; + + die($list); + } + } + }