diff --git a/admin-dev/functions.php b/admin-dev/functions.php
index 9a06203cd..56c7322ac 100644
--- a/admin-dev/functions.php
+++ b/admin-dev/functions.php
@@ -390,50 +390,6 @@ function simpleXMLToArray ($xml, $flattenValues = true, $flattenAttributes = tru
return $return;
}
-/**
- * Generate a sweet HTML list for shop selection
- *
- * @todo move in adminTab
- * @return string
- */
-function generateShopList()
-{
- $tree = Shop::getTree();
- $context = Context::getContext();
-
- // Get default value
- if (Shop::getContext() == Shop::CONTEXT_ALL)
- $value = '';
- else if (Shop::getContext() == Shop::CONTEXT_GROUP)
- $value = 'g-'.Shop::getContextGroupShopID();
- else
- $value = 's-'.Shop::getContextShopID();
-
- // Generate HTML
- $url = $_SERVER['REQUEST_URI'].(($_SERVER['QUERY_STRING']) ? '&' : '?').'setShopContext=';
- $html = '';
-
- return $html;
-}
-
/**
* for retrocompatibility with old AdminTab, old index.php
*
diff --git a/admin-dev/header.inc.php b/admin-dev/header.inc.php
index 421348273..ade435b40 100644
--- a/admin-dev/header.inc.php
+++ b/admin-dev/header.inc.php
@@ -280,7 +280,7 @@ echo '
';
if (Shop::isFeatureActive())
- echo '
';
+ echo '';
echo '';
echo Hook::exec('displayBackOfficeTop');
diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php
index 818938db9..1f28a2c7b 100644
--- a/classes/controller/AdminController.php
+++ b/classes/controller/AdminController.php
@@ -1278,7 +1278,7 @@ class AdminControllerCore extends Controller
'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))),
'quick_access' => $quick_access,
'multi_shop' => Shop::isFeatureActive(),
- 'shop_list' => (Shop::isFeatureActive() ? generateShopList() : null), //@TODO refacto
+ 'shop_list' => Helper::renderShopList(),
'shop' => $this->context->shop,
'group_shop' => $this->context->shop->getGroup(),
'tab' => $tab,
diff --git a/classes/helper/Helper.php b/classes/helper/Helper.php
index 4cd3c011a..588fecbc3 100755
--- a/classes/helper/Helper.php
+++ b/classes/helper/Helper.php
@@ -350,5 +350,46 @@ class HelperCore
return $tpl->fetch();
}
+
+ public static function renderShopList()
+ {
+ if (!Shop::isFeatureActive())
+ return null;
+
+ $tree = Shop::getTree();
+ $context = Context::getContext();
+
+ // Get default value
+ if (Shop::getContext() == Shop::CONTEXT_ALL)
+ $value = '';
+ else if (Shop::getContext() == Shop::CONTEXT_GROUP)
+ $value = 'g-'.Shop::getContextGroupShopID();
+ else
+ $value = 's-'.Shop::getContextShopID();
+
+ // Generate HTML
+ $url = $_SERVER['REQUEST_URI'].(($_SERVER['QUERY_STRING']) ? '&' : '?').'setShopContext=';
+ $html = '';
+
+ return $html;
+ }
}