[-] Classes : all classes and controllers now use their name in static calls instead of self (improve override) #PSFV-376
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12552 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -103,7 +103,7 @@ class AddressFormatCore extends ObjectModel
|
||||
* @fieldName is a property name
|
||||
* @isIdField boolean to know if we have to allowed a property name started by 'id_'
|
||||
*/
|
||||
private function _checkValidateClassField($className, $fieldName, $isIdField)
|
||||
protected function _checkValidateClassField($className, $fieldName, $isIdField)
|
||||
{
|
||||
$isValide = false;
|
||||
|
||||
@@ -142,7 +142,7 @@ class AddressFormatCore extends ObjectModel
|
||||
* @patternName is the composition of the class and field name
|
||||
* @fieldsValidate contains the list of available field for the Address class
|
||||
*/
|
||||
private function _checkLiableAssociation($patternName, $fieldsValidate)
|
||||
protected function _checkLiableAssociation($patternName, $fieldsValidate)
|
||||
{
|
||||
$patternName = trim($patternName);
|
||||
|
||||
@@ -229,7 +229,7 @@ class AddressFormatCore extends ObjectModel
|
||||
** example : (firstname) => 'Presta' will result (Presta)
|
||||
** : (firstname-lastname) => 'Presta' and 'Shop' result '(Presta-Shop)'
|
||||
*/
|
||||
private static function _setOriginalDisplayFormat(&$formattedValueList, $currentLine, $currentKeyList)
|
||||
protected static function _setOriginalDisplayFormat(&$formattedValueList, $currentLine, $currentKeyList)
|
||||
{
|
||||
if ($currentKeyList && is_array($currentKeyList))
|
||||
if ($originalFormattedPatternList = explode(' ', $currentLine))
|
||||
@@ -326,10 +326,10 @@ class AddressFormatCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
self::_setOriginalDisplayFormat($tab, $line, $keyList);
|
||||
AddressFormat::_setOriginalDisplayFormat($tab, $line, $keyList);
|
||||
}
|
||||
}
|
||||
self::cleanOrderedAddress($addressFormat);
|
||||
AddressFormat::cleanOrderedAddress($addressFormat);
|
||||
// Free the instanciate objects
|
||||
foreach($temporyObject as &$object)
|
||||
unset($object);
|
||||
@@ -373,7 +373,7 @@ class AddressFormatCore extends ObjectModel
|
||||
|
||||
public static function generateAddressSmarty($params, &$smarty)
|
||||
{
|
||||
return self::generateAddress(
|
||||
return AddressFormat::generateAddress(
|
||||
$params['address'],
|
||||
(isset($params['patternRules']) ? $params['patternRules'] : array()),
|
||||
(isset($params['newLine']) ? $params['newLine'] : "\r\n"),
|
||||
@@ -450,7 +450,7 @@ class AddressFormatCore extends ObjectModel
|
||||
public static function getOrderedAddressFields($id_country = 0, $split_all = false, $cleaned = false)
|
||||
{
|
||||
$out = array();
|
||||
$field_set = explode("\n", self::getAddressCountryFormat($id_country));
|
||||
$field_set = explode("\n", AddressFormat::getAddressCountryFormat($id_country));
|
||||
foreach ($field_set as $field_item)
|
||||
if ($split_all)
|
||||
{
|
||||
@@ -515,7 +515,7 @@ class AddressFormatCore extends ObjectModel
|
||||
return $out;
|
||||
}
|
||||
|
||||
private function _getFormatDB($id_country)
|
||||
protected function _getFormatDB($id_country)
|
||||
{
|
||||
$result = Db::getInstance()->getRow('
|
||||
SELECT format
|
||||
|
||||
@@ -1604,7 +1604,7 @@ class AdminControllerCore extends Controller
|
||||
// @todo remove global keyword in translations files and use static
|
||||
global $_LANGADM;
|
||||
|
||||
self::initModuleCacheTab();
|
||||
AdminController::initModuleCacheTab();
|
||||
|
||||
if (!is_array($_LANGADM))
|
||||
{
|
||||
@@ -1661,7 +1661,7 @@ class AdminControllerCore extends Controller
|
||||
$class = substr($class, 0, -10);
|
||||
else if ($class == 'AdminTab')
|
||||
$class = substr(get_class($this), 0, -10);
|
||||
return self::translate($string, $class, $addslashes, $htmlentities);
|
||||
return AdminController::translate($string, $class, $addslashes, $htmlentities);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -914,7 +914,7 @@ abstract class AdminTabCore
|
||||
if (!Shop::isFeatureActive())
|
||||
return ;
|
||||
|
||||
if(!$assos = self::getAssoShop($this->table, $id_object))
|
||||
if (!$assos = AdminTab::getAssoShop($this->table, $id_object))
|
||||
return;
|
||||
|
||||
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.$this->table.'_'.$assos[1].($id_object ? ' WHERE `'.$this->identifier.'`='.(int)$id_object : ''));
|
||||
|
||||
+5
-5
@@ -44,16 +44,16 @@ class AliasCore extends ObjectModel
|
||||
),
|
||||
);
|
||||
|
||||
public function __construct($id = NULL, $alias = NULL, $search = NULL, $id_lang = NULL)
|
||||
public function __construct($id = null, $alias = null, $search = null, $id_lang = null)
|
||||
{
|
||||
$this->def = self::getDefinition($this);
|
||||
$this->def = Alias::getDefinition($this);
|
||||
$this->setDefinitionRetrocompatibility();
|
||||
|
||||
if ($id)
|
||||
parent::__construct($id);
|
||||
else if ($alias && Validate::isValidSearch($alias))
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!Alias::isFeatureActive())
|
||||
{
|
||||
$this->alias = trim($alias);
|
||||
$this->search = trim($search);
|
||||
@@ -96,7 +96,7 @@ class AliasCore extends ObjectModel
|
||||
if (parent::delete())
|
||||
{
|
||||
// Refresh cache of feature detachable
|
||||
Configuration::updateGlobalValue('PS_ALIAS_FEATURE_ACTIVE', self::isCurrentlyUsed($this->def['table'], true));
|
||||
Configuration::updateGlobalValue('PS_ALIAS_FEATURE_ACTIVE', Alias::isCurrentlyUsed($this->def['table'], true));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -104,7 +104,7 @@ class AliasCore extends ObjectModel
|
||||
|
||||
public function getAliases()
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!Alias::isFeatureActive())
|
||||
return '';
|
||||
|
||||
$aliases = Db::getInstance()->executeS('
|
||||
|
||||
@@ -202,7 +202,7 @@ class AttributeCore extends ObjectModel
|
||||
Tools::displayAsDeprecated();
|
||||
|
||||
$id_product = (int)$arr['id_product'];
|
||||
$qty = self::getAttributeQty($id_product);
|
||||
$qty = Attribute::getAttributeQty($id_product);
|
||||
|
||||
if ($qty !== false)
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ class AttributeGroupCore extends ObjectModel
|
||||
IN ('.implode(', ', $to_remove).')') === false)
|
||||
return false;
|
||||
/* Remove combinations if they do not possess attributes anymore */
|
||||
if (!self::cleanDeadCombinations())
|
||||
if (!AttributeGroup::cleanDeadCombinations())
|
||||
return false;
|
||||
/* Also delete related attributes */
|
||||
if (Db::getInstance()->execute('
|
||||
|
||||
@@ -102,7 +102,7 @@ class CMSCategoryCore extends ObjectModel
|
||||
|
||||
public function add($autodate = true, $nullValues = false)
|
||||
{
|
||||
$this->position = self::getLastPosition((int)$this->id_parent);
|
||||
$this->position = CMSCategory::getLastPosition((int)$this->id_parent);
|
||||
$this->level_depth = $this->calcLevelDepth();
|
||||
foreach ($this->name AS $k => $value)
|
||||
if (preg_match('/^[1-9]\./', $value))
|
||||
@@ -185,7 +185,7 @@ class CMSCategoryCore extends ObjectModel
|
||||
($active ? ' AND c.`active` = 1' : '');
|
||||
$result = Db::getInstance()->executeS($sql);
|
||||
foreach ($result as $row)
|
||||
$category['children'][] = self::getRecurseCategory($id_lang, $row['id_cms_category'], $active, $links);
|
||||
$category['children'][] = CMSCategory::getRecurseCategory($id_lang, $row['id_cms_category'], $active, $links);
|
||||
|
||||
$sql = 'SELECT c.`id_cms`, cl.`meta_title`, cl.`link_rewrite`
|
||||
FROM `'._DB_PREFIX_.'cms` c
|
||||
@@ -208,12 +208,12 @@ class CMSCategoryCore extends ObjectModel
|
||||
public static function recurseCMSCategory($categories, $current, $id_cms_category = 1, $id_selected = 1, $is_html = 0)
|
||||
{
|
||||
$html = '<option value="'.$id_cms_category.'"'.(($id_selected == $id_cms_category) ? ' selected="selected"' : '').'>'.
|
||||
str_repeat(' ', $current['infos']['level_depth'] * 5).self::hideCMSCategoryPosition(stripslashes($current['infos']['name'])).'</option>';
|
||||
str_repeat(' ', $current['infos']['level_depth'] * 5).CMSCategory::hideCMSCategoryPosition(stripslashes($current['infos']['name'])).'</option>';
|
||||
if ($is_html == 0)
|
||||
echo $html;
|
||||
if (isset($categories[$id_cms_category]))
|
||||
foreach (array_keys($categories[$id_cms_category]) AS $key)
|
||||
$html .= self::recurseCMSCategory($categories, $categories[$id_cms_category][$key], $key, $id_selected, $is_html);
|
||||
$html .= CMSCategory::recurseCMSCategory($categories, $categories[$id_cms_category][$key], $key, $id_selected, $is_html);
|
||||
return $html;
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ class CMSCategoryCore extends ObjectModel
|
||||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'cms_category` WHERE `id_cms_category` IN ('.$list.')');
|
||||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'cms_category_lang` WHERE `id_cms_category` IN ('.$list.')');
|
||||
|
||||
self::cleanPositions($this->id_parent);
|
||||
CMSCategory::cleanPositions($this->id_parent);
|
||||
|
||||
/* Delete pages which are in categories to delete */
|
||||
$result = Db::getInstance()->executeS('
|
||||
@@ -390,7 +390,7 @@ class CMSCategoryCore extends ObjectModel
|
||||
*/
|
||||
public static function getHomeCategories($id_lang, $active = true)
|
||||
{
|
||||
return self::getChildren(1, $id_lang, $active);
|
||||
return CMSCategory::getChildren(1, $id_lang, $active);
|
||||
}
|
||||
|
||||
public static function getChildren($id_parent, $id_lang, $active = true)
|
||||
|
||||
+7
-7
@@ -470,7 +470,7 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
// Thus you can avoid one query per product, because there will be only one query for all the products of the cart
|
||||
Product::cacheProductsFeatures($products_ids);
|
||||
self::cacheSomeAttributesLists($pa_ids, $this->id_lang);
|
||||
Cart::cacheSomeAttributesLists($pa_ids, $this->id_lang);
|
||||
|
||||
$this->_products = array();
|
||||
if (empty($result))
|
||||
@@ -664,7 +664,7 @@ class CartCore extends ObjectModel
|
||||
if (!$this->id)
|
||||
return 0;
|
||||
|
||||
return self::getNbProducts($this->id);
|
||||
return Cart::getNbProducts($this->id);
|
||||
}
|
||||
|
||||
public static function getNbProducts($id)
|
||||
@@ -1863,7 +1863,7 @@ class CartCore extends ObjectModel
|
||||
'delay' => $delay,
|
||||
'price' => $price,
|
||||
'price_tax_exc' => $price_tax_exc,
|
||||
'id_carrier' => self::intifier($key), // Need to translate to an integer for retrocompatibility reason, in 1.4 template we used intval
|
||||
'id_carrier' => Cart::intifier($key), // Need to translate to an integer for retrocompatibility reason, in 1.4 template we used intval
|
||||
'is_module' => false,
|
||||
);
|
||||
}
|
||||
@@ -1877,7 +1877,7 @@ class CartCore extends ObjectModel
|
||||
if (count($delivery_option) > 1 || empty($delivery_option))
|
||||
return 0;
|
||||
|
||||
return self::intifier(reset($delivery_option));
|
||||
return Cart::intifier(reset($delivery_option));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1971,7 +1971,7 @@ class CartCore extends ObjectModel
|
||||
$this->delivery_option = serialize($delivery_option);
|
||||
}
|
||||
|
||||
private function getIdCarrierFromDeliveryOption($delivery_option)
|
||||
protected function getIdCarrierFromDeliveryOption($delivery_option)
|
||||
{
|
||||
$delivery_option_list = $this->getDeliveryOptionList();
|
||||
foreach ($delivery_option as $key => $value)
|
||||
@@ -2160,7 +2160,7 @@ class CartCore extends ObjectModel
|
||||
// If no product added, return 0
|
||||
if ($order_total <= 0
|
||||
&& (
|
||||
!(self::getNbProducts($this->id) && is_null($product_list))
|
||||
!(Cart::getNbProducts($this->id) && is_null($product_list))
|
||||
||
|
||||
(count($product_list) && !is_null($product_list))
|
||||
))
|
||||
@@ -2571,7 +2571,7 @@ class CartCore extends ObjectModel
|
||||
*/
|
||||
public static function getCartByOrderId($id_order)
|
||||
{
|
||||
if ($id_cart = self::getCartIdByOrderId($id_order))
|
||||
if ($id_cart = Cart::getCartIdByOrderId($id_order))
|
||||
return new Cart((int)$id_cart);
|
||||
|
||||
return false;
|
||||
|
||||
+10
-10
@@ -152,12 +152,12 @@ class CategoryCore extends ObjectModel
|
||||
|
||||
public function add($autodate = true, $nullValues = false)
|
||||
{
|
||||
$this->position = self::getLastPosition((int)$this->id_parent);
|
||||
$this->position = Category::getLastPosition((int)$this->id_parent);
|
||||
if (!isset($this->level_depth))
|
||||
$this->level_depth = $this->calcLevelDepth();
|
||||
$ret = parent::add($autodate);
|
||||
if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree)
|
||||
self::regenerateEntireNtree();
|
||||
Category::regenerateEntireNtree();
|
||||
$this->updateGroup($this->groupBox);
|
||||
Hook::exec('actionCategoryAdd', array('category' => $this));
|
||||
return $ret;
|
||||
@@ -179,11 +179,11 @@ class CategoryCore extends ObjectModel
|
||||
$this->cleanPositions((int)$this->id_parent);
|
||||
// If the parent category was changed, we don't want to have 2 categories with the same position
|
||||
if ($this->getDuplicatePosition())
|
||||
$this->position = self::getLastPosition((int)$this->id_parent);
|
||||
$this->position = Category::getLastPosition((int)$this->id_parent);
|
||||
$ret = parent::update($nullValues);
|
||||
if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree)
|
||||
{
|
||||
self::regenerateEntireNtree();
|
||||
Category::regenerateEntireNtree();
|
||||
$this->recalculateLevelDepth($this->id_category);
|
||||
}
|
||||
Hook::exec('actionCategoryUpdate', array('category' => $this));
|
||||
@@ -246,7 +246,7 @@ class CategoryCore extends ObjectModel
|
||||
str_repeat(' ', $current['infos']['level_depth'] * 5).stripslashes($current['infos']['name']).'</option>';
|
||||
if (isset($categories[$id_category]))
|
||||
foreach (array_keys($categories[$id_category]) as $key)
|
||||
self::recurseCategory($categories, $categories[$id_category][$key], $key, $id_selected);
|
||||
Category::recurseCategory($categories, $categories[$id_category][$key], $key, $id_selected);
|
||||
}
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ class CategoryCore extends ObjectModel
|
||||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'category_product` WHERE `id_category` IN ('.$list.')');
|
||||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'category_group` WHERE `id_category` IN ('.$list.')');
|
||||
|
||||
self::cleanPositions($this->id_parent);
|
||||
Category::cleanPositions($this->id_parent);
|
||||
|
||||
/* Delete category images and its children images */
|
||||
$tmp_category = new Category();
|
||||
@@ -337,7 +337,7 @@ class CategoryCore extends ObjectModel
|
||||
|
||||
/* Rebuild the nested tree */
|
||||
if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree)
|
||||
self::regenerateEntireNtree();
|
||||
Category::regenerateEntireNtree();
|
||||
|
||||
Hook::exec('actionCategoryDelete', array('category' => $this));
|
||||
|
||||
@@ -395,7 +395,7 @@ class CategoryCore extends ObjectModel
|
||||
foreach ($categories as $category)
|
||||
$categories_array[(int)$category['id_parent']]['subcategories'][(int)$category['id_category']] = 1;
|
||||
$n = 1;
|
||||
self::_subTree($categories_array, 1, $n);
|
||||
Category::_subTree($categories_array, 1, $n);
|
||||
}
|
||||
|
||||
protected static function _subTree(&$categories, $id_category, &$n)
|
||||
@@ -403,7 +403,7 @@ class CategoryCore extends ObjectModel
|
||||
$left = (int)$n++;
|
||||
if (isset($categories[(int)$id_category]['subcategories']))
|
||||
foreach (array_keys($categories[(int)$id_category]['subcategories']) as $id_subcategory)
|
||||
self::_subTree($categories, (int)$id_subcategory, $n);
|
||||
Category::_subTree($categories, (int)$id_subcategory, $n);
|
||||
$right = (int)$n++;
|
||||
|
||||
Db::getInstance()->execute('
|
||||
@@ -660,7 +660,7 @@ class CategoryCore extends ObjectModel
|
||||
*/
|
||||
public static function getHomeCategories($id_lang, $active = true)
|
||||
{
|
||||
return self::getChildren(1, $id_lang, $active);
|
||||
return Category::getChildren(1, $id_lang, $active);
|
||||
}
|
||||
|
||||
public static function getRootCategory($id_lang = null, Shop $shop = null)
|
||||
|
||||
@@ -93,7 +93,7 @@ class ConfigurationCore extends ObjectModel
|
||||
*/
|
||||
public static function getIdByName($key, $shopGroupID = null, $shopID = null)
|
||||
{
|
||||
self::getShopFromContext($shopGroupID, $shopID);
|
||||
Configuration::getShopFromContext($shopGroupID, $shopID);
|
||||
$sql = 'SELECT id_configuration
|
||||
FROM '._DB_PREFIX_.'configuration
|
||||
WHERE name = \''.pSQL($key).'\''
|
||||
@@ -138,7 +138,7 @@ class ConfigurationCore extends ObjectModel
|
||||
*/
|
||||
static public function get($key, $langID = NULL, $shopGroupID = NULL, $shopID = NULL)
|
||||
{
|
||||
self::getShopFromContext($shopGroupID, $shopID);
|
||||
Configuration::getShopFromContext($shopGroupID, $shopID);
|
||||
$langID = (int)$langID;
|
||||
if (!isset(self::$_CONF[$langID]))
|
||||
$langID = 0;
|
||||
@@ -158,7 +158,7 @@ class ConfigurationCore extends ObjectModel
|
||||
|
||||
static public function getGlobalValue($key, $langID = NULL)
|
||||
{
|
||||
return self::get($key, $langID, 0, 0);
|
||||
return Configuration::get($key, $langID, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -174,7 +174,7 @@ class ConfigurationCore extends ObjectModel
|
||||
$languages = Language::getLanguages();
|
||||
$resultsArray = array();
|
||||
foreach ($languages as $language)
|
||||
$resultsArray[$language['id_lang']] = self::get($key, $language['id_lang'], $id_group_shop, $id_shop);
|
||||
$resultsArray[$language['id_lang']] = Configuration::get($key, $language['id_lang'], $id_group_shop, $id_shop);
|
||||
return $resultsArray;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ class ConfigurationCore extends ObjectModel
|
||||
throw new PrestaShopException('keys var is not an array');
|
||||
|
||||
$langID = (int)$langID;
|
||||
self::getShopFromContext($shopGroupID, $shopID);
|
||||
Configuration::getShopFromContext($shopGroupID, $shopID);
|
||||
|
||||
$results = array();
|
||||
foreach ($keys as $key)
|
||||
@@ -230,7 +230,7 @@ class ConfigurationCore extends ObjectModel
|
||||
{
|
||||
if (!Validate::isConfigName($key))
|
||||
die(Tools::displayError());
|
||||
self::getShopFromContext($id_group_shop, $id_shop);
|
||||
Configuration::getShopFromContext($id_group_shop, $id_shop);
|
||||
|
||||
if (!is_array($values))
|
||||
$values = array($values);
|
||||
@@ -273,7 +273,7 @@ class ConfigurationCore extends ObjectModel
|
||||
{
|
||||
if (!Validate::isConfigName($key))
|
||||
die(Tools::displayError());
|
||||
self::getShopFromContext($shopGroupID, $shopID);
|
||||
Configuration::getShopFromContext($shopGroupID, $shopID);
|
||||
|
||||
if (!is_array($values))
|
||||
$values = array($values);
|
||||
|
||||
@@ -94,7 +94,7 @@ class ConfigurationTestCore
|
||||
{
|
||||
$res = array();
|
||||
foreach ($tests as $key => $test)
|
||||
$res[$key] = self::run($key, $test);
|
||||
$res[$key] = ConfigurationTest::run($key, $test);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ class ConfigurationTestCore
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
if (is_dir($dir.DIRECTORY_SEPARATOR.$file) && $file != '.' && $file != '..' && $file != '.svn')
|
||||
if (!self::test_dir($relative_dir.DIRECTORY_SEPARATOR.$file, true))
|
||||
if (!ConfigurationTest::test_dir($relative_dir.DIRECTORY_SEPARATOR.$file, true))
|
||||
return false;
|
||||
}
|
||||
closedir($dh);
|
||||
@@ -193,98 +193,98 @@ class ConfigurationTestCore
|
||||
|
||||
public static function test_config_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
return ConfigurationTest::test_dir($dir);
|
||||
}
|
||||
|
||||
public static function test_sitemap($dir)
|
||||
{
|
||||
return self::test_file($dir);
|
||||
return ConfigurationTest::test_file($dir);
|
||||
}
|
||||
|
||||
public static function test_root_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
return ConfigurationTest::test_dir($dir);
|
||||
}
|
||||
|
||||
public static function test_log_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
return ConfigurationTest::test_dir($dir);
|
||||
}
|
||||
|
||||
public static function test_admin_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
return ConfigurationTest::test_dir($dir);
|
||||
}
|
||||
|
||||
public static function test_img_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir, true);
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
|
||||
public static function test_module_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir, true);
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
|
||||
public static function test_cache_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir, true);
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
|
||||
public static function test_tools_v2_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
return ConfigurationTest::test_dir($dir);
|
||||
}
|
||||
|
||||
public static function test_cache_v2_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
return ConfigurationTest::test_dir($dir);
|
||||
}
|
||||
|
||||
public static function test_download_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
return ConfigurationTest::test_dir($dir);
|
||||
}
|
||||
|
||||
public static function test_mails_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir, true);
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
|
||||
public static function test_translations_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir, true);
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
|
||||
public static function test_theme_lang_dir($dir)
|
||||
{
|
||||
if (!file_exists($dir))
|
||||
return true;
|
||||
return self::test_dir($dir, true);
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
|
||||
public static function test_theme_pdf_lang_dir($dir)
|
||||
{
|
||||
if (!file_exists($dir))
|
||||
return true;
|
||||
return self::test_dir($dir, true);
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
|
||||
public static function test_theme_cache_dir($dir)
|
||||
{
|
||||
if (!file_exists($dir))
|
||||
return true;
|
||||
return self::test_dir($dir, true);
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
|
||||
public static function test_customizable_products_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
return ConfigurationTest::test_dir($dir);
|
||||
}
|
||||
|
||||
public static function test_virtual_products_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
return ConfigurationTest::test_dir($dir);
|
||||
}
|
||||
|
||||
public static function test_mcrypt()
|
||||
|
||||
+1
-1
@@ -295,7 +295,7 @@ class CountryCore extends ObjectModel
|
||||
|
||||
public function isNeedDni()
|
||||
{
|
||||
return (bool)self::isNeedDniByCountryId($this->id);
|
||||
return Country::isNeedDniByCountryId($this->id);
|
||||
}
|
||||
|
||||
public static function isNeedDniByCountryId($id_country)
|
||||
|
||||
@@ -343,10 +343,10 @@ class CurrencyCore extends ObjectModel
|
||||
// Default feed currency (EUR)
|
||||
$isoCodeSource = strval($feed->source['iso_code']);
|
||||
|
||||
if (!$default_currency = self::getDefaultCurrency())
|
||||
if (!$default_currency = Currency::getDefaultCurrency())
|
||||
return Tools::displayError('No default currency');
|
||||
|
||||
$currencies = self::getCurrencies(true);
|
||||
$currencies = Currency::getCurrencies(true);
|
||||
foreach ($currencies as $currency)
|
||||
$currency->refreshCurrency($feed->list, $isoCodeSource, $default_currency);
|
||||
|
||||
|
||||
@@ -498,7 +498,7 @@ class CustomerCore extends ObjectModel
|
||||
// DEPRECATED
|
||||
public function customerIdExists($id_customer)
|
||||
{
|
||||
return self::customerIdExistsStatic((int)$id_customer);
|
||||
return Customer::customerIdExistsStatic((int)$id_customer);
|
||||
}
|
||||
|
||||
public static function customerIdExistsStatic($id_customer)
|
||||
@@ -559,7 +559,7 @@ class CustomerCore extends ObjectModel
|
||||
|
||||
public function getGroups()
|
||||
{
|
||||
return self::getGroupsStatic((int)$this->id);
|
||||
return Customer::getGroupsStatic((int)$this->id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -687,7 +687,7 @@ class CustomerCore extends ObjectModel
|
||||
return false;
|
||||
|
||||
/* Customer is valid only if it can be load and if object password is the same as database one */
|
||||
if ($this->logged == 1 && $this->id && Validate::isUnsignedId($this->id) && self::checkPassword($this->id, $this->passwd))
|
||||
if ($this->logged == 1 && $this->id && Validate::isUnsignedId($this->id) && Customer::checkPassword($this->id, $this->passwd))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ class DispatcherCore
|
||||
// FO dispatch
|
||||
if (!defined('_PS_ADMIN_DIR_'))
|
||||
{
|
||||
$controllers = self::getControllers($this->controller_directories);
|
||||
$controllers = Dispatcher::getControllers($this->controller_directories);
|
||||
if (!isset($controllers[$this->controller]))
|
||||
$this->controller = strtolower($this->controller_not_found);
|
||||
$controller_class = $controllers[$this->controller];
|
||||
@@ -306,7 +306,7 @@ class DispatcherCore
|
||||
else
|
||||
{
|
||||
// Get controller class name
|
||||
$controller_row = self::getAdminController($this->controller);
|
||||
$controller_row = Dispatcher::getAdminController($this->controller);
|
||||
if (empty($controller_row))
|
||||
{
|
||||
// We need controller_not_found to be the camelcase controller name
|
||||
@@ -318,7 +318,7 @@ class DispatcherCore
|
||||
|
||||
// If Tab/Controller is in module, include it
|
||||
if (!empty($controller_row['module']))
|
||||
$controller_type = self::includeModuleClass($controller_row['module'], $controller_class);
|
||||
$controller_type = Dispatcher::includeModuleClass($controller_row['module'], $controller_class);
|
||||
// If it is an AdminTab, include it
|
||||
else if (file_exists(_PS_ADMIN_DIR_.'/tabs/'.$controller_class.'.php'))
|
||||
{
|
||||
|
||||
@@ -255,7 +255,7 @@ class EmployeeCore extends ObjectModel
|
||||
case 1:
|
||||
if ($context->shop->checkIfShopExist($context->shop->id))
|
||||
{
|
||||
if (!in_array($context->shop->id, self::getEmployeeShopById($id_employee)))
|
||||
if (!in_array($context->shop->id, Employee::getEmployeeShopById($id_employee)))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -267,7 +267,7 @@ class EmployeeCore extends ObjectModel
|
||||
{
|
||||
$shops = $context->shop->getIdShopsByIdGroupShop($context->shop->getGroupID());
|
||||
foreach ($shops as $shop)
|
||||
if (!in_array($shop, self::getEmployeeShopById($id_employee)))
|
||||
if (!in_array($shop, Employee::getEmployeeShopById($id_employee)))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -276,7 +276,7 @@ class EmployeeCore extends ObjectModel
|
||||
|
||||
case 3:
|
||||
if ($context->employee->id_profile == _PS_ADMIN_PROFILE_ ||
|
||||
$context->shop->getTotalShopsWhoExists() == self::getTotalEmployeeShopById($id_employee))
|
||||
$context->shop->getTotalShopsWhoExists() == Employee::getTotalEmployeeShopById($id_employee))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
+1
-1
@@ -215,7 +215,7 @@ class FeatureCore extends ObjectModel
|
||||
if ($position)
|
||||
$feature->position = (int)$position;
|
||||
else
|
||||
$feature->position = self::getHigherPosition() + 1;
|
||||
$feature->position = Feature::getHigherPosition() + 1;
|
||||
$feature->add();
|
||||
return $feature->id;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class FileUploaderCore
|
||||
}
|
||||
}
|
||||
|
||||
private function toBytes($str)
|
||||
protected function toBytes($str)
|
||||
{
|
||||
$val = trim($str);
|
||||
$last = strtolower($str[strlen($str)-1]);
|
||||
|
||||
@@ -191,7 +191,7 @@ class FrontControllerCore extends Controller
|
||||
elseif (intval(Configuration::get('PS_GEOLOCATION_ENABLED')) AND
|
||||
!in_array(strtoupper($this->context->cookie->iso_code_country), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))) AND
|
||||
$cart->nbProducts() AND intval(Configuration::get('PS_GEOLOCATION_NA_BEHAVIOR')) != -1 AND
|
||||
!self::isInWhitelistForGeolocation())
|
||||
!FrontController::isInWhitelistForGeolocation())
|
||||
unset($this->context->cookie->id_cart, $cart);
|
||||
// update cart values
|
||||
elseif ($this->context->cookie->id_customer != $cart->id_customer OR $this->context->cookie->id_lang != $cart->id_lang OR $currency->id != $cart->id_currency)
|
||||
@@ -595,7 +595,7 @@ class FrontControllerCore extends Controller
|
||||
|
||||
if (is_object($record))
|
||||
{
|
||||
if (!in_array(strtoupper($record->country_code), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))) AND !self::isInWhitelistForGeolocation())
|
||||
if (!in_array(strtoupper($record->country_code), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))) && !FrontController::isInWhitelistForGeolocation())
|
||||
{
|
||||
if (Configuration::get('PS_GEOLOCATION_BEHAVIOR') == _PS_GEOLOCATION_NO_CATALOG_)
|
||||
$this->restrictedCountry = true;
|
||||
|
||||
+3
-3
@@ -123,7 +123,7 @@ class GroupCore extends ObjectModel
|
||||
|
||||
public static function getPriceDisplayMethod($id_group)
|
||||
{
|
||||
if (!isset(self::$group_price_display_method[$id_group]))
|
||||
if (!isset(Group::$group_price_display_method[$id_group]))
|
||||
self::$group_price_display_method[$id_group] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `price_display_method`
|
||||
FROM `'._DB_PREFIX_.'group`
|
||||
@@ -133,7 +133,7 @@ class GroupCore extends ObjectModel
|
||||
|
||||
public static function getDefaultPriceDisplayMethod()
|
||||
{
|
||||
return self::getPriceDisplayMethod((int)Configuration::get('PS_CUSTOMER_GROUP'));
|
||||
return Group::getPriceDisplayMethod((int)Configuration::get('PS_CUSTOMER_GROUP'));
|
||||
}
|
||||
|
||||
public function add($autodate = true, $null_values = false)
|
||||
@@ -163,7 +163,7 @@ class GroupCore extends ObjectModel
|
||||
$this->truncateModulesRestrictions($this->id);
|
||||
|
||||
// Refresh cache of feature detachable
|
||||
Configuration::updateGlobalValue('PS_GROUP_FEATURE_ACTIVE', self::isCurrentlyUsed());
|
||||
Configuration::updateGlobalValue('PS_GROUP_FEATURE_ACTIVE', Group::isCurrentlyUsed());
|
||||
|
||||
// Add default group (id 3) to customers without groups
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'customer_group` (
|
||||
|
||||
+4
-4
@@ -250,12 +250,12 @@ class ImageCore extends ObjectModel
|
||||
if (file_exists(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'.jpg'))
|
||||
copy(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'.jpg', $new_path.'.jpg');
|
||||
|
||||
self::replaceAttributeImageAssociationId($combination_images, (int)$image_old->id, (int)$image_new->id);
|
||||
Image::replaceAttributeImageAssociationId($combination_images, (int)$image_old->id, (int)$image_new->id);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return self::duplicateAttributeImageAssociations($combination_images);
|
||||
return Image::duplicateAttributeImageAssociations($combination_images);
|
||||
}
|
||||
|
||||
protected static function replaceAttributeImageAssociationId(&$combination_images, $saved_id, $id_image)
|
||||
@@ -451,7 +451,7 @@ class ImageCore extends ObjectModel
|
||||
if (preg_match('/^[0-9]+(\-(.*))?\.'.$format.'$/', $file))
|
||||
unlink($path.$file);
|
||||
else if (is_dir($path.$file) && (preg_match('/^[0-9]$/', $file)))
|
||||
self::deleteAllImages($path.$file.'/', $format);
|
||||
Image::deleteAllImages($path.$file.'/', $format);
|
||||
}
|
||||
|
||||
// Can we remove the image folder?
|
||||
@@ -509,7 +509,7 @@ class ImageCore extends ObjectModel
|
||||
return false;
|
||||
|
||||
if (!$this->folder)
|
||||
$this->folder = self::getImgFolderStatic($this->id);
|
||||
$this->folder = Image::getImgFolderStatic($this->id);
|
||||
|
||||
return $this->folder;
|
||||
}
|
||||
|
||||
+18
-17
@@ -106,7 +106,7 @@ class LanguageCore extends ObjectModel
|
||||
* Generate traslations files
|
||||
*
|
||||
*/
|
||||
private function _generateFiles($newIso = null)
|
||||
protected function _generateFiles($newIso = null)
|
||||
{
|
||||
$iso_code = $newIso?$newIso:$this->iso_code;
|
||||
|
||||
@@ -165,7 +165,7 @@ class LanguageCore extends ObjectModel
|
||||
* @return array([theme dir] => array('name' => [theme name]))
|
||||
* @deprecated will be removed in 1.6
|
||||
*/
|
||||
private function _getThemesList()
|
||||
protected function _getThemesList()
|
||||
{
|
||||
Tools::displayAsDeprecated();
|
||||
static $themes = array();
|
||||
@@ -204,7 +204,7 @@ class LanguageCore extends ObjectModel
|
||||
|
||||
public function checkFiles()
|
||||
{
|
||||
return self::checkFilesWithIsoCode($this->iso_code);
|
||||
return Language::checkFilesWithIsoCode($this->iso_code);
|
||||
}
|
||||
|
||||
|
||||
@@ -218,9 +218,10 @@ class LanguageCore extends ObjectModel
|
||||
*/
|
||||
public static function checkFilesWithIsoCode($iso_code)
|
||||
{
|
||||
if (isset(self::$_checkedLangs[$iso_code]) AND self::$_checkedLangs[$iso_code])
|
||||
if (isset(self::$_checkedLangs[$iso_code]) && self::$_checkedLangs[$iso_code])
|
||||
return true;
|
||||
foreach (array_keys(self::getFilesList($iso_code, _THEME_NAME_, false, false, false, true)) as $key)
|
||||
|
||||
foreach (array_keys(Language::getFilesList($iso_code, _THEME_NAME_, false, false, false, true)) as $key)
|
||||
if (!file_exists($key))
|
||||
return false;
|
||||
self::$_checkedLangs[$iso_code] = true;
|
||||
@@ -390,7 +391,7 @@ class LanguageCore extends ObjectModel
|
||||
if ($file != '.' && $file != '..')
|
||||
{
|
||||
if (is_dir($dir.'/'.$file))
|
||||
self::recurseDeleteDir($dir.'/'.$file);
|
||||
Language::recurseDeleteDir($dir.'/'.$file);
|
||||
elseif (file_exists($dir.'/'.$file))
|
||||
@unlink($dir.'/'.$file);
|
||||
}
|
||||
@@ -402,7 +403,7 @@ class LanguageCore extends ObjectModel
|
||||
public function delete()
|
||||
{
|
||||
if (empty($this->iso_code))
|
||||
$this->iso_code = self::getIsoById($this->id);
|
||||
$this->iso_code = Language::getIsoById($this->id);
|
||||
|
||||
// Database translations deletion
|
||||
$result = Db::getInstance()->executeS('SHOW TABLES FROM `'._DB_NAME_.'`');
|
||||
@@ -418,30 +419,30 @@ class LanguageCore extends ObjectModel
|
||||
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'search_word WHERE id_lang = '.(int)($this->id));
|
||||
|
||||
// Files deletion
|
||||
foreach (self::getFilesList($this->iso_code, _THEME_NAME_, false, false, false, true, true) as $key => $file)
|
||||
foreach (Language::getFilesList($this->iso_code, _THEME_NAME_, false, false, false, true, true) as $key => $file)
|
||||
if (file_exists($key))
|
||||
unlink($key);
|
||||
$modList = scandir(_PS_MODULE_DIR_);
|
||||
foreach ($modList as $mod)
|
||||
{
|
||||
self::recurseDeleteDir(_PS_MODULE_DIR_.$mod.'/mails/'.$this->iso_code);
|
||||
Language::recurseDeleteDir(_PS_MODULE_DIR_.$mod.'/mails/'.$this->iso_code);
|
||||
$files = @scandir(_PS_MODULE_DIR_.$mod.'/mails/');
|
||||
if (count($files) <= 2)
|
||||
self::recurseDeleteDir(_PS_MODULE_DIR_.$mod.'/mails/');
|
||||
Language::recurseDeleteDir(_PS_MODULE_DIR_.$mod.'/mails/');
|
||||
|
||||
if(file_exists(_PS_MODULE_DIR_.$mod.'/'.$this->iso_code.'.php'))
|
||||
{
|
||||
unlink(_PS_MODULE_DIR_.$mod.'/'.$this->iso_code.'.php');
|
||||
$files = @scandir(_PS_MODULE_DIR_.$mod);
|
||||
if (count($files) <= 2)
|
||||
self::recurseDeleteDir(_PS_MODULE_DIR_.$mod);
|
||||
Language::recurseDeleteDir(_PS_MODULE_DIR_.$mod);
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists(_PS_MAIL_DIR_.$this->iso_code))
|
||||
self::recurseDeleteDir(_PS_MAIL_DIR_.$this->iso_code);
|
||||
Language::recurseDeleteDir(_PS_MAIL_DIR_.$this->iso_code);
|
||||
if (file_exists(_PS_TRANSLATIONS_DIR_.$this->iso_code))
|
||||
self::recurseDeleteDir(_PS_TRANSLATIONS_DIR_.$this->iso_code);
|
||||
Language::recurseDeleteDir(_PS_TRANSLATIONS_DIR_.$this->iso_code);
|
||||
if (!parent::delete())
|
||||
return false;
|
||||
|
||||
@@ -488,7 +489,7 @@ class LanguageCore extends ObjectModel
|
||||
public static function getLanguages($active = true, $id_shop = false)
|
||||
{
|
||||
if (!self::$_LANGUAGES)
|
||||
self::loadLanguages();
|
||||
Language::loadLanguages();
|
||||
|
||||
$languages = array();
|
||||
foreach (self::$_LANGUAGES AS $language)
|
||||
@@ -641,13 +642,13 @@ class LanguageCore extends ObjectModel
|
||||
fclose($file);
|
||||
}
|
||||
else
|
||||
self::_copyNoneFlag($insert_id);
|
||||
Language::_copyNoneFlag($insert_id);
|
||||
}
|
||||
else
|
||||
self::_copyNoneFlag($insert_id);
|
||||
Language::_copyNoneFlag($insert_id);
|
||||
}
|
||||
else
|
||||
self::_copyNoneFlag($insert_id);
|
||||
Language::_copyNoneFlag($insert_id);
|
||||
|
||||
$files_copy = array('/en.jpg', '/en-default-thickbox.jpg', '/en-default-home.jpg', '/en-default-large.jpg', '/en-default-medium.jpg', '/en-default-small.jpg', '/en-default-large_scene.jpg');
|
||||
$tos = array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_);
|
||||
|
||||
+2
-2
@@ -113,7 +113,7 @@ class LoggerCore extends ObjectModel
|
||||
$log->object_id = intval($object_id);
|
||||
}
|
||||
|
||||
self::sendByMail($log);
|
||||
Logger::sendByMail($log);
|
||||
|
||||
if ($allow_duplicate || !$log->_isPresent())
|
||||
{
|
||||
@@ -145,7 +145,7 @@ class LoggerCore extends ObjectModel
|
||||
*
|
||||
* @return true if exists
|
||||
*/
|
||||
private function _isPresent()
|
||||
protected function _isPresent()
|
||||
{
|
||||
if (!isset(self::$is_present[md5($this->message)]))
|
||||
self::$is_present[$this->getHash()] = Db::getInstance()->getValue('SELECT COUNT(*)
|
||||
|
||||
@@ -134,7 +134,7 @@ class ManufacturerCore extends ObjectModel
|
||||
foreach ($selection as $id)
|
||||
{
|
||||
$this->id = (int)$id;
|
||||
$this->id_address = self::getManufacturerAddress();
|
||||
$this->id_address = Manufacturer::getManufacturerAddress();
|
||||
$result = $result && $this->delete();
|
||||
}
|
||||
|
||||
|
||||
+19
-19
@@ -137,7 +137,7 @@ class MediaCore
|
||||
public static function packJSinHTMLpregCallback($preg_matches)
|
||||
{
|
||||
$preg_matches[1] = $preg_matches[1].'/* <![CDATA[ */';
|
||||
$preg_matches[2] = self::packJS($preg_matches[2]);
|
||||
$preg_matches[2] = Media::packJS($preg_matches[2]);
|
||||
$preg_matches[count($preg_matches)-1] = '/* ]]> */'.$preg_matches[count($preg_matches)-1];
|
||||
unset($preg_matches[0]);
|
||||
$output = implode('', $preg_matches);
|
||||
@@ -275,12 +275,12 @@ class MediaCore
|
||||
|
||||
$return = array();
|
||||
if (file_exists($file_uri))
|
||||
$return[] = self::getJSPath($file);
|
||||
$return[] = Media::getJSPath($file);
|
||||
else
|
||||
$return[] = self::getJSPath(Tools::getCurrentUrlProtocolPrefix().'ajax.googleapis.com/ajax/libs/jquery/'.$version.'/jquery'.($minifier ? '.min.js' : '.js'));
|
||||
|
||||
$return[] = Media::getJSPath(Tools::getCurrentUrlProtocolPrefix().'ajax.googleapis.com/ajax/libs/jquery/'.$version.'/jquery'.($minifier ? '.min.js' : '.js'));
|
||||
|
||||
if ($addNoConflict)
|
||||
$return[] = self::getJSPath(_PS_JS_DIR_.'jquery/jquery.noConflict.php?version='.$version);
|
||||
$return[] = Media::getJSPath(_PS_JS_DIR_.'jquery/jquery.noConflict.php?version='.$version);
|
||||
|
||||
return $return;
|
||||
}
|
||||
@@ -300,13 +300,13 @@ class MediaCore
|
||||
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
|
||||
$ui_tmp = array();
|
||||
if ($check_dependencies && array_key_exists($component, self::$jquery_ui_dependencies))
|
||||
foreach(self::$jquery_ui_dependencies[$component]['dependencies'] as $dependency)
|
||||
$ui_tmp[] = self::getJqueryUIPath($dependency, $theme, false);
|
||||
foreach (self::$jquery_ui_dependencies[$component]['dependencies'] as $dependency)
|
||||
$ui_tmp[] = Media::getJqueryUIPath($dependency, $theme, false);
|
||||
|
||||
if (self::$jquery_ui_dependencies[$component]['theme'] AND $check_dependencies)
|
||||
{
|
||||
$theme_css = self::getCSSPath($folder.'themes/'.$theme.'/jquery.ui.theme.css');
|
||||
$comp_css = self::getCSSPath($folder.'themes/'.$theme.'/jquery.'.$component.'.css');
|
||||
$theme_css = Media::getCSSPath($folder.'themes/'.$theme.'/jquery.ui.theme.css');
|
||||
$comp_css = Media::getCSSPath($folder.'themes/'.$theme.'/jquery.'.$component.'.css');
|
||||
if (!empty($theme_css) OR $theme_css)
|
||||
$ui_path['css'] = array_merge($ui_path['css'], $theme_css);
|
||||
if (!empty($comp_css) OR $comp_css)
|
||||
@@ -323,15 +323,15 @@ class MediaCore
|
||||
$ui_path['js'][] = $ui['js'];
|
||||
$ui_path['css'][] = $ui['css'];
|
||||
}
|
||||
$ui_path['js'][] = self::getJSPath($folder.$file);
|
||||
$ui_path['js'][] = Media::getJSPath($folder.$file);
|
||||
}
|
||||
else
|
||||
$ui_path['js'] = self::getJSPath($folder.$file);
|
||||
$ui_path['js'] = Media::getJSPath($folder.$file);
|
||||
}
|
||||
|
||||
//add i18n file for datepicker
|
||||
if ($component == 'ui.datepicker')
|
||||
$ui_path['js'][] = self::getJSPath($folder.'i18n/jquery.ui.datepicker-'.Context::getContext()->language->iso_code.'.js');
|
||||
$ui_path['js'][] = Media::getJSPath($folder.'i18n/jquery.ui.datepicker-'.Context::getContext()->language->iso_code.'.js');
|
||||
|
||||
return $ui_path;
|
||||
}
|
||||
@@ -352,12 +352,12 @@ class MediaCore
|
||||
$url_data = parse_url($folder);
|
||||
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
|
||||
if (file_exists($file_uri.$file))
|
||||
$plugin_path['js'] = self::getJSPath($folder.$file);
|
||||
$plugin_path['js'] = Media::getJSPath($folder.$file);
|
||||
else if (file_exists($file_uri.$name.'/'.$file))
|
||||
$plugin_path['js'] = self::getJSPath($folder.$name.'/'.$file);
|
||||
$plugin_path['js'] = Media::getJSPath($folder.$name.'/'.$file);
|
||||
else
|
||||
return false;
|
||||
$plugin_path['css'] = self::getJqueryPluginCSSPath($name);
|
||||
$plugin_path['css'] = Media::getJqueryPluginCSSPath($name);
|
||||
return $plugin_path;
|
||||
}
|
||||
|
||||
@@ -375,9 +375,9 @@ class MediaCore
|
||||
$url_data = parse_url($folder);
|
||||
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
|
||||
if (file_exists($file_uri.$file))
|
||||
return self::getCSSPath($folder.$file);
|
||||
return Media::getCSSPath($folder.$file);
|
||||
else if (file_exists($file_uri.$name.'/'.$file))
|
||||
return self::getCSSPath($folder.$name.'/'.$file);
|
||||
return Media::getCSSPath($folder.$name.'/'.$file);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
@@ -442,7 +442,7 @@ class MediaCore
|
||||
foreach ($media_infos['files'] as $file_infos)
|
||||
{
|
||||
if (file_exists($file_infos['path']))
|
||||
$compressed_css_files[$media] .= self::minifyCSS(file_get_contents($file_infos['path']), $file_infos['uri'], $import_url);
|
||||
$compressed_css_files[$media] .= Media::minifyCSS(file_get_contents($file_infos['path']), $file_infos['uri'], $import_url);
|
||||
else
|
||||
$compressed_css_files_not_found[] = $file_infos['path'];
|
||||
}
|
||||
@@ -528,7 +528,7 @@ class MediaCore
|
||||
else
|
||||
$compressed_js_files_not_found[] = $file_infos['path'];
|
||||
}
|
||||
$content = self::packJS($content);
|
||||
$content = Media::packJS($content);
|
||||
|
||||
if (!empty($compressed_js_files_not_found))
|
||||
$content = '/* WARNING ! file(s) not found : "'.
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ class MetaCore extends ObjectModel
|
||||
// Exclude page already filled
|
||||
if ($excludeFilled)
|
||||
{
|
||||
$metas = self::getMetas();
|
||||
$metas = Meta::getMetas();
|
||||
foreach ($metas as $meta)
|
||||
if (in_array($meta['page'], $selectedPages))
|
||||
unset($selectedPages[array_search($meta['page'], $selectedPages)]);
|
||||
|
||||
+10
-10
@@ -256,7 +256,7 @@ abstract class ModuleCore
|
||||
*
|
||||
* @param $upgrade_detail
|
||||
*/
|
||||
private function setUpgradeMessage($upgrade_detail)
|
||||
protected function setUpgradeMessage($upgrade_detail)
|
||||
{
|
||||
// Store information if a module has been upgraded (memory optimization)
|
||||
if ($upgrade_detail['available_upgrade'])
|
||||
@@ -390,7 +390,7 @@ abstract class ModuleCore
|
||||
* @param $registered_version
|
||||
* @return bool to know directly if any files have been found
|
||||
*/
|
||||
private static function loadUpgradeVersionList($module_name, $module_version, $registered_version)
|
||||
protected static function loadUpgradeVersionList($module_name, $module_version, $registered_version)
|
||||
{
|
||||
$list = array();
|
||||
|
||||
@@ -844,7 +844,7 @@ abstract class ModuleCore
|
||||
$errors = array();
|
||||
|
||||
// Get modules directory list and memory limit
|
||||
$modules_dir = self::getModulesDirOnDisk();
|
||||
$modules_dir = Module::getModulesDirOnDisk();
|
||||
$memory_limit = Tools::getMemoryLimit();
|
||||
|
||||
foreach ($modules_dir as $module)
|
||||
@@ -893,12 +893,12 @@ abstract class ModuleCore
|
||||
$item->warning = '';
|
||||
foreach ($xml_module as $k => $v)
|
||||
$item->$k = (string) $v;
|
||||
$item->displayName = Module::findTranslation($xml_module->name, self::configXmlStringFormat($xml_module->displayName), (string)$xml_module->name);
|
||||
$item->description = Module::findTranslation($xml_module->name, self::configXmlStringFormat($xml_module->description), (string)$xml_module->name);
|
||||
$item->author = Module::findTranslation($xml_module->name, self::configXmlStringFormat($xml_module->author), (string)$xml_module->name);
|
||||
$item->displayName = Module::findTranslation($xml_module->name, Module::configXmlStringFormat($xml_module->displayName), (string)$xml_module->name);
|
||||
$item->description = Module::findTranslation($xml_module->name, Module::configXmlStringFormat($xml_module->description), (string)$xml_module->name);
|
||||
$item->author = Module::findTranslation($xml_module->name, Module::configXmlStringFormat($xml_module->author), (string)$xml_module->name);
|
||||
|
||||
if (isset($xml_module->confirmUninstall))
|
||||
$item->confirmUninstall = Module::findTranslation($xml_module->name, self::configXmlStringFormat($xml_module->confirmUninstall), (string)$xml_module->name);
|
||||
$item->confirmUninstall = Module::findTranslation($xml_module->name, Module::configXmlStringFormat($xml_module->confirmUninstall), (string)$xml_module->name);
|
||||
|
||||
$item->active = 0;
|
||||
$moduleList[] = $item;
|
||||
@@ -1438,12 +1438,12 @@ abstract class ModuleCore
|
||||
|
||||
protected function _isTemplateOverloaded($template)
|
||||
{
|
||||
return self::_isTemplateOverloadedStatic($this->name, $template);
|
||||
return Module::_isTemplateOverloadedStatic($this->name, $template);
|
||||
}
|
||||
|
||||
public function display($file, $template, $cacheId = null, $compileId = null)
|
||||
{
|
||||
if (($overloaded = self::_isTemplateOverloadedStatic(basename($file, '.php'), $template)) === NULL)
|
||||
if (($overloaded = Module::_isTemplateOverloadedStatic(basename($file, '.php'), $template)) === null)
|
||||
$result = Tools::displayError('No template found for module').' '.basename($file,'.php');
|
||||
else
|
||||
{
|
||||
@@ -1532,7 +1532,7 @@ abstract class ModuleCore
|
||||
*/
|
||||
public function getPermission($variable, $employee = null)
|
||||
{
|
||||
return self::getPermissionStatic($this->id, $variable, $employee);
|
||||
return Module::getPermissionStatic($this->id, $variable, $employee);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -306,12 +306,12 @@ abstract class ModuleGraphCore extends Module
|
||||
|
||||
public function getDate()
|
||||
{
|
||||
return self::getDateBetween($this->_employee);
|
||||
return ModuleGraph::getDateBetween($this->_employee);
|
||||
}
|
||||
|
||||
public static function getDateBetween($employee = null)
|
||||
{
|
||||
$employee = self::getEmployee($employee);
|
||||
$employee = ModuleGraph::getEmployee($employee);
|
||||
return ' \''.$employee->stats_date_from.' 00:00:00\' AND \''.$employee->stats_date_to.' 23:59:59\' ';
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -33,7 +33,7 @@ class PackCore extends Product
|
||||
|
||||
public static function isPack($id_product)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!Pack::isFeatureActive())
|
||||
return false;
|
||||
|
||||
if (!array_key_exists($id_product, self::$cacheIsPack))
|
||||
@@ -46,7 +46,7 @@ class PackCore extends Product
|
||||
|
||||
public static function isPacked($id_product)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!Pack::isFeatureActive())
|
||||
return false;
|
||||
|
||||
if (!array_key_exists($id_product, self::$cacheIsPacked))
|
||||
@@ -61,7 +61,7 @@ class PackCore extends Product
|
||||
{
|
||||
$sum = 0;
|
||||
$price_display_method = !self::$_taxCalculationMethod;
|
||||
$items = self::getItems($id_product, Configuration::get('PS_LANG_DEFAULT'));
|
||||
$items = Pack::getItems($id_product, Configuration::get('PS_LANG_DEFAULT'));
|
||||
foreach ($items as $item)
|
||||
$sum += $item->getPrice($price_display_method) * $item->pack_quantity;
|
||||
return $sum;
|
||||
@@ -69,7 +69,7 @@ class PackCore extends Product
|
||||
|
||||
public static function getItems($id_product, $id_lang)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!Pack::isFeatureActive())
|
||||
return array();
|
||||
|
||||
if (array_key_exists($id_product, self::$cachePackItems))
|
||||
@@ -89,10 +89,10 @@ class PackCore extends Product
|
||||
|
||||
public static function isInStock($id_product)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!Pack::isFeatureActive())
|
||||
return true;
|
||||
|
||||
$items = self::getItems((int)$id_product, Configuration::get('PS_LANG_DEFAULT'));
|
||||
$items = Pack::getItems((int)$id_product, Configuration::get('PS_LANG_DEFAULT'));
|
||||
|
||||
foreach ($items as $item)
|
||||
{
|
||||
@@ -105,7 +105,7 @@ class PackCore extends Product
|
||||
|
||||
public static function getItemTable($id_product, $id_lang, $full = false)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!Pack::isFeatureActive())
|
||||
return array();
|
||||
|
||||
$sql = 'SELECT p.*, pl.*, i.`id_image`, il.`legend`, t.`rate`, cl.`name` AS category_default, a.quantity AS pack_quantity
|
||||
@@ -134,7 +134,7 @@ class PackCore extends Product
|
||||
|
||||
public static function getPacksTable($id_product, $id_lang, $full = false, $limit = null)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!Pack::isFeatureActive())
|
||||
return array();
|
||||
|
||||
$packs = Db::getInstance()->getValue('
|
||||
@@ -176,7 +176,7 @@ class PackCore extends Product
|
||||
{
|
||||
return Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'product SET cache_is_pack = 0 WHERE id_product = '.(int)($id_product).' LIMIT 1') &&
|
||||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'pack` WHERE `id_product_pack` = '.(int)($id_product)) &&
|
||||
Configuration::updateGlobalValue('PS_PACK_FEATURE_ACTIVE', self::isCurrentlyUsed());
|
||||
Configuration::updateGlobalValue('PS_PACK_FEATURE_ACTIVE', Pack::isCurrentlyUsed());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,7 +240,7 @@ class PackCore extends Product
|
||||
if (!Pack::isPack($id_product))
|
||||
return false;
|
||||
|
||||
$products = self::getItems($id_product, Configuration::get('PS_LANG_DEFAULT'));
|
||||
$products = Pack::getItems($id_product, Configuration::get('PS_LANG_DEFAULT'));
|
||||
foreach ($products as $product)
|
||||
{
|
||||
// if one product uses the advanced stock management
|
||||
|
||||
@@ -483,7 +483,7 @@ abstract class PaymentModuleCore extends Module
|
||||
* @param Object Address $the_address that needs to be txt formated
|
||||
* @return String the txt formated address block
|
||||
*/
|
||||
private function _getTxtFormatedAddress($the_address)
|
||||
protected function _getTxtFormatedAddress($the_address)
|
||||
{
|
||||
$out = '';
|
||||
$adr_fields = AddressFormat::getOrderedAddressFields($the_address->id_country, false, true);
|
||||
@@ -508,7 +508,7 @@ abstract class PaymentModuleCore extends Module
|
||||
* @return String the txt formated address block
|
||||
*/
|
||||
|
||||
private function _getFormatedAddress(Address $the_address, $line_sep, $fields_style = array())
|
||||
protected function _getFormatedAddress(Address $the_address, $line_sep, $fields_style = array())
|
||||
{
|
||||
return AddressFormat::generateAddress($the_address, array('avoid' => array()), $line_sep, ' ', $fields_style);
|
||||
}
|
||||
@@ -517,7 +517,7 @@ abstract class PaymentModuleCore extends Module
|
||||
* @param int $id_currency : this parameter is optionnal but on 1.5 version of Prestashop, it will be REQUIRED
|
||||
* @return Currency
|
||||
*/
|
||||
public function getCurrency($current_id_currency = NULL)
|
||||
public function getCurrency($current_id_currency = null)
|
||||
{
|
||||
if (!(int)$current_id_currency)
|
||||
$current_id_currency = Context::getContext()->currency->id;
|
||||
|
||||
+13
-13
@@ -461,7 +461,7 @@ class ProductCore extends ObjectModel
|
||||
public static function getTaxCalculationMethod($id_customer = null)
|
||||
{
|
||||
if ($id_customer)
|
||||
self::initPricesComputation((int)$id_customer);
|
||||
Product::initPricesComputation((int)$id_customer);
|
||||
return (int)self::$_taxCalculationMethod;
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@ class ProductCore extends ObjectModel
|
||||
|
||||
public static function updateDefaultAttribute($id_product)
|
||||
{
|
||||
$id_product_attribute = self::getDefaultAttribute($id_product);
|
||||
$id_product_attribute = Product::getDefaultAttribute($id_product);
|
||||
Db::getInstance()->execute(
|
||||
'UPDATE '._DB_PREFIX_.'product
|
||||
SET cache_default_attribute = '.(int)$id_product_attribute.'
|
||||
@@ -1874,7 +1874,7 @@ class ProductCore extends ObjectModel
|
||||
$context = Context::getContext();
|
||||
|
||||
$current_date = date('Y-m-d H:i:s');
|
||||
$ids_product = self::_getProductIdByDate((!$beginning ? $current_date : $beginning), (!$ending ? $current_date : $ending), $context);
|
||||
$ids_product = Product::_getProductIdByDate((!$beginning ? $current_date : $beginning), (!$ending ? $current_date : $ending), $context);
|
||||
|
||||
$groups = FrontController::getCurrentCustomerGroups();
|
||||
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||
@@ -1945,7 +1945,7 @@ class ProductCore extends ObjectModel
|
||||
if (!Validate::isOrderBy($order_by) || !Validate::isOrderWay($order_way))
|
||||
die (Tools::displayError());
|
||||
$current_date = date('Y-m-d H:i:s');
|
||||
$ids_product = self::_getProductIdByDate((!$beginning ? $current_date : $beginning), (!$ending ? $current_date : $ending), $context);
|
||||
$ids_product = Product::_getProductIdByDate((!$beginning ? $current_date : $beginning), (!$ending ? $current_date : $ending), $context);
|
||||
|
||||
$groups = FrontController::getCurrentCustomerGroups();
|
||||
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||
@@ -2671,9 +2671,9 @@ class ProductCore extends ObjectModel
|
||||
foreach ($products_pack as $product_pack)
|
||||
{
|
||||
$tab_product_pack['id_product'] = (int)($product_pack->id);
|
||||
$tab_product_pack['id_product_attribute'] = self::getDefaultAttribute($tab_product_pack['id_product'], 1);
|
||||
$tab_product_pack['id_product_attribute'] = Product::getDefaultAttribute($tab_product_pack['id_product'], 1);
|
||||
$tab_product_pack['cart_quantity'] = (int)($product_pack->pack_quantity * $product['cart_quantity']);
|
||||
self::updateQuantity($tab_product_pack);
|
||||
Product::updateQuantity($tab_product_pack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2962,7 +2962,7 @@ class ProductCore extends ObjectModel
|
||||
*/
|
||||
public function getFeatures()
|
||||
{
|
||||
return self::getFeaturesStatic((int)$this->id);
|
||||
return Product::getFeaturesStatic((int)$this->id);
|
||||
}
|
||||
|
||||
public static function getFeaturesStatic($id_product)
|
||||
@@ -3107,7 +3107,7 @@ class ProductCore extends ObjectModel
|
||||
$return &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'product_attribute', $row, 'INSERT');
|
||||
|
||||
$id_product_attribute_new = (int)Db::getInstance()->Insert_ID();
|
||||
if ($result_images = self::_getAttributeImageAssociations($id_product_attribute_old))
|
||||
if ($result_images = Product::_getAttributeImageAssociations($id_product_attribute_old))
|
||||
{
|
||||
$combination_images['old'][$id_product_attribute_old] = $result_images;
|
||||
$combination_images['new'][$id_product_attribute_new] = $result_images;
|
||||
@@ -3289,7 +3289,7 @@ class ProductCore extends ObjectModel
|
||||
// If customization is not activated, return success
|
||||
if (!Customization::isFeatureActive())
|
||||
return true;
|
||||
if (($customizations = self::_getCustomizationFieldsNLabels($old_product_id)) === false)
|
||||
if (($customizations = Product::_getCustomizationFieldsNLabels($old_product_id)) === false)
|
||||
return false;
|
||||
if (empty($customizations))
|
||||
return true;
|
||||
@@ -3526,7 +3526,7 @@ class ProductCore extends ObjectModel
|
||||
|
||||
public function getFrontFeatures($id_lang)
|
||||
{
|
||||
return self::getFrontFeaturesStatic($id_lang, $this->id);
|
||||
return Product::getFrontFeaturesStatic($id_lang, $this->id);
|
||||
}
|
||||
|
||||
public static function getAttachmentsStatic($id_lang, $id_product)
|
||||
@@ -3541,7 +3541,7 @@ class ProductCore extends ObjectModel
|
||||
|
||||
public function getAttachments($id_lang)
|
||||
{
|
||||
return self::getAttachmentsStatic($id_lang, $this->id);
|
||||
return Product::getAttachmentsStatic($id_lang, $this->id);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4066,7 +4066,7 @@ class ProductCore extends ObjectModel
|
||||
*/
|
||||
public function getWsDefaultCombination()
|
||||
{
|
||||
return self::getDefaultAttribute($this->id);
|
||||
return Product::getDefaultAttribute($this->id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4636,7 +4636,7 @@ class ProductCore extends ObjectModel
|
||||
if (is_null($id_shop))
|
||||
$id_shop = Context::getContext()->shop->getID(true);
|
||||
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && self::usesAdvancedStockManagement($id_product) &&
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && Product::usesAdvancedStockManagement($id_product) &&
|
||||
StockAvailable::dependsOnStock($id_product, $id_shop))
|
||||
return $manager->getProductRealQuantities($id_product, $id_product_attribute, $id_warehouse, true);
|
||||
else
|
||||
|
||||
@@ -120,7 +120,7 @@ class ProductDownloadCore extends ObjectModel
|
||||
if (parent::update($nullValues))
|
||||
{
|
||||
// Refresh cache of feature detachable because the row can be deactive
|
||||
Configuration::updateGlobalValue('PS_VIRTUAL_PROD_FEATURE_ACTIVE', self::isCurrentlyUsed($this->def['table'], true));
|
||||
Configuration::updateGlobalValue('PS_VIRTUAL_PROD_FEATURE_ACTIVE', ProductDownload::isCurrentlyUsed($this->def['table'], true));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -178,7 +178,7 @@ class ProductDownloadCore extends ObjectModel
|
||||
*/
|
||||
public static function getIdFromIdProduct($id_product)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!ProductDownload::isFeatureActive())
|
||||
return false;
|
||||
if (array_key_exists($id_product, self::$_productIds))
|
||||
return self::$_productIds[$id_product];
|
||||
@@ -200,7 +200,7 @@ class ProductDownloadCore extends ObjectModel
|
||||
*/
|
||||
public static function getIdFromIdAttribute($id_product, $id_product_attribute)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!ProductDownload::isFeatureActive())
|
||||
return false;
|
||||
if (array_key_exists($id_product_attribute, self::$_productIds))
|
||||
return self::$_productIds[$id_product];
|
||||
|
||||
@@ -179,7 +179,7 @@ class ProductSaleCore
|
||||
|
||||
public static function removeProductSale($id_product, $qty = 1)
|
||||
{
|
||||
$nbrSales = self::getNbrSales($id_product);
|
||||
$nbrSales = ProductSale::getNbrSales($id_product);
|
||||
if ($nbrSales > 1)
|
||||
return Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'product_sale SET `quantity` = `quantity` - '.(int)($qty).', `sale_nbr` = `sale_nbr` - 1, `date_upd` = NOW() WHERE `id_product` = '.(int)($id_product));
|
||||
elseif ($nbrSales == 1)
|
||||
|
||||
@@ -98,7 +98,7 @@ class ProductSupplierCore extends ObjectModel
|
||||
|
||||
if ($res && $this->id_product_attribute == 0)
|
||||
{
|
||||
$items = self::getSupplierCollection($this->id_product, false);
|
||||
$items = ProductSupplier::getSupplierCollection($this->id_product, false);
|
||||
foreach ($items as $item)
|
||||
{
|
||||
if ($item->id_product_attribute > 0)
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ class ProfileCore extends ObjectModel
|
||||
public static function getProfileAccess($id_profile, $id_tab)
|
||||
{
|
||||
// getProfileAccesses is cached so there is no performance leak
|
||||
$accesses = self::getProfileAccesses($id_profile);
|
||||
$accesses = Profile::getProfileAccesses($id_profile);
|
||||
return (isset($accesses[$id_tab]) ? $accesses[$id_tab] : false);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -80,7 +80,7 @@ class SceneCore extends ObjectModel
|
||||
if (parent::update($nullValues))
|
||||
{
|
||||
// Refresh cache of feature detachable
|
||||
Configuration::updateGlobalValue('PS_SCENE_FEATURE_ACTIVE', self::isCurrentlyUsed($this->def['table'], true));
|
||||
Configuration::updateGlobalValue('PS_SCENE_FEATURE_ACTIVE', Scene::isCurrentlyUsed($this->def['table'], true));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -111,7 +111,7 @@ class SceneCore extends ObjectModel
|
||||
if (parent::delete())
|
||||
{
|
||||
return $this->deleteImage() &&
|
||||
Configuration::updateGlobalValue('PS_SCENE_FEATURE_ACTIVE', self::isCurrentlyUsed($this->def['table'], true));
|
||||
Configuration::updateGlobalValue('PS_SCENE_FEATURE_ACTIVE', Scene::isCurrentlyUsed($this->def['table'], true));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -193,7 +193,7 @@ class SceneCore extends ObjectModel
|
||||
*/
|
||||
public static function getScenes($id_category, $id_lang = NULL, $onlyActive = true, $liteResult = true, $hideScenePosition = true, Context $context = null)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!Scene::isFeatureActive())
|
||||
return array();
|
||||
|
||||
if (!$context)
|
||||
@@ -224,7 +224,7 @@ class SceneCore extends ObjectModel
|
||||
*/
|
||||
public function getProducts($onlyActive = true, $id_lang = NULL, $liteResult = true, Context $context = null)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!Scene::isFeatureActive())
|
||||
return array();
|
||||
|
||||
if (!$context)
|
||||
|
||||
+10
-10
@@ -105,7 +105,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
self::$_specificPriceCache = array();
|
||||
Product::flushPriceCache();
|
||||
// Refresh cache of feature detachable
|
||||
Configuration::updateGlobalValue('PS_SPECIFIC_PRICE_FEATURE_ACTIVE', self::isCurrentlyUsed($this->def['table']));
|
||||
Configuration::updateGlobalValue('PS_SPECIFIC_PRICE_FEATURE_ACTIVE', SpecificPrice::isCurrentlyUsed($this->def['table']));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -156,7 +156,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
|
||||
public static function getPriority($id_product)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!SpecificPrice::isFeatureActive())
|
||||
return explode(';', Configuration::get('PS_SPECIFIC_PRICE_PRIORITIES'));
|
||||
|
||||
if (!isset(self::$_cache_priorities[(int)$id_product]))
|
||||
@@ -180,7 +180,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
|
||||
public static function getSpecificPrice($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute = null, $id_customer = 0, $id_cart = 0)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!SpecificPrice::isFeatureActive())
|
||||
return array();
|
||||
/*
|
||||
** The date is not taken into account for the cache, but this is for the better because it keeps the consistency for the whole script.
|
||||
@@ -192,7 +192,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
{
|
||||
$now = date('Y-m-d H:i:s');
|
||||
self::$_specificPriceCache[$key] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT *, '.self::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer).'
|
||||
SELECT *, '.SpecificPrice::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer).'
|
||||
FROM `'._DB_PREFIX_.'specific_price`
|
||||
WHERE `id_product` IN (0, '.(int)$id_product.')
|
||||
AND `id_product_attribute` IN (0, '.(int)$id_product_attribute.')
|
||||
@@ -247,13 +247,13 @@ class SpecificPriceCore extends ObjectModel
|
||||
|
||||
public static function getQuantityDiscounts($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_product_attribute = null, $all_combinations = false, $id_customer = 0)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!SpecificPrice::isFeatureActive())
|
||||
return array();
|
||||
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT *,
|
||||
'.self::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer).'
|
||||
'.SpecificPrice::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer).'
|
||||
FROM `'._DB_PREFIX_.'specific_price`
|
||||
WHERE
|
||||
`id_product` IN(0, '.(int)$id_product.') AND
|
||||
@@ -292,13 +292,13 @@ class SpecificPriceCore extends ObjectModel
|
||||
|
||||
public static function getQuantityDiscount($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute = null, $id_customer = 0)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!SpecificPrice::isFeatureActive())
|
||||
return array();
|
||||
|
||||
$now = date('Y-m-d H:i:s');
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT *,
|
||||
'.self::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer).'
|
||||
'.SpecificPrice::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer).'
|
||||
FROM `'._DB_PREFIX_.'specific_price`
|
||||
WHERE
|
||||
`id_product` IN(0, '.(int)$id_product.') AND
|
||||
@@ -321,7 +321,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
|
||||
public static function getProductIdByDate($id_shop, $id_currency, $id_country, $id_group, $beginning, $ending, $id_customer = 0)
|
||||
{
|
||||
if (!self::isFeatureActive())
|
||||
if (!SpecificPrice::isFeatureActive())
|
||||
return array();
|
||||
|
||||
$results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
@@ -352,7 +352,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
if (Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'specific_price` WHERE `id_product` = '.(int)$id_product))
|
||||
{
|
||||
// Refresh cache of feature detachable
|
||||
Configuration::updateGlobalValue('PS_SPECIFIC_PRICE_FEATURE_ACTIVE', self::isCurrentlyUsed('specific_price'));
|
||||
Configuration::updateGlobalValue('PS_SPECIFIC_PRICE_FEATURE_ACTIVE', SpecificPrice::isCurrentlyUsed('specific_price'));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
+8
-8
@@ -76,12 +76,12 @@ class TabCore extends ObjectModel
|
||||
*/
|
||||
public function add($autodate = true, $null_values = false)
|
||||
{
|
||||
$this->position = self::getNewLastPosition($this->id_parent);
|
||||
$this->position = Tab::getNewLastPosition($this->id_parent);
|
||||
if (parent::add($autodate, $null_values))
|
||||
{
|
||||
// refresh cache when adding new tab
|
||||
self::$_getIdFromClassName[$this->class_name] = $this->id;
|
||||
return self::initAccess($this->id);
|
||||
return Tab::initAccess($this->id);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ class TabCore extends ObjectModel
|
||||
*/
|
||||
public static function getCurrentTabId()
|
||||
{
|
||||
return self::getIdFromClassName(Tools::getValue('tab'));
|
||||
return Tab::getIdFromClassName(Tools::getValue('tab'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -274,7 +274,7 @@ class TabCore extends ObjectModel
|
||||
*/
|
||||
public static function enablingForModule($module)
|
||||
{
|
||||
$tabs = self::getCollectionFromModule($module);
|
||||
$tabs = Tab::getCollectionFromModule($module);
|
||||
if (!empty($tabs)) {
|
||||
foreach ($tabs as $tab) {
|
||||
$tab->active = 1;
|
||||
@@ -293,7 +293,7 @@ class TabCore extends ObjectModel
|
||||
*/
|
||||
public static function disablingForModule($module)
|
||||
{
|
||||
$tabs = self::getCollectionFromModule($module);
|
||||
$tabs = Tab::getCollectionFromModule($module);
|
||||
if (!empty($tabs)) {
|
||||
foreach ($tabs as $tab) {
|
||||
$tab->active = 0;
|
||||
@@ -312,8 +312,8 @@ class TabCore extends ObjectModel
|
||||
*/
|
||||
public static function getInstanceFromClassName($class_name)
|
||||
{
|
||||
$id_tab = (int)self::getIdFromClassName($class_name);
|
||||
return new self($id_tab);
|
||||
$id_tab = (int)Tab::getIdFromClassName($class_name);
|
||||
return new Tab($id_tab);
|
||||
}
|
||||
|
||||
public static function getNbTabs($id_parent = null)
|
||||
@@ -342,7 +342,7 @@ class TabCore extends ObjectModel
|
||||
|
||||
public function move($direction)
|
||||
{
|
||||
$nb_tabs = self::getNbTabs($this->id_parent);
|
||||
$nb_tabs = Tab::getNbTabs($this->id_parent);
|
||||
if ($direction != 'l' && $direction != 'r')
|
||||
return false;
|
||||
if ($nb_tabs <= 1)
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ class TagCore extends ObjectModel
|
||||
|
||||
public function __construct($id = null, $name = null, $id_lang = null)
|
||||
{
|
||||
$this->def = self::getDefinition($this);
|
||||
$this->def = Tag::getDefinition($this);
|
||||
$this->setDefinitionRetrocompatibility();
|
||||
|
||||
if ($id)
|
||||
|
||||
+63
-63
@@ -54,7 +54,7 @@ class ToolsCore
|
||||
}
|
||||
|
||||
for ($i = 0, $passwd = ''; $i < $length; $i++)
|
||||
$passwd .= self::substr($str, mt_rand(0, self::strlen($str) - 1), 1);
|
||||
$passwd .= Tools::substr($str, mt_rand(0, Tools::strlen($str) - 1), 1);
|
||||
return $passwd;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class ToolsCore
|
||||
{
|
||||
$url = substr($url, strlen('index.php?controller='));
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
$url = self::strReplaceFirst('&', '?' , $url);
|
||||
$url = Tools::strReplaceFirst('&', '?', $url);
|
||||
}
|
||||
|
||||
$explode = explode('?', $url);
|
||||
@@ -199,7 +199,7 @@ class ToolsCore
|
||||
public static function getShopDomain($http = false, $entities = false)
|
||||
{
|
||||
if (!$domain = ShopUrl::getMainShopDomain())
|
||||
$domain = self::getHttpHost();
|
||||
$domain = Tools::getHttpHost();
|
||||
if ($entities)
|
||||
$domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8');
|
||||
if ($http)
|
||||
@@ -217,7 +217,7 @@ class ToolsCore
|
||||
public static function getShopDomainSsl($http = false, $entities = false)
|
||||
{
|
||||
if (!$domain = ShopUrl::getMainShopDomainSSL())
|
||||
$domain = self::getHttpHost();
|
||||
$domain = Tools::getHttpHost();
|
||||
if ($entities)
|
||||
$domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8');
|
||||
if ($http)
|
||||
@@ -281,7 +281,7 @@ class ToolsCore
|
||||
*/
|
||||
public static function getCurrentUrlProtocolPrefix()
|
||||
{
|
||||
if(self::usingSecureMode())
|
||||
if (Tools::usingSecureMode())
|
||||
return 'https://';
|
||||
else
|
||||
return 'http://';
|
||||
@@ -295,7 +295,7 @@ class ToolsCore
|
||||
*/
|
||||
public static function secureReferrer($referrer)
|
||||
{
|
||||
if (preg_match('/^http[s]?:\/\/'.self::getServerName().'(:'._PS_SSL_PORT_.')?\/.*$/Ui', $referrer))
|
||||
if (preg_match('/^http[s]?:\/\/'.Tools::getServerName().'(:'._PS_SSL_PORT_.')?\/.*$/Ui', $referrer))
|
||||
return $referrer;
|
||||
return __PS_BASE_URI__;
|
||||
}
|
||||
@@ -346,8 +346,8 @@ class ToolsCore
|
||||
/* Automatically detect language if not already defined */
|
||||
if (!$cookie->id_lang AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||
{
|
||||
$array = explode(',', self::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
|
||||
if (self::strlen($array[0]) > 2)
|
||||
$array = explode(',', Tools::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
|
||||
if (Tools::strlen($array[0]) > 2)
|
||||
{
|
||||
$tab = explode('-', $array[0]);
|
||||
$string = $tab[0];
|
||||
@@ -379,7 +379,7 @@ class ToolsCore
|
||||
{
|
||||
if (!$context)
|
||||
$context = Context::getContext();
|
||||
if ($id_lang = (int)(self::getValue('id_lang')) AND Validate::isUnsignedId($id_lang))
|
||||
if ($id_lang = (int)Tools::getValue('id_lang') && Validate::isUnsignedId($id_lang))
|
||||
$context->cookie->id_lang = $id_lang;
|
||||
|
||||
$language = new Language($id_lang);
|
||||
@@ -394,7 +394,7 @@ class ToolsCore
|
||||
*/
|
||||
public static function setCurrency($cookie)
|
||||
{
|
||||
if (self::isSubmit('SubmitCurrency'))
|
||||
if (Tools::isSubmit('SubmitCurrency'))
|
||||
if (isset($_POST['id_currency']) AND is_numeric($_POST['id_currency']))
|
||||
{
|
||||
$currency = Currency::getCurrencyInstance((int)($_POST['id_currency']));
|
||||
@@ -454,7 +454,7 @@ class ToolsCore
|
||||
$ret = 0;
|
||||
if (($isNegative = ($price < 0)))
|
||||
$price *= -1;
|
||||
$price = self::ps_round($price, $c_decimals);
|
||||
$price = Tools::ps_round($price, $c_decimals);
|
||||
switch ($c_format)
|
||||
{
|
||||
/* X 0,000.00 */
|
||||
@@ -487,9 +487,9 @@ class ToolsCore
|
||||
{
|
||||
$currency = Currency::getCurrencyInstance((int)($params['currency']));
|
||||
if (Validate::isLoadedObject($currency))
|
||||
return self::displayPrice($params['price'], $currency, false);
|
||||
return Tools::displayPrice($params['price'], $currency, false);
|
||||
}
|
||||
return self::displayPrice($params['price']);
|
||||
return Tools::displayPrice($params['price']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -570,7 +570,7 @@ class ToolsCore
|
||||
*/
|
||||
public static function dateFormat($params, &$smarty)
|
||||
{
|
||||
return self::displayDate($params['date'], Context::getContext()->language->id, (isset($params['full']) ? $params['full'] : false));
|
||||
return Tools::displayDate($params['date'], Context::getContext()->language->id, (isset($params['full']) ? $params['full'] : false));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -644,7 +644,7 @@ class ToolsCore
|
||||
if ($file != '.' AND $file != '..')
|
||||
{
|
||||
if (is_dir($dirname.$file))
|
||||
self::deleteDirectory($dirname.$file, true);
|
||||
Tools::deleteDirectory($dirname.$file, true);
|
||||
elseif (file_exists($dirname.$file))
|
||||
unlink($dirname.$file);
|
||||
}
|
||||
@@ -714,7 +714,7 @@ class ToolsCore
|
||||
*/
|
||||
public static function d($object, $kill = true)
|
||||
{
|
||||
return (self::dieObject($object, $kill));
|
||||
return (Tools::dieObject($object, $kill));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -724,7 +724,7 @@ class ToolsCore
|
||||
*/
|
||||
public static function p($object)
|
||||
{
|
||||
return (self::dieObject($object, false));
|
||||
return (Tools::dieObject($object, false));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -750,10 +750,10 @@ class ToolsCore
|
||||
{
|
||||
global $maintenance;
|
||||
|
||||
if (!(isset($maintenance) AND (!in_array(self::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP'))))))
|
||||
if (!(isset($maintenance) && (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP'))))))
|
||||
{
|
||||
/* Products specifics meta tags */
|
||||
if ($id_product = self::getValue('id_product'))
|
||||
if ($id_product = Tools::getValue('id_product'))
|
||||
{
|
||||
$sql = 'SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`, `description_short`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
@@ -766,16 +766,16 @@ class ToolsCore
|
||||
{
|
||||
if (empty($row['meta_description']))
|
||||
$row['meta_description'] = strip_tags($row['description_short']);
|
||||
return self::completeMetaTags($row, $row['name']);
|
||||
return Tools::completeMetaTags($row, $row['name']);
|
||||
}
|
||||
}
|
||||
|
||||
/* Categories specifics meta tags */
|
||||
elseif ($id_category = self::getValue('id_category'))
|
||||
else if ($id_category = Tools::getValue('id_category'))
|
||||
{
|
||||
if (!empty($title))
|
||||
$title = ' - '.$title;
|
||||
$page_number = (int)self::getValue('p');
|
||||
$page_number = (int)Tools::getValue('p');
|
||||
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`, `description`
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
@@ -794,14 +794,14 @@ class ToolsCore
|
||||
if (!empty($title))
|
||||
$row['meta_title'] = $title.(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
|
||||
return self::completeMetaTags($row, $row['name']);
|
||||
return Tools::completeMetaTags($row, $row['name']);
|
||||
}
|
||||
}
|
||||
|
||||
/* Manufacturers specifics meta tags */
|
||||
elseif ($id_manufacturer = self::getValue('id_manufacturer'))
|
||||
else if ($id_manufacturer = Tools::getValue('id_manufacturer'))
|
||||
{
|
||||
$page_number = (int)self::getValue('p');
|
||||
$page_number = (int)Tools::getValue('p');
|
||||
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`
|
||||
FROM `'._DB_PREFIX_.'manufacturer_lang` ml
|
||||
@@ -813,12 +813,12 @@ class ToolsCore
|
||||
$row['meta_description'] = strip_tags($row['meta_description']);
|
||||
$row['meta_title'] .= $row['name'] . (!empty($page_number) ? ' ('.$page_number.')' : '');
|
||||
$row['meta_title'] .= ' - '.Configuration::get('PS_SHOP_NAME');
|
||||
return self::completeMetaTags($row, $row['meta_title']);
|
||||
return Tools::completeMetaTags($row, $row['meta_title']);
|
||||
}
|
||||
}
|
||||
|
||||
/* Suppliers specifics meta tags */
|
||||
elseif ($id_supplier = self::getValue('id_supplier'))
|
||||
else if ($id_supplier = Tools::getValue('id_supplier'))
|
||||
{
|
||||
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`
|
||||
@@ -832,12 +832,12 @@ class ToolsCore
|
||||
$row['meta_description'] = strip_tags($row['meta_description']);
|
||||
if (!empty($row['meta_title']))
|
||||
$row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME');
|
||||
return self::completeMetaTags($row, $row['name']);
|
||||
return Tools::completeMetaTags($row, $row['name']);
|
||||
}
|
||||
}
|
||||
|
||||
/* CMS specifics meta tags */
|
||||
elseif ($id_cms = self::getValue('id_cms'))
|
||||
else if ($id_cms = Tools::getValue('id_cms'))
|
||||
{
|
||||
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `meta_title`, `meta_description`, `meta_keywords`
|
||||
@@ -846,12 +846,12 @@ class ToolsCore
|
||||
if ($row)
|
||||
{
|
||||
$row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME');
|
||||
return self::completeMetaTags($row, $row['meta_title']);
|
||||
return Tools::completeMetaTags($row, $row['meta_title']);
|
||||
}
|
||||
}
|
||||
|
||||
/* CMS category specifics meta tags */
|
||||
elseif ($id_cms = self::getValue('id_cms_category'))
|
||||
else if ($id_cms = Tools::getValue('id_cms_category'))
|
||||
{
|
||||
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `meta_title`, `meta_description`, `meta_keywords`
|
||||
@@ -860,13 +860,13 @@ class ToolsCore
|
||||
if ($row)
|
||||
{
|
||||
$row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME');
|
||||
return self::completeMetaTags($row, $row['meta_title']);
|
||||
return Tools::completeMetaTags($row, $row['meta_title']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Default meta tags */
|
||||
return self::getHomeMetaTags($id_lang, $page_name);
|
||||
return Tools::getHomeMetaTags($id_lang, $page_name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -920,9 +920,9 @@ class ToolsCore
|
||||
if (!$context)
|
||||
$context = Context::getContext();
|
||||
if ($page === true)
|
||||
return (self::encrypt($context->customer->id.$context->customer->passwd.$_SERVER['SCRIPT_NAME']));
|
||||
return (Tools::encrypt($context->customer->id.$context->customer->passwd.$_SERVER['SCRIPT_NAME']));
|
||||
else
|
||||
return (self::encrypt($context->customer->id.$context->customer->passwd.$page));
|
||||
return (Tools::encrypt($context->customer->id.$context->customer->passwd.$page));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -932,7 +932,7 @@ class ToolsCore
|
||||
*/
|
||||
public static function getAdminToken($string)
|
||||
{
|
||||
return !empty($string) ? self::encrypt($string) : false;
|
||||
return !empty($string) ? Tools::encrypt($string) : false;
|
||||
}
|
||||
|
||||
public static function getAdminTokenLite($tab, Context $context = null)
|
||||
@@ -993,10 +993,10 @@ class ToolsCore
|
||||
foreach ($categories AS $category)
|
||||
{
|
||||
$fullPath .=
|
||||
(($n < $nCategories OR $linkOntheLastItem) ? '<a href="'.self::safeOutput($context->link->getCategoryLink((int)$category['id_category'], $category['link_rewrite'])).'" title="'.htmlentities($category['name'], ENT_NOQUOTES, 'UTF-8').'">' : '').
|
||||
(($n < $nCategories || $linkOntheLastItem) ? '<a href="'.Tools::safeOutput($context->link->getCategoryLink((int)$category['id_category'], $category['link_rewrite'])).'" title="'.htmlentities($category['name'], ENT_NOQUOTES, 'UTF-8').'">' : '').
|
||||
htmlentities($category['name'], ENT_NOQUOTES, 'UTF-8').
|
||||
(($n < $nCategories OR $linkOntheLastItem) ? '</a>' : '').
|
||||
(($n++ != $nCategories OR !empty($path)) ? '<span class="navigation-pipe">'.$pipe.'</span>' : '');
|
||||
(($n < $nCategories || $linkOntheLastItem) ? '</a>' : '').
|
||||
(($n++ != $nCategories || !empty($path)) ? '<span class="navigation-pipe">'.$pipe.'</span>' : '');
|
||||
}
|
||||
|
||||
return $fullPath.$path;
|
||||
@@ -1006,15 +1006,15 @@ class ToolsCore
|
||||
{
|
||||
$category = new CMSCategory($id_category, $context->language->id);
|
||||
if (!Validate::isLoadedObject($category))
|
||||
die(self::displayError());
|
||||
die(Tools::displayError());
|
||||
$categoryLink = $context->link->getCMSCategoryLink($category);
|
||||
|
||||
if ($path != $category->name)
|
||||
$fullPath .= '<a href="'.self::safeOutput($categoryLink).'">'.htmlentities($category->name, ENT_NOQUOTES, 'UTF-8').'</a><span class="navigation-pipe">'.$pipe.'</span>'.$path;
|
||||
$fullPath .= '<a href="'.Tools::safeOutput($categoryLink).'">'.htmlentities($category->name, ENT_NOQUOTES, 'UTF-8').'</a><span class="navigation-pipe">'.$pipe.'</span>'.$path;
|
||||
else
|
||||
$fullPath = ($linkOntheLastItem ? '<a href="'.self::safeOutput($categoryLink).'">' : '').htmlentities($path, ENT_NOQUOTES, 'UTF-8').($linkOntheLastItem ? '</a>' : '');
|
||||
$fullPath = ($linkOntheLastItem ? '<a href="'.Tools::safeOutput($categoryLink).'">' : '').htmlentities($path, ENT_NOQUOTES, 'UTF-8').($linkOntheLastItem ? '</a>' : '');
|
||||
|
||||
return self::getPath($category->id_parent, $fullPath, $linkOntheLastItem, $categoryType);
|
||||
return Tools::getPath($category->id_parent, $fullPath, $linkOntheLastItem, $categoryType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1043,7 +1043,7 @@ class ToolsCore
|
||||
if ($id_category == $defaultCategory)
|
||||
return htmlentities($end, ENT_NOQUOTES, 'UTF-8');
|
||||
|
||||
return self::getPath($id_category, $category->name, true, $type_cat).'<span class="navigation-pipe">'.$pipe.'</span> <span class="navigation_product">'.htmlentities($end, ENT_NOQUOTES, 'UTF-8').'</span>';
|
||||
return Tools::getPath($id_category, $category->name, true, $type_cat).'<span class="navigation-pipe">'.$pipe.'</span> <span class="navigation_product">'.htmlentities($end, ENT_NOQUOTES, 'UTF-8').'</span>';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1055,7 +1055,7 @@ class ToolsCore
|
||||
*/
|
||||
public static function link_rewrite($str, $utf8_decode = false)
|
||||
{
|
||||
return self::str2url($str);
|
||||
return Tools::str2url($str);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1071,7 +1071,7 @@ class ToolsCore
|
||||
$str = mb_strtolower($str, 'utf-8');
|
||||
|
||||
$str = trim($str);
|
||||
$str = self::replaceAccentedChars($str);
|
||||
$str = Tools::replaceAccentedChars($str);
|
||||
|
||||
// Remove all non-whitelist chars.
|
||||
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u','', $str);
|
||||
@@ -1126,10 +1126,10 @@ class ToolsCore
|
||||
** For other purposes use the smarty function instead */
|
||||
public static function truncate($str, $maxLen, $suffix = '...')
|
||||
{
|
||||
if (self::strlen($str) <= $maxLen)
|
||||
if (Tools::strlen($str) <= $maxLen)
|
||||
return $str;
|
||||
$str = utf8_decode($str);
|
||||
return (utf8_encode(substr($str, 0, $maxLen - self::strlen($suffix)).$suffix));
|
||||
return (utf8_encode(substr($str, 0, $maxLen - Tools::strlen($suffix)).$suffix));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1171,7 +1171,7 @@ class ToolsCore
|
||||
{
|
||||
$tab = explode(' ', $date);
|
||||
if (!isset($tab[1]))
|
||||
$date .= ' ' . self::hourGenerate(0, 0, 0);
|
||||
$date .= ' '.Tools::hourGenerate(0, 0, 0);
|
||||
return $date;
|
||||
}
|
||||
|
||||
@@ -1179,7 +1179,7 @@ class ToolsCore
|
||||
{
|
||||
$tab = explode(' ', $date);
|
||||
if (!isset($tab[1]))
|
||||
$date .= ' ' . self::hourGenerate(23, 59, 59);
|
||||
$date .= ' '.Tools::hourGenerate(23, 59, 59);
|
||||
return $date;
|
||||
}
|
||||
|
||||
@@ -1223,13 +1223,13 @@ class ToolsCore
|
||||
if (is_array($str))
|
||||
return false;
|
||||
if (function_exists('mb_substr'))
|
||||
return mb_substr($str, (int)($start), ($length === false ? self::strlen($str) : (int)($length)), $encoding);
|
||||
return substr($str, $start, ($length === false ? self::strlen($str) : (int)($length)));
|
||||
return mb_substr($str, (int)($start), ($length === false ? Tools::strlen($str) : (int)($length)), $encoding);
|
||||
return substr($str, $start, ($length === false ? Tools::strlen($str) : (int)($length)));
|
||||
}
|
||||
|
||||
static function ucfirst($str)
|
||||
{
|
||||
return self::strtoupper(self::substr($str, 0, 1)).self::substr($str, 1);
|
||||
return Tools::strtoupper(Tools::substr($str, 0, 1)).Tools::substr($str, 1);
|
||||
}
|
||||
|
||||
public static function orderbyPrice(&$array, $orderWay)
|
||||
@@ -1269,9 +1269,9 @@ class ToolsCore
|
||||
{
|
||||
$method = (int)(Configuration::get('PS_PRICE_ROUND_MODE'));
|
||||
if ($method == PS_ROUND_UP)
|
||||
return self::ceilf($value, $precision);
|
||||
return Tools::ceilf($value, $precision);
|
||||
elseif ($method == PS_ROUND_DOWN)
|
||||
return self::floorf($value, $precision);
|
||||
return Tools::floorf($value, $precision);
|
||||
return round($value, $precision);
|
||||
}
|
||||
|
||||
@@ -1465,12 +1465,12 @@ class ToolsCore
|
||||
{
|
||||
global $current_css_file;
|
||||
|
||||
$protocol_link = self::getCurrentUrlProtocolPrefix();
|
||||
$protocol_link = Tools::getCurrentUrlProtocolPrefix();
|
||||
|
||||
if (array_key_exists(1, $matches))
|
||||
{
|
||||
$tmp = dirname($current_css_file).'/'.$matches[1];
|
||||
return 'url(\''.$protocol_link.self::getMediaServer($tmp).$tmp.'\')';
|
||||
return 'url(\''.$protocol_link.Tools::getMediaServer($tmp).$tmp.'\')';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1541,7 +1541,7 @@ class ToolsCore
|
||||
|
||||
if (self::$_cache_nb_media_servers AND ($id_media_server = (abs(crc32($filename)) % self::$_cache_nb_media_servers + 1)))
|
||||
return constant('_MEDIA_SERVER_'.$id_media_server.'_');
|
||||
return self::getHttpHost();
|
||||
return Tools::getHttpHost();
|
||||
}
|
||||
|
||||
public static function generateHtaccess($path = null, $rewrite_settings = null, $cache_control = null, $specific = '', $disable_multiviews = null)
|
||||
@@ -1773,7 +1773,7 @@ FileETag INode MTime Size
|
||||
|
||||
trigger_error($message, E_WARNING);
|
||||
$class = isset($callee['class']) ? $callee['class'] : null;
|
||||
self::throwDeprecated($error, $message, $class);
|
||||
Tools::throwDeprecated($error, $message, $class);
|
||||
}
|
||||
|
||||
public static function displayFileAsDeprecated()
|
||||
@@ -1784,7 +1784,7 @@ FileETag INode MTime Size
|
||||
$message = 'The file '.$callee['file'].' is deprecated and will be removed in the next major version.';
|
||||
|
||||
$class = isset($callee['class']) ? $callee['class'] : null;
|
||||
self::throwDeprecated($error, $message, $class);
|
||||
Tools::throwDeprecated($error, $message, $class);
|
||||
}
|
||||
|
||||
protected static function throwDeprecated($error, $message, $class)
|
||||
@@ -2073,7 +2073,7 @@ FileETag INode MTime Size
|
||||
{
|
||||
$memory_limit = @ini_get('memory_limit');
|
||||
|
||||
return self::getOctets($memory_limit);
|
||||
return Tools::getOctets($memory_limit);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2113,8 +2113,8 @@ FileETag INode MTime Size
|
||||
*/
|
||||
public static function getMaxUploadSize($max_size = 0)
|
||||
{
|
||||
$post_max_size = self::convertBytes(ini_get('post_max_size'));
|
||||
$upload_max_filesize = self::convertBytes(ini_get('upload_max_filesize'));
|
||||
$post_max_size = Tools::convertBytes(ini_get('post_max_size'));
|
||||
$upload_max_filesize = Tools::convertBytes(ini_get('upload_max_filesize'));
|
||||
if ($max_size > 0)
|
||||
$result = min($post_max_size, $upload_max_filesize, $max_size);
|
||||
else
|
||||
|
||||
+11
-11
@@ -120,7 +120,7 @@ class ValidateCore
|
||||
*/
|
||||
public static function isOptFloat($float)
|
||||
{
|
||||
return empty($float) OR self::isFloat($float);
|
||||
return empty($float) || Validate::isFloat($float);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -394,7 +394,7 @@ class ValidateCore
|
||||
|
||||
public static function isPasswdAdmin($passwd)
|
||||
{
|
||||
return self::isPasswd($passwd, 8);
|
||||
return Validate::isPasswd($passwd, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -622,12 +622,12 @@ class ValidateCore
|
||||
*/
|
||||
public static function isUnsignedId($id)
|
||||
{
|
||||
return self::isUnsignedInt($id); /* Because an id could be equal to zero when there is no association */
|
||||
return Validate::isUnsignedInt($id); /* Because an id could be equal to zero when there is no association */
|
||||
}
|
||||
|
||||
public static function isNullOrUnsignedId($id)
|
||||
{
|
||||
return is_null($id) OR self::isUnsignedId($id);
|
||||
return is_null($id) || Validate::isUnsignedId($id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -671,7 +671,7 @@ class ValidateCore
|
||||
*/
|
||||
public static function isUrlOrEmpty($url)
|
||||
{
|
||||
return empty($url) || self::isUrl($url);
|
||||
return empty($url) || Validate::isUrl($url);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -906,7 +906,7 @@ class ValidateCore
|
||||
{
|
||||
if (sizeof($ids))
|
||||
foreach($ids as $id)
|
||||
if ($id == 0 || !self::isUnsignedInt($id))
|
||||
if ($id == 0 || !Validate::isUnsignedInt($id))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -920,15 +920,15 @@ class ValidateCore
|
||||
{
|
||||
foreach ($zones as $zone)
|
||||
{
|
||||
if (!isset($zone['x1']) || !self::isUnsignedInt($zone['x1']))
|
||||
if (!isset($zone['x1']) || !Validate::isUnsignedInt($zone['x1']))
|
||||
return false;
|
||||
if (!isset($zone['y1']) || !self::isUnsignedInt($zone['y1']))
|
||||
if (!isset($zone['y1']) || !Validate::isUnsignedInt($zone['y1']))
|
||||
return false;
|
||||
if (!isset($zone['width']) || !self::isUnsignedInt($zone['width']))
|
||||
if (!isset($zone['width']) || !Validate::isUnsignedInt($zone['width']))
|
||||
return false;
|
||||
if (!isset($zone['height']) || !self::isUnsignedInt($zone['height']))
|
||||
if (!isset($zone['height']) || !Validate::isUnsignedInt($zone['height']))
|
||||
return false;
|
||||
if (!isset($zone['id_product']) || !self::isUnsignedInt($zone['id_product']))
|
||||
if (!isset($zone['id_product']) || !Validate::isUnsignedInt($zone['id_product']))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Vendored
+1
-1
@@ -138,7 +138,7 @@ class CacheFsCore extends Cache
|
||||
if (mkdir($new_dir))
|
||||
if (chmod($new_dir, 0777))
|
||||
if ($level_depth - 1 > 0)
|
||||
self::createCacheDirectories($level_depth - 1, $new_dir);
|
||||
CacheFs::createCacheDirectories($level_depth - 1, $new_dir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -67,7 +67,7 @@ class CacheMemcacheCore extends Cache
|
||||
public function connect()
|
||||
{
|
||||
$this->memcache = new Memcache();
|
||||
$servers = self::getMemcachedServers();
|
||||
$servers = CacheMemcache::getMemcachedServers();
|
||||
if (!$servers)
|
||||
return false;
|
||||
foreach ($servers AS $server)
|
||||
|
||||
@@ -1041,7 +1041,7 @@ class OrderCore extends ObjectModel
|
||||
if ($order_invoice->number)
|
||||
Configuration::updateValue('PS_INVOICE_START_NUMBER', false);
|
||||
else
|
||||
$order_invoice->number = self::getLastInvoiceNumber() + 1;
|
||||
$order_invoice->number = Order::getLastInvoiceNumber() + 1;
|
||||
|
||||
$order_invoice->total_discount_tax_excl = $this->total_discounts_tax_excl;
|
||||
$order_invoice->total_discount_tax_incl = $this->total_discounts_tax_incl;
|
||||
|
||||
@@ -86,10 +86,10 @@ class OrderReturnCore extends ObjectModel
|
||||
die(Tools::displayError());
|
||||
$products = $order->getProducts();
|
||||
/* Products already returned */
|
||||
$order_return = self::getOrdersReturn($order->id_customer, $order->id, true);
|
||||
$order_return = OrderReturn::getOrdersReturn($order->id_customer, $order->id, true);
|
||||
foreach ($order_return AS $or)
|
||||
{
|
||||
$order_return_products = self::getOrdersReturnProducts($or['id_order_return'], $order);
|
||||
$order_return_products = OrderReturn::getOrdersReturnProducts($or['id_order_return'], $order);
|
||||
foreach ($order_return_products AS $key => $orp)
|
||||
$products[$key]['product_quantity'] -= (int)($orp['product_quantity']);
|
||||
}
|
||||
@@ -159,7 +159,7 @@ class OrderReturnCore extends ObjectModel
|
||||
|
||||
public static function getOrdersReturnProducts($orderReturnId, $order)
|
||||
{
|
||||
$productsRet = self::getOrdersReturnDetail($orderReturnId);
|
||||
$productsRet = OrderReturn::getOrdersReturnDetail($orderReturnId);
|
||||
$products = $order->getProducts();
|
||||
$tmp = array();
|
||||
foreach ($productsRet AS $return_detail)
|
||||
|
||||
@@ -108,7 +108,7 @@ class OrderSlipCore extends ObjectModel
|
||||
public static function getOrdersSlipProducts($orderSlipId, $order)
|
||||
{
|
||||
$cart_rules = $order->getCartRules(true);
|
||||
$productsRet = self::getOrdersSlipDetail($orderSlipId);
|
||||
$productsRet = OrderSlip::getOrdersSlipDetail($orderSlipId);
|
||||
$products = $order->getProductsDetail();
|
||||
|
||||
$tmp = array();
|
||||
|
||||
@@ -40,7 +40,7 @@ class HTMLTemplateDeliverySlipCore extends HTMLTemplate
|
||||
|
||||
// header informations
|
||||
$this->date = Tools::displayDate($this->order->invoice_date, (int)$this->order->id_lang);
|
||||
$this->title = self::l('Delivery').' #'.Configuration::get('PS_DELIVERY_PREFIX', Context::getContext()->language->id).sprintf('%06d', $this->order_invoice->delivery_number);
|
||||
$this->title = HTMLTemplateDeliverySlip::l('Delivery').' #'.Configuration::get('PS_DELIVERY_PREFIX', Context::getContext()->language->id).sprintf('%06d', $this->order_invoice->delivery_number);
|
||||
|
||||
// footer informations
|
||||
$this->shop = new Shop((int)$this->order->id_shop);
|
||||
|
||||
@@ -42,7 +42,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
|
||||
// header informations
|
||||
$this->date = Tools::displayDate($order_invoice->date_add, (int)$this->order->id_lang);
|
||||
$this->title = self::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id).sprintf('%06d', $order_invoice->number);
|
||||
$this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id).sprintf('%06d', $order_invoice->number);
|
||||
|
||||
// footer informations
|
||||
$this->shop = new Shop((int)$this->order->id_shop);
|
||||
|
||||
@@ -47,7 +47,7 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
|
||||
|
||||
// header informations
|
||||
$this->date = Tools::displayDate($this->order->invoice_date, (int)$this->order->id_lang);
|
||||
$this->title = self::l('Slip #').sprintf('%06d', $this->order_slip->id);
|
||||
$this->title = HTMLTemplateOrderSlip::l('Slip #').sprintf('%06d', $this->order_slip->id);
|
||||
|
||||
// footer informations
|
||||
$this->shop = new Shop((int)$this->order->id_shop);
|
||||
|
||||
@@ -47,7 +47,7 @@ class HTMLTemplateSupplyOrderFormCore extends HTMLTemplate
|
||||
|
||||
// header informations
|
||||
$this->date = Tools::displayDate($supply_order->date_add, (int)$this->supply_order->id_lang);
|
||||
$this->title = self::l('Supply order form').sprintf(' %s', $supply_order->reference);
|
||||
$this->title = HTMLTemplateSupplyOrderForm::l('Supply order form').sprintf(' %s', $supply_order->reference);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,7 @@ class HTMLTemplateSupplyOrderFormCore extends HTMLTemplate
|
||||
*/
|
||||
public function getFilename()
|
||||
{
|
||||
return (self::l('SupplyOrderForm').sprintf('_%s', $this->supply_order->reference).'.pdf');
|
||||
return (HTMLTemplateSupplyOrderForm::l('SupplyOrderForm').sprintf('_%s', $this->supply_order->reference).'.pdf');
|
||||
}
|
||||
|
||||
protected function getTaxOrderSummary()
|
||||
@@ -121,8 +121,8 @@ class HTMLTemplateSupplyOrderFormCore extends HTMLTemplate
|
||||
public function getFooter()
|
||||
{
|
||||
$this->address = $this->address_warehouse;
|
||||
$free_text = self::l('DE: Discount excluded ');
|
||||
$free_text .= self::l(' DI: Discount included');
|
||||
$free_text = HTMLTemplateSupplyOrderForm::l('DE: Discount excluded ');
|
||||
$free_text .= HTMLTemplateSupplyOrderForm::l(' DI: Discount included');
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'shop_address' => $this->getShopAddress(),
|
||||
|
||||
@@ -154,7 +154,7 @@ class ShopCore extends ObjectModel
|
||||
|
||||
public function delete()
|
||||
{
|
||||
if (self::has_dependency($this->id) || !$res = parent::delete())
|
||||
if (Shop::has_dependency($this->id) || !$res = parent::delete())
|
||||
return false;
|
||||
|
||||
foreach (Shop::getAssoTables() as $table_name => $row)
|
||||
@@ -494,7 +494,7 @@ class ShopCore extends ObjectModel
|
||||
'name' => $row['group_name'],
|
||||
'share_customer' => $row['share_customer'],
|
||||
'share_order' => $row['share_order'],
|
||||
'totalShops' => self::getTotalShopsByIdGroupShop($row['id_group_shop']),
|
||||
'totalShops' => Shop::getTotalShopsByIdGroupShop($row['id_group_shop']),
|
||||
'shops' => array(),
|
||||
);
|
||||
|
||||
@@ -896,7 +896,7 @@ class ShopCore extends ObjectModel
|
||||
public static function getShopWithoutUrls($id_shop = false)
|
||||
{
|
||||
$without = array();
|
||||
$shops = self::getShops();
|
||||
$shops = Shop::getShops();
|
||||
foreach ($shops as $shop)
|
||||
if ((!$id_shop || $shop['id_shop'] == $id_shop) && empty($shop['domain']) && empty($shop['uri']))
|
||||
$without[] = $shop;
|
||||
|
||||
@@ -168,9 +168,9 @@ class StockAvailableCore extends ObjectModel
|
||||
// In case there are no warehouses, removes product from StockAvailable
|
||||
if (count($ids_warehouse) == 0)
|
||||
{
|
||||
self::removeProductFromStockAvailable($id_product);
|
||||
StockAvailable::removeProductFromStockAvailable($id_product);
|
||||
foreach ($ids_product_attribute as $id_product_attribute)
|
||||
self::removeProductFromStockAvailable($id_product, $id_product_attribute);
|
||||
StockAvailable::removeProductFromStockAvailable($id_product, $id_product_attribute);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -281,20 +281,20 @@ class SupplyOrderDetailCore extends ObjectModel
|
||||
foreach ($fields_required as $field)
|
||||
if (($value = $this->{$field}) == false && (string)$value != '0')
|
||||
if (!$this->id || $field != 'passwd')
|
||||
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities)
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName($field, get_class($this), $htmlentities)
|
||||
.'</b> '.Tools::displayError('is required.');
|
||||
|
||||
/* Checks maximum fields sizes */
|
||||
foreach ($this->fieldsSize as $field => $max_length)
|
||||
if ($value = $this->{$field} && Tools::strlen($value) > $max_length)
|
||||
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities)
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName($field, get_class($this), $htmlentities)
|
||||
.'</b> '.Tools::displayError('is too long.').' ('.Tools::displayError('Maximum length:').' '.$max_length.')';
|
||||
|
||||
/* Checks fields validity */
|
||||
foreach ($this->fieldsValidate as $field => $function)
|
||||
if ($value = $this->{$field})
|
||||
if (!Validate::$function($value) && (!empty($value) || in_array($field, $this->fieldsRequired)))
|
||||
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
|
||||
else
|
||||
if ($field == 'passwd')
|
||||
if ($value = Tools::getValue($field))
|
||||
@@ -303,13 +303,13 @@ class SupplyOrderDetailCore extends ObjectModel
|
||||
$this->{$field} = $value;
|
||||
|
||||
if ($this->quantity_expected <= 0)
|
||||
$errors[] = '<b>'.self::displayFieldName('quantity_expected', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName('quantity_expected', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
|
||||
if ($this->tax_rate < 0 || $this->tax_rate > 100)
|
||||
$errors[] = '<b>'.self::displayFieldName('tax_rate', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName('tax_rate', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
|
||||
if ($this->discount_rate < 0 || $this->discount_rate > 100)
|
||||
$errors[] = '<b>'.self::displayFieldName('discount_rate', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName('discount_rate', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ class WarehouseCore extends ObjectModel
|
||||
// if it's a pack, returns warehouses if and only if some products use the advanced stock management
|
||||
if (Pack::isPack($id_product))
|
||||
{
|
||||
$warehouses = self::getPackWarehouses($id_product);
|
||||
$warehouses = Warehouse::getPackWarehouses($id_product);
|
||||
$res = array();
|
||||
foreach ($warehouses as $warehouse)
|
||||
$res[]['id_warehouse'] = $warehouse;
|
||||
|
||||
@@ -70,7 +70,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
/**
|
||||
* Init the available fields by export type with associated translation
|
||||
*/
|
||||
private function initExportFieldList()
|
||||
protected function initExportFieldList()
|
||||
{
|
||||
$this->exportTypeList = array(
|
||||
'global_export' => array(
|
||||
@@ -109,7 +109,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
/**
|
||||
* Init the block Menu
|
||||
*/
|
||||
private function initMenu()
|
||||
protected function initMenu()
|
||||
{
|
||||
$this->context->smarty->assign(array(
|
||||
'exportTypeList' => $this->exportTypeList,
|
||||
@@ -132,7 +132,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
$this->addJqueryUi('ui.datepicker');
|
||||
}
|
||||
|
||||
private function checkRights()
|
||||
protected function checkRights()
|
||||
{
|
||||
if (!is_writeable($this->downloadDir))
|
||||
$this->errors[] = $this->l('The download folder doesn\'t have the sufficient right…');
|
||||
@@ -214,7 +214,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
* Write the exported content tout a file
|
||||
* @var array $list Result of the SQL query
|
||||
*/
|
||||
private function writeExportToFile($list)
|
||||
protected function writeExportToFile($list)
|
||||
{
|
||||
$this->checkRights();
|
||||
|
||||
@@ -241,7 +241,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
/**
|
||||
* Start the reconciliation export type
|
||||
*/
|
||||
private function runReconciliationExport()
|
||||
protected function runReconciliationExport()
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
@@ -276,7 +276,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
* @param $line_number
|
||||
* @return array
|
||||
*/
|
||||
private function createLine($row, $line_number)
|
||||
protected function createLine($row, $line_number)
|
||||
{
|
||||
$line = array();
|
||||
|
||||
@@ -320,7 +320,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
* @param $db_details
|
||||
* @return array
|
||||
*/
|
||||
private function buildGlobalExportlist($db_details)
|
||||
protected function buildGlobalExportlist($db_details)
|
||||
{
|
||||
// List use to write data in csv file
|
||||
$list = array();
|
||||
@@ -401,7 +401,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
* Start the global export type
|
||||
*
|
||||
*/
|
||||
private function runGlobalExport()
|
||||
protected function runGlobalExport()
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
@@ -462,7 +462,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
* Allow to download the last export file
|
||||
* @var string File name
|
||||
*/
|
||||
private function downloadFile($fileName)
|
||||
protected function downloadFile($fileName)
|
||||
{
|
||||
$path = $this->downloadDir.$fileName;
|
||||
header('Content-length: ' . filesize($path));
|
||||
|
||||
@@ -104,7 +104,7 @@ class AdminAccountingManagementControllerCore extends AdminController
|
||||
/**
|
||||
* Update the account number for each shop liable to their zones
|
||||
*/
|
||||
private function updateAccountNumber()
|
||||
protected function updateAccountNumber()
|
||||
{
|
||||
$id_shop = $this->context->shop->getID();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
private function addAttribute($arr, $price = 0, $weight = 0)
|
||||
protected function addAttribute($arr, $price = 0, $weight = 0)
|
||||
{
|
||||
foreach ($arr as $attr)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
$first = array_pop($list);
|
||||
foreach ($first as $attribute)
|
||||
{
|
||||
$tab = self::createCombinations($list);
|
||||
$tab = AdminAttributeGeneratorController::createCombinations($list);
|
||||
foreach ($tab as $to_add)
|
||||
$res[] = is_array($to_add) ? array_merge($to_add, array($attribute)) : array($to_add, $attribute);
|
||||
}
|
||||
@@ -90,8 +90,8 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
$tab = array_values($_POST['options']);
|
||||
if (count($tab) && Validate::isLoadedObject($this->product))
|
||||
{
|
||||
self::setAttributesImpacts($this->product->id, $tab);
|
||||
$this->combinations = array_values(self::createCombinations($tab));
|
||||
AdminAttributeGeneratorController::setAttributesImpacts($this->product->id, $tab);
|
||||
$this->combinations = array_values(AdminAttributeGeneratorController::createCombinations($tab));
|
||||
$values = array_values(array_map(array($this, 'addAttribute'), $this->combinations));
|
||||
|
||||
// @since 1.5.0
|
||||
@@ -183,7 +183,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
{
|
||||
$combinations_groups = $this->product->getAttributesGroups($this->context->language->id);
|
||||
$attributes = array();
|
||||
$impacts = self::getAttributesImpacts($this->product->id);
|
||||
$impacts = AdminAttributeGeneratorController::getAttributesImpacts($this->product->id);
|
||||
foreach ($combinations_groups as &$combination)
|
||||
{
|
||||
$target = &$attributes[$combination['id_attribute_group']][$combination['id_attribute']];
|
||||
@@ -225,7 +225,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
|
||||
$this->initGroupTable();
|
||||
|
||||
$js_attributes = self::displayAndReturnAttributeJs();
|
||||
$js_attributes = AdminAttributeGeneratorController::displayAndReturnAttributeJs();
|
||||
$attribute_groups = AttributeGroup::getAttributesGroups($this->context->language->id);
|
||||
$this->product = new Product((int)Tools::getValue('id_product'));
|
||||
|
||||
|
||||
@@ -604,7 +604,7 @@ class AdminCarriersControllerCore extends AdminController
|
||||
$object->copyCarrierData((int)$old_id);
|
||||
}
|
||||
|
||||
private function changeGroups($id_carrier, $delete = true)
|
||||
protected function changeGroups($id_carrier, $delete = true)
|
||||
{
|
||||
if ($delete)
|
||||
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$id_carrier);
|
||||
|
||||
@@ -38,7 +38,7 @@ class AdminContactControllerCore extends AdminController
|
||||
$this->_buildOrderedFieldsShop($temporyArrayFields);
|
||||
}
|
||||
|
||||
private function _getDefaultFieldsContent()
|
||||
protected function _getDefaultFieldsContent()
|
||||
{
|
||||
$this->context = Context::getContext();
|
||||
$countryList = array();
|
||||
@@ -66,7 +66,7 @@ class AdminContactControllerCore extends AdminController
|
||||
return $formFields;
|
||||
}
|
||||
|
||||
private function _buildOrderedFieldsShop($formFields)
|
||||
protected function _buildOrderedFieldsShop($formFields)
|
||||
{
|
||||
$associatedOrderKey = array(
|
||||
'PS_SHOP_NAME' => 'company',
|
||||
|
||||
@@ -402,7 +402,7 @@ class AdminCountriesControllerCore extends AdminController
|
||||
return parent::postProcess();
|
||||
}
|
||||
|
||||
private function displayValidFields()
|
||||
protected function displayValidFields()
|
||||
{
|
||||
$html = '<ul>';
|
||||
|
||||
|
||||
@@ -381,12 +381,12 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
public function initContent()
|
||||
{
|
||||
if (isset($_GET['filename']) && file_exists(_PS_UPLOAD_DIR_.$_GET['filename']))
|
||||
self::openUploadedFile();
|
||||
AdminCustomerThreadsController::openUploadedFile();
|
||||
|
||||
return parent::initContent();
|
||||
}
|
||||
|
||||
private function openUploadedFile()
|
||||
protected function openUploadedFile()
|
||||
{
|
||||
$filename = $_GET['filename'];
|
||||
|
||||
@@ -522,7 +522,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
return parent::renderView();
|
||||
}
|
||||
|
||||
private function displayMessage($message, $email = false, $id_employee = null)
|
||||
protected function displayMessage($message, $email = false, $id_employee = null)
|
||||
{
|
||||
$tpl = $this->createTemplate('message.tpl');
|
||||
|
||||
@@ -559,7 +559,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
return $tpl->fetch();
|
||||
}
|
||||
|
||||
private function displayButton($content)
|
||||
protected function displayButton($content)
|
||||
{
|
||||
return '
|
||||
<div style="margin-bottom:10px;border:1px solid #005500;width:200px;height:130px;padding:10px;background:#EFE">
|
||||
|
||||
@@ -359,7 +359,7 @@ class AdminEmployeesControllerCore extends AdminController
|
||||
return false;
|
||||
}
|
||||
|
||||
$assos = self::getAssoShop($this->table);
|
||||
$assos = AdminEmployeesController::getAssoShop($this->table);
|
||||
|
||||
if (count($assos[0]) == 0 && $this->table = 'employee')
|
||||
if (Shop::isFeatureActive() && _PS_ADMIN_PROFILE_ != $_POST['id_profile'])
|
||||
|
||||
@@ -147,7 +147,7 @@ class AdminGeolocationControllerCore extends AdminController
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
private function isGeoLiteCityAvailable()
|
||||
protected function isGeoLiteCityAvailable()
|
||||
{
|
||||
if (file_exists(_PS_GEOIP_DIR_.'GeoLiteCity.dat'))
|
||||
return true;
|
||||
|
||||
@@ -29,7 +29,7 @@ class AdminHomeControllerCore extends AdminController
|
||||
{
|
||||
const TIPS_TIMEOUT = 5;
|
||||
|
||||
private function _displayOptimizationTips()
|
||||
protected function _displayOptimizationTips()
|
||||
{
|
||||
$link = $this->context->link;
|
||||
|
||||
@@ -169,7 +169,7 @@ class AdminHomeControllerCore extends AdminController
|
||||
$this->l('Click here if you want to modify the main shop domain name').'</a>');
|
||||
}
|
||||
|
||||
private function getQuickLinks()
|
||||
protected function getQuickLinks()
|
||||
{
|
||||
$quick_links['first'] = array(
|
||||
'href' => $this->context->link->getAdminLink('AdminCategories').'&addcategory',
|
||||
|
||||
@@ -317,7 +317,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
/**
|
||||
* Delete resized image then regenerate new one with updated settings
|
||||
*/
|
||||
private function _deleteOldImages($dir, $type, $product = false)
|
||||
protected function _deleteOldImages($dir, $type, $product = false)
|
||||
{
|
||||
if (!is_dir($dir))
|
||||
return false;
|
||||
@@ -350,7 +350,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
// Regenerate images
|
||||
private function _regenerateNewImages($dir, $type, $productsImages = false)
|
||||
protected function _regenerateNewImages($dir, $type, $productsImages = false)
|
||||
{
|
||||
if (!is_dir($dir))
|
||||
return false;
|
||||
@@ -397,7 +397,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
// Regenerate no-pictures images
|
||||
private function _regenerateNoPictureImages($dir, $type, $languages)
|
||||
protected function _regenerateNoPictureImages($dir, $type, $languages)
|
||||
{
|
||||
$errors = false;
|
||||
foreach ($type AS $k => $imageType)
|
||||
@@ -416,7 +416,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
// Hook watermark optimization
|
||||
private function _regenerateWatermark($dir)
|
||||
protected function _regenerateWatermark($dir)
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT m.`name` FROM `'._DB_PREFIX_.'module` m
|
||||
@@ -442,7 +442,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
private function _regenerateThumbnails($type = 'all', $deleteOldImages = false)
|
||||
protected function _regenerateThumbnails($type = 'all', $deleteOldImages = false)
|
||||
{
|
||||
$this->start_time = time();
|
||||
ini_set('max_execution_time', $this->max_execution_time); // ini_set may be disabled, we need the real value
|
||||
@@ -509,7 +509,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
/**
|
||||
* Move product images to the new filesystem
|
||||
*/
|
||||
private function _moveImagesToNewFileSystem()
|
||||
protected function _moveImagesToNewFileSystem()
|
||||
{
|
||||
if (!Image::testFileSystem())
|
||||
$this->errors[] = Tools::displayError('Error: your server configuration is not compatible with the new image system. No images were moved');
|
||||
|
||||
@@ -527,7 +527,7 @@ class AdminImportControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
private function generateContentTable($current_table, $nb_column, $handle, $glue)
|
||||
protected function generateContentTable($current_table, $nb_column, $handle, $glue)
|
||||
{
|
||||
$html = '<table id="table'.$current_table.'" style="display: none;" class="table" cellspacing="0" cellpadding="0">
|
||||
<tr>';
|
||||
@@ -550,7 +550,7 @@ class AdminImportControllerCore extends AdminController
|
||||
</th>';
|
||||
$html .= '</tr>';
|
||||
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $current_line < 10 && $line = fgetcsv($handle, MAX_LINE_SIZE, $glue); $current_line++)
|
||||
{
|
||||
/* UTF-8 conversion */
|
||||
@@ -563,7 +563,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$html .= '</tr>';
|
||||
}
|
||||
$html .= '</table>';
|
||||
self::rewindBomAware($handle);
|
||||
AdminImportController::rewindBomAware($handle);
|
||||
return $html;
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ class AdminImportControllerCore extends AdminController
|
||||
return $res;
|
||||
}
|
||||
|
||||
private function getTypeValuesOptions($nb_c)
|
||||
protected function getTypeValuesOptions($nb_c)
|
||||
{
|
||||
$i = 0;
|
||||
$no_pre_select = array('price_tin', 'feature');
|
||||
@@ -690,7 +690,7 @@ class AdminImportControllerCore extends AdminController
|
||||
return implode("\n\r", $fields);
|
||||
}
|
||||
|
||||
private function receiveTab()
|
||||
protected function receiveTab()
|
||||
{
|
||||
$type_value = Tools::getValue('type_value') ? Tools::getValue('type_value') : array();
|
||||
foreach ($type_value as $nb => $type)
|
||||
@@ -804,19 +804,19 @@ class AdminImportControllerCore extends AdminController
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
$default_language_id = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
if (!isset($info['id']) || (int)$info['id'] < 2)
|
||||
continue;
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
$category = new Category();
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $category);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $category);
|
||||
|
||||
if (isset($category->parent) && is_numeric($category->parent))
|
||||
{
|
||||
@@ -832,7 +832,7 @@ class AdminImportControllerCore extends AdminController
|
||||
else
|
||||
{
|
||||
$category_to_create = new Category();
|
||||
$category_to_create->name = self::createMultiLangField($category->parent);
|
||||
$category_to_create->name = AdminImportController::createMultiLangField($category->parent);
|
||||
$category_to_create->active = 1;
|
||||
$category_to_create->id_parent = 1; // Default parent is home for unknown category to create
|
||||
if (($field_error = $category_to_create->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
@@ -861,7 +861,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$category->link_rewrite = 'friendly-url-autogeneration-failed';
|
||||
$this->warnings[] = Tools::displayError('URL rewriting failed to auto-generate a friendly URL for: ').$category->name[$default_language_id];
|
||||
}
|
||||
$category->link_rewrite = self::createMultiLangField($category->link_rewrite);
|
||||
$category->link_rewrite = AdminImportController::createMultiLangField($category->link_rewrite);
|
||||
}
|
||||
|
||||
if (!$valid_link)
|
||||
@@ -898,7 +898,7 @@ class AdminImportControllerCore extends AdminController
|
||||
}
|
||||
//copying images of categories
|
||||
if (isset($category->image) && !empty($category->image))
|
||||
if (!(self::copyImg($category->id, null, $category->image, 'categories')))
|
||||
if (!(AdminImportController::copyImg($category->id, null, $category->image, 'categories')))
|
||||
$this->warnings[] = $category->image.' '.Tools::displayError('Cannot be copied');
|
||||
// If both failed, mysql error
|
||||
if (!$res)
|
||||
@@ -920,12 +920,12 @@ class AdminImportControllerCore extends AdminController
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
$default_language_id = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
if (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product'))
|
||||
{
|
||||
$product = new Product((int)$info['id']);
|
||||
@@ -936,8 +936,8 @@ class AdminImportControllerCore extends AdminController
|
||||
}
|
||||
else
|
||||
$product = new Product();
|
||||
self::setEntityDefaultValues($product);
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $product);
|
||||
AdminImportController::setEntityDefaultValues($product);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $product);
|
||||
|
||||
if ((int)$product->id_tax_rules_group != 0)
|
||||
{
|
||||
@@ -1025,7 +1025,7 @@ class AdminImportControllerCore extends AdminController
|
||||
{
|
||||
$category_to_create = new Category();
|
||||
$category_to_create->id = (int)$value;
|
||||
$category_to_create->name = self::createMultiLangField($value);
|
||||
$category_to_create->name = AdminImportController::createMultiLangField($value);
|
||||
$category_to_create->active = 1;
|
||||
$category_to_create->id_parent = 1; // Default parent is home for unknown category to create
|
||||
if (($field_error = $category_to_create->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
@@ -1048,7 +1048,7 @@ class AdminImportControllerCore extends AdminController
|
||||
else
|
||||
{
|
||||
$category_to_create = new Category();
|
||||
$category_to_create->name = self::createMultiLangField($value);
|
||||
$category_to_create->name = AdminImportController::createMultiLangField($value);
|
||||
$category_to_create->active = 1;
|
||||
$category_to_create->id_parent = 1; // Default parent is home for unknown category to create
|
||||
if (($field_error = $category_to_create->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
@@ -1081,7 +1081,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$this->warnings[] = Tools::displayError('Rewrite link for').' '.$link_rewrite.(isset($info['id']) ? ' (ID '.$info['id'].') ' : '').
|
||||
' '.Tools::displayError('was re-written as').' '.$link_rewrite;
|
||||
|
||||
$product->link_rewrite = self::createMultiLangField($link_rewrite);
|
||||
$product->link_rewrite = AdminImportController::createMultiLangField($link_rewrite);
|
||||
|
||||
$res = false;
|
||||
$field_error = $product->validateFields(UNFRIENDLY_ERROR, true);
|
||||
@@ -1172,7 +1172,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$tag = new Tag();
|
||||
if (!is_array($product->tags))
|
||||
{
|
||||
$product->tags = self::createMultiLangField($product->tags);
|
||||
$product->tags = AdminImportController::createMultiLangField($product->tags);
|
||||
foreach ($product->tags as $key => $tags)
|
||||
{
|
||||
$is_tag_added = $tag->addTags($key, $product->id, $tags);
|
||||
@@ -1222,7 +1222,7 @@ class AdminImportControllerCore extends AdminController
|
||||
if (($field_error = $image->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
($lang_field_error = $image->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true && $image->add())
|
||||
{
|
||||
if (!self::copyImg($product->id, $image->id, $url))
|
||||
if (!AdminImportController::copyImg($product->id, $image->id, $url))
|
||||
$this->warnings[] = Tools::displayError('Error copying image: ').$url;
|
||||
}
|
||||
else
|
||||
@@ -1270,15 +1270,15 @@ class AdminImportControllerCore extends AdminController
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
$fsep = ((is_null(Tools::getValue('multiple_value_separator')) || trim(Tools::getValue('multiple_value_separator')) == '' ) ? ',' : Tools::getValue('multiple_value_separator'));
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
$info = array_map('trim', $info);
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
|
||||
$product = new Product((int)$info['id_product'], false, $default_language);
|
||||
$id_image = null;
|
||||
@@ -1300,7 +1300,7 @@ class AdminImportControllerCore extends AdminController
|
||||
if (($field_error = $image->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
($lang_field_error = $image->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true && $image->add())
|
||||
{
|
||||
if (!self::copyImg($product->id, $image->id, $url))
|
||||
if (!AdminImportController::copyImg($product->id, $image->id, $url))
|
||||
$this->warnings[] = Tools::displayError('Error copying image: ').$url;
|
||||
else
|
||||
$id_image = array($image->id);
|
||||
@@ -1417,16 +1417,16 @@ class AdminImportControllerCore extends AdminController
|
||||
{
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
$customer = new Customer();
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $customer);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $customer);
|
||||
|
||||
if ($customer->passwd)
|
||||
$customer->passwd = md5(_COOKIE_KEY_.$customer->passwd);
|
||||
@@ -1468,16 +1468,16 @@ class AdminImportControllerCore extends AdminController
|
||||
$this->receiveTab();
|
||||
$default_language_id = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
$address = new Address();
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $address);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $address);
|
||||
|
||||
if (isset($address->country) && is_numeric($address->country))
|
||||
{
|
||||
@@ -1492,7 +1492,7 @@ class AdminImportControllerCore extends AdminController
|
||||
{
|
||||
$country = new Country();
|
||||
$country->active = 1;
|
||||
$country->name = self::createMultiLangField($address->country);
|
||||
$country->name = AdminImportController::createMultiLangField($address->country);
|
||||
$country->id_zone = 0; // Default zone for country to create
|
||||
$country->iso_code = strtoupper(substr($address->country, 0, 2)); // Default iso for country to create
|
||||
$country->contains_states = 0; // Default value for country to create
|
||||
@@ -1613,20 +1613,20 @@ class AdminImportControllerCore extends AdminController
|
||||
{
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
|
||||
if (array_key_exists('id', $info) && (int)$info['id'] && Manufacturer::existsInDatabase((int)$info['id'], 'manufacturer'))
|
||||
$manufacturer = new Manufacturer((int)$info['id']);
|
||||
else
|
||||
$manufacturer = new Manufacturer();
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $manufacturer);
|
||||
$manufacturer = new Manufacturer();
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $manufacturer);
|
||||
|
||||
$res = false;
|
||||
if (($field_error = $manufacturer->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
@@ -1671,21 +1671,21 @@ class AdminImportControllerCore extends AdminController
|
||||
{
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
|
||||
if (array_key_exists('id', $info) && (int)$info['id'] && Supplier::existsInDatabase((int)$info['id'], 'supplier'))
|
||||
$supplier = new Supplier((int)$info['id']);
|
||||
else
|
||||
$supplier = new Supplier();
|
||||
$supplier = new Supplier();
|
||||
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supplier);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supplier);
|
||||
if (($field_error = $supplier->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
($lang_field_error = $supplier->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true)
|
||||
{
|
||||
@@ -1733,7 +1733,7 @@ class AdminImportControllerCore extends AdminController
|
||||
// opens CSV & sets locale
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
|
||||
// main loop, for each supply orders to import
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); ++$current_line)
|
||||
@@ -1741,10 +1741,10 @@ class AdminImportControllerCore extends AdminController
|
||||
// if convert requested
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
// sets default values if needed
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
|
||||
// if an id is set, instanciates a supply order with this id if possible
|
||||
if (array_key_exists('id', $info) && (int)$info['id'] && SupplyOrder::exists((int)$info['id']))
|
||||
@@ -1805,7 +1805,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$info['id_supply_order_state'] = 1;
|
||||
|
||||
// sets parameters
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supply_order);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supply_order);
|
||||
|
||||
// updatesd($supply_order);
|
||||
$res = true;
|
||||
@@ -1829,7 +1829,7 @@ class AdminImportControllerCore extends AdminController
|
||||
// opens CSV & sets locale
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
|
||||
$products = array();
|
||||
$reset = true;
|
||||
@@ -1839,10 +1839,10 @@ class AdminImportControllerCore extends AdminController
|
||||
// if convert requested
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
// sets default values if needed
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
|
||||
// gets the supply order
|
||||
if (array_key_exists('supply_order_reference', $info) && pSQL($info['supply_order_reference']) && SupplyOrder::exists(pSQL($info['supply_order_reference'])))
|
||||
@@ -1901,7 +1901,7 @@ class AdminImportControllerCore extends AdminController
|
||||
|
||||
// creates new product
|
||||
$supply_order_detail = new SupplyOrderDetail();
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supply_order_detail);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supply_order_detail);
|
||||
|
||||
// sets parameters
|
||||
$supply_order_detail->id_supply_order = $supply_order->id;
|
||||
@@ -1952,10 +1952,10 @@ class AdminImportControllerCore extends AdminController
|
||||
return $array;
|
||||
}
|
||||
|
||||
private function getNbrColumn($handle, $glue)
|
||||
protected function getNbrColumn($handle, $glue)
|
||||
{
|
||||
$tmp = fgetcsv($handle, MAX_LINE_SIZE, $glue);
|
||||
self::rewindBomAware($handle);
|
||||
AdminImportController::rewindBomAware($handle);
|
||||
return count($tmp);
|
||||
}
|
||||
|
||||
@@ -1970,26 +1970,26 @@ class AdminImportControllerCore extends AdminController
|
||||
return ($a < $b) ? 1 : -1;
|
||||
}
|
||||
|
||||
private function openCsvFile()
|
||||
protected function openCsvFile()
|
||||
{
|
||||
$handle = fopen(_PS_ADMIN_DIR_.'/import/'.strval(preg_replace('/\.{2,}/', '.', Tools::getValue('csv'))), 'r');
|
||||
|
||||
if (!$handle)
|
||||
$this->errors[] = Tools::displayError('Cannot read the CSV file');
|
||||
|
||||
self::rewindBomAware($handle);
|
||||
AdminImportController::rewindBomAware($handle);
|
||||
|
||||
for ($i = 0; $i < (int)Tools::getValue('skip'); ++$i)
|
||||
$line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator', ';'));
|
||||
return $handle;
|
||||
}
|
||||
|
||||
private function closeCsvFile($handle)
|
||||
protected function closeCsvFile($handle)
|
||||
{
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
private function truncateTables($case)
|
||||
protected function truncateTables($case)
|
||||
{
|
||||
switch ((int)$case)
|
||||
{
|
||||
|
||||
@@ -451,7 +451,7 @@ class AdminLanguagesControllerCore extends AdminController
|
||||
* @param string $id_language
|
||||
* @return boolean true if no error
|
||||
*/
|
||||
private function deleteNoPictureImages($id_language)
|
||||
protected function deleteNoPictureImages($id_language)
|
||||
{
|
||||
$language = Language::getIsoById($id_language);
|
||||
$images_types = ImageType::getImagesTypes('products');
|
||||
|
||||
@@ -331,7 +331,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
return $url;
|
||||
}
|
||||
|
||||
private function extractArchive($file, $redirect = true)
|
||||
protected function extractArchive($file, $redirect = true)
|
||||
{
|
||||
$success = false;
|
||||
if (substr($file, -4) == '.zip')
|
||||
@@ -355,7 +355,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=8'.'&token='.$this->token);
|
||||
}
|
||||
|
||||
private function recursiveDeleteOnDisk($dir)
|
||||
protected function recursiveDeleteOnDisk($dir)
|
||||
{
|
||||
if (strpos(realpath($dir), realpath(_PS_MODULE_DIR_)) === false)
|
||||
return ;
|
||||
@@ -385,7 +385,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
** Set and reset filter configuration
|
||||
*/
|
||||
|
||||
private function setFilterModules($module_type, $country_module_value, $module_install, $module_status)
|
||||
protected function setFilterModules($module_type, $country_module_value, $module_install, $module_status)
|
||||
{
|
||||
Configuration::updateValue('PS_SHOW_TYPE_MODULES_'.(int)$this->id_employee, $module_type);
|
||||
Configuration::updateValue('PS_SHOW_COUNTRY_MODULES_'.(int)$this->id_employee, $country_module_value);
|
||||
@@ -393,7 +393,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
Configuration::updateValue('PS_SHOW_ENABLED_MODULES_'.(int)$this->id_employee, $module_status);
|
||||
}
|
||||
|
||||
private function resetFilterModules()
|
||||
protected function resetFilterModules()
|
||||
{
|
||||
Configuration::updateValue('PS_SHOW_TYPE_MODULES_'.(int)$this->id_employee, 'allModules');
|
||||
Configuration::updateValue('PS_SHOW_COUNTRY_MODULES_'.(int)$this->id_employee, 0);
|
||||
@@ -718,7 +718,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
* @param $module_errors
|
||||
* @return string
|
||||
*/
|
||||
private function generateHtmlMessage($module_errors)
|
||||
protected function generateHtmlMessage($module_errors)
|
||||
{
|
||||
$html_error = '';
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class AdminPaymentControllerCore extends AdminController
|
||||
}
|
||||
|
||||
|
||||
private function saveRestrictions($type)
|
||||
protected function saveRestrictions($type)
|
||||
{
|
||||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'module_'.bqSQL($type).'` WHERE id_shop = '.Context::getContext()->shop->getID(true));
|
||||
foreach ($this->payment_modules as $module)
|
||||
|
||||
@@ -398,7 +398,7 @@ class AdminPreferencesControllerCore extends AdminController
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
private function getConf($fields, $languages)
|
||||
protected function getConf($fields, $languages)
|
||||
{
|
||||
$tab['_MEDIA_SERVER_1_'] = _MEDIA_SERVER_1_;
|
||||
$tab['_MEDIA_SERVER_2_'] = _MEDIA_SERVER_2_;
|
||||
|
||||
@@ -191,7 +191,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
private function _cleanMetaKeywords($keywords)
|
||||
protected function _cleanMetaKeywords($keywords)
|
||||
{
|
||||
if (!empty($keywords) && $keywords != '')
|
||||
{
|
||||
@@ -1273,7 +1273,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
// Checking customs feature
|
||||
private function checkFeatures($languages, $feature_id)
|
||||
protected function checkFeatures($languages, $feature_id)
|
||||
{
|
||||
$rules = call_user_func(array('FeatureValue', 'getValidationRules'), 'FeatureValue');
|
||||
$feature = Feature::getFeature(Configuration::get('PS_LANG_DEFAULT'), $feature_id);
|
||||
@@ -1610,14 +1610,14 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->errors[] = $this->l('Tags list').' ('.$language['name'].') '.$this->l('is invalid');
|
||||
}
|
||||
|
||||
private function _removeTaxFromEcotax()
|
||||
protected function _removeTaxFromEcotax()
|
||||
{
|
||||
$ecotaxTaxRate = Tax::getProductEcotaxRate();
|
||||
if ($ecotax = Tools::getValue('ecotax'))
|
||||
$_POST['ecotax'] = Tools::ps_round(Tools::getValue('ecotax') / (1 + $ecotaxTaxRate / 100), 6);
|
||||
}
|
||||
|
||||
private function _applyTaxToEcotax($product)
|
||||
protected function _applyTaxToEcotax($product)
|
||||
{
|
||||
$ecotaxTaxRate = Tax::getProductEcotaxRate();
|
||||
if ($product->ecotax)
|
||||
@@ -1954,11 +1954,11 @@ class AdminProductsControllerCore extends AdminController
|
||||
if (isset($categories[$id_category]))
|
||||
foreach ($categories[$id_category] as $key => $row)
|
||||
if ($key != 'infos')
|
||||
$content .= self::recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $categories[$id_category][$key], $key, $id_category_default, $has_suite);
|
||||
$content .= AdminProductsController::recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $categories[$id_category][$key], $key, $id_category_default, $has_suite);
|
||||
return $content;
|
||||
}
|
||||
|
||||
private function _displayDraftWarning($active)
|
||||
protected function _displayDraftWarning($active)
|
||||
{
|
||||
$content = '<div class="warn draft" style="'.($active ? 'display:none' : '').'">
|
||||
<p>
|
||||
@@ -2725,7 +2725,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
|
||||
private function _getFinalPrice($specific_price, $productPrice, $taxRate)
|
||||
protected function _getFinalPrice($specific_price, $productPrice, $taxRate)
|
||||
{
|
||||
$price = Tools::ps_round((float)($specific_price['price']) ? $specific_price['price'] : $productPrice, 2);
|
||||
if (!(float)($specific_price['reduction']))
|
||||
@@ -2901,7 +2901,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
return $content;
|
||||
}
|
||||
|
||||
private function _getCustomizationFieldIds($labels, $alreadyGenerated, $obj)
|
||||
protected function _getCustomizationFieldIds($labels, $alreadyGenerated, $obj)
|
||||
{
|
||||
$customizableFieldIds = array();
|
||||
if (isset($labels[Product::CUSTOMIZE_FILE]))
|
||||
@@ -2919,7 +2919,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
return implode('¤', $customizableFieldIds);
|
||||
}
|
||||
|
||||
private function _displayLabelField(&$label, $languages, $default_language, $type, $fieldIds, $id_customization_field)
|
||||
protected function _displayLabelField(&$label, $languages, $default_language, $type, $fieldIds, $id_customization_field)
|
||||
{
|
||||
$content = '';
|
||||
$fieldsName = 'label_'.$type.'_'.(int)($id_customization_field);
|
||||
@@ -2942,7 +2942,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
return $content;
|
||||
}
|
||||
|
||||
private function _displayLabelFields(&$obj, &$labels, $languages, $default_language, $type)
|
||||
protected function _displayLabelFields(&$obj, &$labels, $languages, $default_language, $type)
|
||||
{
|
||||
$content = '';
|
||||
$type = (int)($type);
|
||||
@@ -3785,7 +3785,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
return false;
|
||||
}
|
||||
|
||||
private function initPack(Product $product)
|
||||
protected function initPack(Product $product)
|
||||
{
|
||||
$this->tpl_form_vars['is_pack'] = ($product->id && Pack::isPack($product->id)) || Tools::getValue('ppack');
|
||||
$product->packItems = Pack::getItems($product->id, $this->context->language->id);
|
||||
|
||||
@@ -353,7 +353,7 @@ class AdminReferrersControllerCore extends AdminController
|
||||
|
||||
public function displayCalendar($action = null, $table = null, $identifier = null, $id = null)
|
||||
{
|
||||
return self::displayCalendarForm(array(
|
||||
return AdminReferrersController::displayCalendarForm(array(
|
||||
'Calendar' => $this->l('Calendar'),
|
||||
'Day' => $this->l('Today'),
|
||||
'Month' => $this->l('Month'),
|
||||
@@ -399,7 +399,7 @@ class AdminReferrersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
private function enableCalendar()
|
||||
protected function enableCalendar()
|
||||
{
|
||||
return (!Tools::isSubmit('add'.$this->table) && !Tools::isSubmit('submitAdd'.$this->table) && !Tools::isSubmit('update'.$this->table));
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
|
||||
|
||||
public function displayCalendar()
|
||||
{
|
||||
return self::displayCalendarForm(array(
|
||||
return AdminStatsTabController::displayCalendarForm(array(
|
||||
'Calendar' => $this->l('Calendar', 'AdminStatsTab'),
|
||||
'Day' => $this->l('Day', 'AdminStatsTab'),
|
||||
'Month' => $this->l('Month', 'AdminStatsTab'),
|
||||
@@ -137,7 +137,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
|
||||
return $tpl->fetch();
|
||||
}
|
||||
|
||||
private function getModules()
|
||||
protected function getModules()
|
||||
{
|
||||
$sql = 'SELECT h.`name` AS hook, m.`name`
|
||||
FROM `'._DB_PREFIX_.'module` m
|
||||
|
||||
@@ -416,7 +416,7 @@ class AdminStatusesControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
private function getTemplates($iso_code)
|
||||
protected function getTemplates($iso_code)
|
||||
{
|
||||
$array = array();
|
||||
if (!file_exists(_PS_ADMIN_DIR_.'/../mails/'.$iso_code))
|
||||
|
||||
@@ -267,7 +267,7 @@ class AdminStockCoverControllerCore extends AdminController
|
||||
*
|
||||
* @return int coverage period
|
||||
*/
|
||||
private function getCurrentCoveragePeriod()
|
||||
protected function getCurrentCoveragePeriod()
|
||||
{
|
||||
static $coverage_period = 0;
|
||||
|
||||
@@ -285,7 +285,7 @@ class AdminStockCoverControllerCore extends AdminController
|
||||
*
|
||||
* @return int id_warehouse
|
||||
*/
|
||||
private function getCurrentCoverageWarehouse()
|
||||
protected function getCurrentCoverageWarehouse()
|
||||
{
|
||||
static $warehouse = 0;
|
||||
|
||||
@@ -303,7 +303,7 @@ class AdminStockCoverControllerCore extends AdminController
|
||||
*
|
||||
* @return int warn_days
|
||||
*/
|
||||
private function getCurrentWarning()
|
||||
protected function getCurrentWarning()
|
||||
{
|
||||
static $warning = 0;
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ class AdminStockInstantStateControllerCore extends AdminController
|
||||
*
|
||||
* @return int id_warehouse
|
||||
*/
|
||||
private function getCurrentCoverageWarehouse()
|
||||
protected function getCurrentCoverageWarehouse()
|
||||
{
|
||||
static $warehouse = 0;
|
||||
|
||||
|
||||
@@ -922,7 +922,7 @@ class AdminStockManagementControllerCore extends AdminController
|
||||
* @param array $item reference to the current item
|
||||
* @param bool $is_product_attribute specify if it's a product or a product variation
|
||||
*/
|
||||
private function skipActionByStock(&$item, $is_product_variation = false)
|
||||
protected function skipActionByStock(&$item, $is_product_variation = false)
|
||||
{
|
||||
$stock_manager = StockManagerFactory::getManager();
|
||||
|
||||
|
||||
@@ -2059,7 +2059,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
*
|
||||
* @return int id_warehouse
|
||||
*/
|
||||
private function getCurrentWarehouse()
|
||||
protected function getCurrentWarehouse()
|
||||
{
|
||||
static $warehouse = 0;
|
||||
|
||||
@@ -2077,7 +2077,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
*
|
||||
* @return int status
|
||||
*/
|
||||
private function getFilterStatus()
|
||||
protected function getFilterStatus()
|
||||
{
|
||||
static $status = 0;
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
if (!is_dir($target_dir.$file))
|
||||
mkdir($target_dir.$file, Theme::$access_rights);
|
||||
|
||||
$res &= self::copyTheme($base_theme_dir.$file, $target_theme_dir.$file);
|
||||
$res &= AdminThemesController::copyTheme($base_theme_dir.$file, $target_theme_dir.$file);
|
||||
}
|
||||
elseif (!file_exists($target_theme_dir.$file))
|
||||
$res &= copy($base_dir.$file, $target_dir.$file);
|
||||
@@ -326,7 +326,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
* @param string $theme_dir theme directory
|
||||
* @return boolean Validity is ok or not
|
||||
*/
|
||||
private function _isThemeCompatible($theme_dir)
|
||||
protected function _isThemeCompatible($theme_dir)
|
||||
{
|
||||
$all_errors='';
|
||||
$return=true;
|
||||
@@ -380,7 +380,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
* @param mixed $configItem will precise the attribute which not matches. If empty, will check every attributes
|
||||
* @return error message, or null if disabled
|
||||
*/
|
||||
private function _checkConfigForFeatures($arrFeatures, $configItem = array())
|
||||
protected function _checkConfigForFeatures($arrFeatures, $configItem = array())
|
||||
{
|
||||
$return = true;
|
||||
if (is_array($configItem))
|
||||
|
||||
@@ -114,7 +114,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
'packs_to_install' => $packs_to_install,
|
||||
'packs_to_update' => $packs_to_update,
|
||||
'url_submit' => self::$currentIndex.'&token='.$this->token,
|
||||
'themes' => $themes = self::getThemesList(),
|
||||
'themes' => $themes = AdminTranslationsController::getThemesList(),
|
||||
'url_create_language' => 'index.php?tab=AdminLanguages&addlang&token='.Tools::getAdminToken('AdminLanguages'.(int)(Tab::getIdFromClassName('AdminLanguages')).(int)$this->context->employee->id),
|
||||
);
|
||||
|
||||
@@ -1478,7 +1478,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
);
|
||||
$arr_files_to_parse = array_merge($arr_files_to_parse, $modules_has_mails);
|
||||
foreach ($arr_files_to_parse as $path) {
|
||||
$subject_mail = self::getSubjectMail($path, $subject_mail);
|
||||
$subject_mail = AdminTranslationsController::getSubjectMail($path, $subject_mail);
|
||||
}
|
||||
|
||||
$core_mails = $this->getMailFiles(_PS_MAIL_DIR_, $lang, 'core_mail');
|
||||
@@ -1580,7 +1580,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
if ($filename != '.svn' AND $filename != '.' AND $filename != '..' AND is_dir(($directory.'/'.$filename)))
|
||||
$subject_mail = self::getSubjectMail($directory.'/'.$filename, $subject_mail);
|
||||
$subject_mail = AdminTranslationsController::getSubjectMail($directory.'/'.$filename, $subject_mail);
|
||||
}
|
||||
return $subject_mail;
|
||||
}
|
||||
@@ -1682,7 +1682,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
if ($module{0} != '.' AND is_dir($root_dir.$module))
|
||||
{
|
||||
@include($root_dir.$module.'/'.$lang.'.php');
|
||||
self::getModuleTranslations($is_default);
|
||||
AdminTranslationsController::getModuleTranslations($is_default);
|
||||
$this->recursiveGetModuleFiles($root_dir.$module.'/', $array_files, $module, $root_dir.$module.'/'.$lang.'.php', $is_default);
|
||||
}
|
||||
}
|
||||
@@ -1750,7 +1750,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
* @return array containing all datas needed for building the translation form
|
||||
* @since 1.4.5.0
|
||||
*/
|
||||
private function _parsePdfClass($filepath, $regex, $langArray, $tab, $tabs_array)
|
||||
protected function _parsePdfClass($filepath, $regex, $langArray, $tab, $tabs_array)
|
||||
{
|
||||
$content = file_get_contents($filepath);
|
||||
preg_match_all($regex, $content, $matches);
|
||||
|
||||
@@ -169,7 +169,7 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
}
|
||||
|
||||
private function processAddressFormat(Address $delivery, Address $invoice)
|
||||
protected function processAddressFormat(Address $delivery, Address $invoice)
|
||||
{
|
||||
$inv_adr_fields = AddressFormat::getOrderedAddressFields($invoice->id_country, false, true);
|
||||
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($delivery->id_country, false, true);
|
||||
|
||||
@@ -164,7 +164,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
private function processAddressFormat()
|
||||
protected function processAddressFormat()
|
||||
{
|
||||
$addressDelivery = new Address((int)$this->context->cart->id_address_delivery);
|
||||
$addressInvoice = new Address((int)$this->context->cart->id_address_invoice);
|
||||
|
||||
Reference in New Issue
Block a user