Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into bootstrap

Conflicts:
	admin-dev/themes/default/template/controllers/customer_threads/message.tpl
	admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl
	admin-dev/themes/default/template/controllers/modules/favorites.tpl
	admin-dev/themes/default/template/controllers/modules/list.tpl
	admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl
	admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl
	admin-dev/themes/default/template/controllers/orders/_print_pdf_icon.tpl
	admin-dev/themes/default/template/controllers/orders/form.tpl
	admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/products/associations.tpl
	admin-dev/themes/default/template/controllers/products/combinations.tpl
	admin-dev/themes/default/template/controllers/products/images.tpl
	admin-dev/themes/default/template/controllers/products/informations.tpl
	admin-dev/themes/default/template/controllers/products/prices.tpl
	admin-dev/themes/default/template/controllers/referrers/helpers/view/view.tpl
	admin-dev/themes/default/template/header.tpl
	admin-dev/themes/default/template/helpers/form/form.tpl
	admin-dev/themes/default/template/helpers/list/list_header.tpl
	classes/ProductSale.php
	classes/helper/HelperList.php
	controllers/admin/AdminCmsController.php
	controllers/admin/AdminCustomersController.php
	controllers/admin/AdminMetaController.php
	controllers/admin/AdminModulesController.php
	controllers/admin/AdminPerformanceController.php
	controllers/admin/AdminProductsController.php
	controllers/front/ParentOrderController.php
	install-dev/theme/views/welcome.phtml
	modules/blocknewproducts/blocknewproducts.php
	modules/blocktopmenu/blocktopmenu.php
	modules/importerosc/importerosc.php
	modules/mailalerts/mailalerts.php
	modules/shopimporter/shopimporter.php
	modules/statsstock/statsstock.php
	themes/default/css/product_list.css
This commit is contained in:
Kevin Granger
2013-11-04 14:43:01 +01:00
169 changed files with 2783 additions and 1759 deletions

View File

@@ -1247,11 +1247,7 @@ abstract class ModuleCore
$module->interest = 0;
}
usort($module_list, create_function('$a,$b', '
if ($a->displayName == $b->displayName)
return 0;
return ($a->displayName < $b->displayName) ? -1 : 1;
'));
usort($module_list, create_function('$a,$b', 'return strnatcasecmp($a->displayName, $b->displayName);'));
if ($errors)
{
@@ -1310,6 +1306,23 @@ abstract class ModuleCore
return $db->executeS('SELECT * FROM `'._DB_PREFIX_.'module` m WHERE `name` NOT IN ('.implode(',', $arr_native_modules).') ');
}
public static function getNativeModuleList()
{
$module_list_xml = _PS_ROOT_DIR_.self::CACHE_FILE_MODULES_LIST;
$native_modules = simplexml_load_file($module_list_xml);
$native_modules = $native_modules->modules;
$modules = array();
foreach ($native_modules as $native_modules_type)
if (in_array($native_modules_type['type'], array('native', 'partner')))
{
foreach ($native_modules_type->module as $module)
$modules[] = $module['name'];
}
return $modules;
}
/**
* Return installed modules
*
@@ -1593,6 +1606,18 @@ abstract class ModuleCore
return Cache::retrieve('Module::isInstalled'.$module_name);
}
public function isEnabledForShopContext()
{
$shop_list = Shop::getContextListShopID();
return (bool)Db::getInstance()->getValue('
SELECT COUNT(*) n
FROM `'._DB_PREFIX_.'module_shop`
WHERE id_module='.(int)$this->id.' AND id_shop IN ('.implode(',', array_map('intval', Shop::getContextListShopID())).')
GROUP BY id_module
HAVING n='.(int)count(Shop::getContextListShopID())
);
}
public static function isEnabled($module_name)
{
if (!Cache::isStored('Module::isEnabled'.$module_name))
@@ -1771,6 +1796,7 @@ abstract class ModuleCore
@unlink($file);
@file_put_contents($file, $xml);
}
@chmod($file, 0664);
}
}