// Use protected instead of private for classes we can override #PSCFV-1976
This commit is contained in:
@@ -36,7 +36,7 @@ class AddressFormatCore extends ObjectModel
|
||||
/** @var string */
|
||||
public $format;
|
||||
|
||||
private $_errorFormatList = array();
|
||||
protected $_errorFormatList = array();
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
|
||||
+2
-2
@@ -49,8 +49,8 @@ class CountyCore extends ObjectModel
|
||||
),
|
||||
);
|
||||
|
||||
private static $_cache_get_counties = array();
|
||||
private static $_cache_county_zipcode = array();
|
||||
protected static $_cache_get_counties = array();
|
||||
protected static $_cache_county_zipcode = array();
|
||||
|
||||
const USE_BOTH_TAX = 0;
|
||||
const USE_COUNTY_TAX = 1;
|
||||
|
||||
@@ -27,10 +27,9 @@
|
||||
|
||||
class FileUploaderCore
|
||||
{
|
||||
|
||||
private $allowedExtensions = array();
|
||||
private $file;
|
||||
private $sizeLimit;
|
||||
protected $allowedExtensions = array();
|
||||
protected $file;
|
||||
protected $sizeLimit;
|
||||
|
||||
public function __construct(array $allowedExtensions = array(), $sizeLimit = 10485760)
|
||||
{
|
||||
|
||||
@@ -698,7 +698,7 @@ class LanguageCore extends ObjectModel
|
||||
return copy(dirname(__FILE__).'/../img/l/none.jpg', dirname(__FILE__).'/../img/l/'.$id.'.jpg');
|
||||
}
|
||||
|
||||
private static $_cache_language_installation = null;
|
||||
protected static $_cache_language_installation = null;
|
||||
public static function isInstalled($iso_code)
|
||||
{
|
||||
if (self::$_cache_language_installation === null)
|
||||
|
||||
@@ -59,7 +59,7 @@ abstract class ObjectModelCore
|
||||
|
||||
protected $id_shop = null;
|
||||
|
||||
private $get_shop_from_context = true;
|
||||
protected $get_shop_from_context = true;
|
||||
|
||||
protected static $fieldsRequiredDatabase = null;
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ class ProfileCore extends ObjectModel
|
||||
),
|
||||
);
|
||||
|
||||
private static $_cache_accesses = array();
|
||||
protected static $_cache_accesses = array();
|
||||
|
||||
/**
|
||||
* Get all available profiles
|
||||
|
||||
+1
-1
@@ -1534,7 +1534,7 @@ class ToolsCore
|
||||
return Media::cccJS($js_files);
|
||||
}
|
||||
|
||||
private static $_cache_nb_media_servers = null;
|
||||
protected static $_cache_nb_media_servers = null;
|
||||
|
||||
public static function getMediaServer($filename)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,9 @@ class UpgraderCore
|
||||
/**
|
||||
* @var boolean contains true if last version is not installed
|
||||
*/
|
||||
private $need_upgrade = false;
|
||||
private $changed_files = array();
|
||||
private $missing_files = array();
|
||||
protected $need_upgrade = false;
|
||||
protected $changed_files = array();
|
||||
protected $missing_files = array();
|
||||
|
||||
public $version_name;
|
||||
public $version_num;
|
||||
|
||||
@@ -35,8 +35,8 @@ class ShopUrlCore extends ObjectModel
|
||||
public $main;
|
||||
public $active;
|
||||
|
||||
private static $main_domain = null;
|
||||
private static $main_domain_ssl = null;
|
||||
protected static $main_domain = null;
|
||||
protected static $main_domain_ssl = null;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
|
||||
@@ -35,7 +35,7 @@ class TaxRulesTaxManagerCore implements TaxManagerInterface
|
||||
public $type;
|
||||
public $tax_calculator;
|
||||
|
||||
private static $cache_tax_calculator;
|
||||
protected static $cache_tax_calculator;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -420,7 +420,7 @@ class WebserviceOutputBuilderCore
|
||||
* @param $ws_params webserviceParams from the entity
|
||||
* @return string
|
||||
*/
|
||||
private function renderSchema($object, $ws_params)
|
||||
protected function renderSchema($object, $ws_params)
|
||||
{
|
||||
$output = $this->objectRender->renderNodeHeader($ws_params['objectNodeName'], $ws_params);
|
||||
foreach ($ws_params['fields'] as $field_name => $field)
|
||||
@@ -499,7 +499,7 @@ class WebserviceOutputBuilderCore
|
||||
* @param int $depth
|
||||
* @return string
|
||||
*/
|
||||
private function renderField($object, $ws_params, $field_name, $field, $depth)
|
||||
protected function renderField($object, $ws_params, $field_name, $field, $depth)
|
||||
{
|
||||
$output = '';
|
||||
$show_field = true;
|
||||
@@ -560,7 +560,7 @@ class WebserviceOutputBuilderCore
|
||||
* @param $ws_params
|
||||
* @return string
|
||||
*/
|
||||
private function renderAssociations($object, $depth, $associations, $ws_params)
|
||||
protected function renderAssociations($object, $depth, $associations, $ws_params)
|
||||
{
|
||||
$output = $this->objectRender->renderAssociationWrapperHeader();
|
||||
foreach ($associations as $assoc_name => $association)
|
||||
@@ -643,7 +643,7 @@ class WebserviceOutputBuilderCore
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function renderFlatAssociation($object, $depth, $assoc_name, $resource_name, $fields_assoc, $object_assoc, $parent_details)
|
||||
protected function renderFlatAssociation($object, $depth, $assoc_name, $resource_name, $fields_assoc, $object_assoc, $parent_details)
|
||||
{
|
||||
$output = '';
|
||||
$more_attr = array();
|
||||
@@ -721,7 +721,7 @@ class WebserviceOutputBuilderCore
|
||||
$this->specificFields[$field_name] = array('entity'=>$entity_name, 'object' => $object, 'method' => $method, 'type' => gettype($object));
|
||||
return $this;
|
||||
}
|
||||
private function validateObjectAndMethod($object, $method)
|
||||
protected function validateObjectAndMethod($object, $method)
|
||||
{
|
||||
if (is_string($object) && !class_exists($object))
|
||||
throw new WebserviceException ('The object you want to set in '.__METHOD__.' is not allowed.', array(98, 500));
|
||||
@@ -732,7 +732,7 @@ class WebserviceOutputBuilderCore
|
||||
{
|
||||
return $this->specificFields;
|
||||
}
|
||||
private function overrideSpecificField($entity_name, $field_name, $field, $entity_object, $ws_params)
|
||||
protected function overrideSpecificField($entity_name, $field_name, $field, $entity_object, $ws_params)
|
||||
{
|
||||
if (array_key_exists($field_name, $this->specificFields) && $this->specificFields[$field_name]['entity'] == $entity_name)
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
/**
|
||||
* @var array The type of images (general, categories, manufacturers, suppliers, stores...)
|
||||
*/
|
||||
private $imageTypes = array(
|
||||
protected $imageTypes = array(
|
||||
'general' => array(
|
||||
'header' => array(),
|
||||
'mail' => array(),
|
||||
@@ -56,12 +56,12 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
/**
|
||||
* @var string The image type (product, category, general,...)
|
||||
*/
|
||||
private $imageType = NULL;
|
||||
protected $imageType = null;
|
||||
|
||||
/**
|
||||
* @var int The maximum size supported when uploading images, in bytes
|
||||
*/
|
||||
private $imgMaxUploadSize = 3000000;
|
||||
protected $imgMaxUploadSize = 3000000;
|
||||
|
||||
/**
|
||||
* @var array The list of supported mime types
|
||||
@@ -71,7 +71,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
/**
|
||||
* @var string The product image declination id
|
||||
*/
|
||||
protected $productImageDeclinationId = NULL;
|
||||
protected $productImageDeclinationId = null;
|
||||
|
||||
/**
|
||||
* @var boolean If the current image management has to manage a "default" image (i.e. "No product available")
|
||||
@@ -150,7 +150,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function manageImages()
|
||||
protected function manageImages()
|
||||
{
|
||||
/*
|
||||
* available cases api/... :
|
||||
@@ -315,7 +315,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function manageGeneralImages()
|
||||
protected function manageGeneralImages()
|
||||
{
|
||||
$path = '';
|
||||
$alternative_path = '';
|
||||
@@ -393,7 +393,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
break;
|
||||
case 'PUT':
|
||||
|
||||
if ($this->writePostedImageOnDisk($path, NULL, NULL))
|
||||
if ($this->writePostedImageOnDisk($path, null, null))
|
||||
{
|
||||
if ($this->wsObject->urlSegment[2] == 'header')
|
||||
{
|
||||
@@ -410,7 +410,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
}
|
||||
}
|
||||
|
||||
private function manageDefaultDeclinatedImages($directory, $normal_image_sizes)
|
||||
protected function manageDefaultDeclinatedImages($directory, $normal_image_sizes)
|
||||
{
|
||||
$this->defaultImage = true;
|
||||
// Get the language iso code list
|
||||
@@ -455,7 +455,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
}
|
||||
}
|
||||
|
||||
private function manageListDeclinatedImages($directory, $normal_image_sizes)
|
||||
protected function manageListDeclinatedImages($directory, $normal_image_sizes)
|
||||
{
|
||||
// Check if method is allowed
|
||||
if ($this->wsObject->method != 'GET')
|
||||
@@ -502,7 +502,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
return true;
|
||||
}
|
||||
|
||||
private function manageEntityDeclinatedImages($directory, $normal_image_sizes)
|
||||
protected function manageEntityDeclinatedImages($directory, $normal_image_sizes)
|
||||
{
|
||||
$normal_image_size_names = array();
|
||||
foreach ($normal_image_sizes as $normal_image_size)
|
||||
@@ -634,7 +634,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
* @param string $directory the file path of the root of the images folder type
|
||||
* @return boolean
|
||||
*/
|
||||
private function manageDeclinatedImages($directory)
|
||||
protected function manageDeclinatedImages($directory)
|
||||
{
|
||||
// Get available image sizes for the current image type
|
||||
$normal_image_sizes = ImageType::getImagesTypes($this->imageType);
|
||||
@@ -655,7 +655,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
|
||||
}
|
||||
|
||||
private function manageProductImages()
|
||||
protected function manageProductImages()
|
||||
{
|
||||
$this->manageDeclinatedImages(_PS_PROD_IMG_DIR_);
|
||||
}
|
||||
@@ -669,7 +669,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
* @param string $directory
|
||||
* @return boolean
|
||||
*/
|
||||
private function manageDeclinatedImagesCRUD($filename_exists, $filename, $imageSizes, $directory)
|
||||
protected function manageDeclinatedImagesCRUD($filename_exists, $filename, $imageSizes, $directory)
|
||||
{
|
||||
switch ($this->wsObject->method)
|
||||
{
|
||||
@@ -684,7 +684,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
// Modify the image
|
||||
case 'PUT':
|
||||
if ($filename_exists)
|
||||
if ($this->writePostedImageOnDisk($filename, NULL, NULL, $imageSizes, $directory))
|
||||
if ($this->writePostedImageOnDisk($filename, null, null, $imageSizes, $directory))
|
||||
{
|
||||
$this->imgToDisplay = $filename;
|
||||
return true;
|
||||
@@ -716,7 +716,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
throw new WebserviceException('This image already exists. To modify it, please use the PUT method', array(65, 400));
|
||||
else
|
||||
{
|
||||
if ($this->writePostedImageOnDisk($filename, NULL, NULL, $imageSizes, $directory))
|
||||
if ($this->writePostedImageOnDisk($filename, null, null, $imageSizes, $directory))
|
||||
return true;
|
||||
else
|
||||
throw new WebserviceException('Unable to save this image', array(66, 500));
|
||||
@@ -735,7 +735,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
* @param string $parentPath The parent path
|
||||
* @return boolean
|
||||
*/
|
||||
private function deleteImageOnDisk($filePath, $imageTypes = NULL, $parentPath = NULL)
|
||||
protected function deleteImageOnDisk($filePath, $imageTypes = null, $parentPath = null)
|
||||
{
|
||||
$this->wsObject->setOutputEnabled(false);
|
||||
if (file_exists($filePath))
|
||||
@@ -778,13 +778,13 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
* @param string $parentPath
|
||||
* @return string
|
||||
*/
|
||||
private function writeImageOnDisk($basePath, $newPath, $destWidth = NULL, $destHeight = NULL, $imageTypes = NULL, $parentPath = NULL)
|
||||
protected function writeImageOnDisk($basePath, $newPath, $destWidth = null, $destHeight = null, $imageTypes = null, $parentPath = null)
|
||||
{
|
||||
list($sourceWidth, $sourceHeight, $type, $attr) = getimagesize($basePath);
|
||||
if (!$sourceWidth)
|
||||
throw new WebserviceException('Image width was null', array(68, 400));
|
||||
if ($destWidth == NULL) $destWidth = $sourceWidth;
|
||||
if ($destHeight == NULL) $destHeight = $sourceHeight;
|
||||
if ($destWidth == null) $destWidth = $sourceWidth;
|
||||
if ($destHeight == null) $destHeight = $sourceHeight;
|
||||
switch ($type)
|
||||
{
|
||||
case 1:
|
||||
@@ -802,14 +802,14 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
$widthDiff = $destWidth / $sourceWidth;
|
||||
$heightDiff = $destHeight / $sourceHeight;
|
||||
|
||||
if ($widthDiff > 1 AND $heightDiff > 1)
|
||||
if ($widthDiff > 1 && $heightDiff > 1)
|
||||
{
|
||||
$nextWidth = $sourceWidth;
|
||||
$nextHeight = $sourceHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 2 OR ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 AND $widthDiff > $heightDiff))
|
||||
if ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 2 || ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 && $widthDiff > $heightDiff))
|
||||
{
|
||||
$nextHeight = $destHeight;
|
||||
$nextWidth = (int)(($sourceWidth * $nextHeight) / $sourceHeight);
|
||||
@@ -888,11 +888,11 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
* @param string $parentPath
|
||||
* @return boolean
|
||||
*/
|
||||
private function writePostedImageOnDisk($receptionPath, $destWidth = NULL, $destHeight = NULL, $imageTypes = NULL, $parentPath = NULL)
|
||||
protected function writePostedImageOnDisk($receptionPath, $destWidth = null, $destHeight = null, $imageTypes = null, $parentPath = null)
|
||||
{
|
||||
if ($this->wsObject->method == 'PUT')
|
||||
{
|
||||
if (isset($_FILES['image']['tmp_name']) AND $_FILES['image']['tmp_name'])
|
||||
if (isset($_FILES['image']['tmp_name']) && $_FILES['image']['tmp_name'])
|
||||
{
|
||||
$file = $_FILES['image'];
|
||||
if ($file['size'] > $this->imgMaxUploadSize)
|
||||
@@ -923,7 +923,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
throw new WebserviceException('Error while uploading image. Please change your server\'s settings', array(74, 400));
|
||||
|
||||
// Try to copy image file to a temporary file
|
||||
if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['image']['tmp_name'], $tmpName))
|
||||
if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['image']['tmp_name'], $tmpName))
|
||||
throw new WebserviceException('Error while copying image to the temporary directory', array(75, 400));
|
||||
// Try to copy image file to the image directory
|
||||
else
|
||||
@@ -938,15 +938,15 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
}
|
||||
elseif ($this->wsObject->method == 'POST')
|
||||
{
|
||||
if (isset($_FILES['image']['tmp_name']) AND $_FILES['image']['tmp_name'])
|
||||
if (isset($_FILES['image']['tmp_name']) && $_FILES['image']['tmp_name'])
|
||||
{
|
||||
$file = $_FILES['image'];
|
||||
if ($file['size'] > $this->imgMaxUploadSize)
|
||||
throw new WebserviceException(sprintf('The image size is too large (maximum allowed is %d KB)', ($this->imgMaxUploadSize/1000)), array(72, 400));
|
||||
require_once(_PS_ROOT_DIR_.'/images.inc.php');
|
||||
if (ImageManager::validateUpload($file))
|
||||
if ($error = ImageManager::validateUpload($file))
|
||||
throw new WebserviceException('Image upload error : '.$error, array(76, 400));
|
||||
if (isset($file['tmp_name']) AND $file['tmp_name'] != NULL)
|
||||
if (isset($file['tmp_name']) && $file['tmp_name'] != null)
|
||||
{
|
||||
if ($this->imageType == 'products')
|
||||
{
|
||||
@@ -974,7 +974,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
if (!(Configuration::get('PS_OLD_FILESYSTEM') && file_exists(_PS_PROD_IMG_DIR_.$product->id.'-'.$image->id.'.jpg')))
|
||||
$image->createImgFolder();
|
||||
|
||||
if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($file['tmp_name'], $tmpName))
|
||||
if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($file['tmp_name'], $tmpName))
|
||||
throw new WebserviceException('An error occurred during the image upload', array(76, 400));
|
||||
elseif (!ImageManager::resize($tmpName, _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'.'.$image->image_format))
|
||||
throw new WebserviceException('An error occurred while copying image', array(76, 400));
|
||||
@@ -990,7 +990,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
}
|
||||
elseif ($this->imageType == 'categories')
|
||||
{
|
||||
if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($file['tmp_name'], $tmpName))
|
||||
if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($file['tmp_name'], $tmpName))
|
||||
throw new WebserviceException('An error occurred during the image upload', array(76, 400));
|
||||
elseif (!ImageManager::resize($tmpName, $receptionPath))
|
||||
throw new WebserviceException('An error occurred while copying image', array(76, 400));
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class AdminAddressesControllerCore extends AdminController
|
||||
{
|
||||
/** @var array countries list */
|
||||
private $countries_array = array();
|
||||
protected $countries_array = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class AdminAttachmentsControllerCore extends AdminController
|
||||
{
|
||||
|
||||
private $product_attachements = array();
|
||||
protected $product_attachements = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
{
|
||||
private $combinations = array();
|
||||
private $product;
|
||||
protected $combinations = array();
|
||||
protected $product;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -61,7 +61,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
return array();
|
||||
}
|
||||
|
||||
private static function createCombinations($list)
|
||||
protected static function createCombinations($list)
|
||||
{
|
||||
if (count($list) <= 1)
|
||||
return count($list) ? array_map(create_function('$v', 'return (array($v));'), $list[0]) : $list;
|
||||
@@ -135,7 +135,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
private static function displayAndReturnAttributeJs()
|
||||
protected static function displayAndReturnAttributeJs()
|
||||
{
|
||||
$attributes = Attribute::getAttributes(Context::getContext()->language->id, true);
|
||||
$attribute_js = array();
|
||||
@@ -158,7 +158,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
return $attribute_js;
|
||||
}
|
||||
|
||||
private static function setAttributesImpacts($id_product, $tab)
|
||||
protected static function setAttributesImpacts($id_product, $tab)
|
||||
{
|
||||
$attributes = array();
|
||||
foreach ($tab as $group)
|
||||
@@ -172,7 +172,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
private static function getAttributesImpacts($id_product)
|
||||
protected static function getAttributesImpacts($id_product)
|
||||
{
|
||||
$tab = array();
|
||||
$result = Db::getInstance()->executeS(
|
||||
|
||||
@@ -30,7 +30,7 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
/**
|
||||
* @var object Category() instance for navigation
|
||||
*/
|
||||
private $_category = null;
|
||||
protected $_category = null;
|
||||
protected $position_identifier = 'id_category_to_move';
|
||||
|
||||
public function __construct()
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
class AdminCmsContentControllerCore extends AdminController
|
||||
{
|
||||
/** @var object adminCMSCategories() instance */
|
||||
private $adminCMSCategories;
|
||||
protected $adminCMSCategories;
|
||||
|
||||
/** @var object adminCMS() instance */
|
||||
private $adminCMS;
|
||||
protected $adminCMS;
|
||||
|
||||
/** @var object Category() instance for navigation*/
|
||||
private static $_category = null;
|
||||
protected static $_category = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
class AdminCmsControllerCore extends AdminController
|
||||
{
|
||||
private $_category;
|
||||
protected $_category;
|
||||
|
||||
public $id_cms_category;
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
class AdminEmployeesControllerCore extends AdminController
|
||||
{
|
||||
/** @var array profiles list */
|
||||
private $profiles_array = array();
|
||||
protected $profiles_array = array();
|
||||
|
||||
/** @var array themes list*/
|
||||
private $themes = array();
|
||||
protected $themes = array();
|
||||
|
||||
/** @var array tabs list*/
|
||||
private $tabs_list = array();
|
||||
protected $tabs_list = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
|
||||
class AdminImagesControllerCore extends AdminController
|
||||
{
|
||||
private $start_time = 0;
|
||||
private $max_execution_time = 7200;
|
||||
protected $start_time = 0;
|
||||
protected $max_execution_time = 7200;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -592,7 +592,7 @@ class AdminImportControllerCore extends AdminController
|
||||
));
|
||||
}
|
||||
|
||||
private static function rewindBomAware($handle)
|
||||
protected static function rewindBomAware($handle)
|
||||
{
|
||||
// A rewind wrapper that skip BOM signature wrongly
|
||||
rewind($handle);
|
||||
@@ -600,19 +600,19 @@ class AdminImportControllerCore extends AdminController
|
||||
rewind($handle);
|
||||
}
|
||||
|
||||
private static function getBoolean($field)
|
||||
protected static function getBoolean($field)
|
||||
{
|
||||
return (boolean)$field;
|
||||
}
|
||||
|
||||
private static function getPrice($field)
|
||||
protected static function getPrice($field)
|
||||
{
|
||||
$field = ((float)str_replace(',', '.', $field));
|
||||
$field = ((float)str_replace('%', '', $field));
|
||||
return $field;
|
||||
}
|
||||
|
||||
private static function split($field)
|
||||
protected static function split($field)
|
||||
{
|
||||
if (empty($field))
|
||||
return array();
|
||||
@@ -633,7 +633,7 @@ class AdminImportControllerCore extends AdminController
|
||||
|
||||
}
|
||||
|
||||
private static function createMultiLangField($field)
|
||||
protected static function createMultiLangField($field)
|
||||
{
|
||||
$languages = Language::getLanguages(false);
|
||||
$res = array();
|
||||
@@ -709,14 +709,14 @@ class AdminImportControllerCore extends AdminController
|
||||
return $res;
|
||||
}
|
||||
|
||||
private static function setDefaultValues(&$info)
|
||||
protected static function setDefaultValues(&$info)
|
||||
{
|
||||
foreach (self::$default_values as $k => $v)
|
||||
if (!isset($info[$k]) || $info[$k] == '')
|
||||
$info[$k] = $v;
|
||||
}
|
||||
|
||||
private static function setEntityDefaultValues(&$entity)
|
||||
protected static function setEntityDefaultValues(&$entity)
|
||||
{
|
||||
$members = get_object_vars($entity);
|
||||
foreach (self::$default_values as $k => $v)
|
||||
@@ -724,7 +724,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$entity->$k = $v;
|
||||
}
|
||||
|
||||
private static function fillInfo($infos, $key, &$entity)
|
||||
protected static function fillInfo($infos, $key, &$entity)
|
||||
{
|
||||
if (isset(self::$validators[$key][1]) && self::$validators[$key][1] == 'createMultiLangField' && Tools::getValue('iso_lang'))
|
||||
{
|
||||
@@ -760,7 +760,7 @@ class AdminImportControllerCore extends AdminController
|
||||
* @param string entity 'products' or 'categories'
|
||||
* @return void
|
||||
*/
|
||||
private static function copyImg($id_entity, $id_image = null, $url, $entity = 'products')
|
||||
protected static function copyImg($id_entity, $id_image = null, $url, $entity = 'products')
|
||||
{
|
||||
$tmpfile = tempnam(_PS_TMP_IMG_DIR_, 'ps_import');
|
||||
$watermark_types = explode(',', Configuration::get('WATERMARK_TYPES'));
|
||||
@@ -2108,7 +2108,7 @@ class AdminImportControllerCore extends AdminController
|
||||
return count($tmp);
|
||||
}
|
||||
|
||||
private static function usortFiles($a, $b)
|
||||
protected static function usortFiles($a, $b)
|
||||
{
|
||||
$a = strrev(substr(strrev($a), 0, 14));
|
||||
$b = strrev(substr(strrev($b), 0, 14));
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class AdminManufacturersControllerCore extends AdminController
|
||||
{
|
||||
/** @var array countries list */
|
||||
private $countries_array = array();
|
||||
protected $countries_array = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
/*
|
||||
** @var array map with $_GET keywords and their callback
|
||||
*/
|
||||
private $map = array(
|
||||
protected $map = array(
|
||||
'install' => 'install',
|
||||
'uninstall' => 'uninstall',
|
||||
'configure' => 'getContent',
|
||||
@@ -39,27 +39,27 @@ class AdminModulesControllerCore extends AdminController
|
||||
'delete' => 'delete'
|
||||
);
|
||||
|
||||
private $list_modules_categories = array();
|
||||
private $list_partners_modules = array();
|
||||
private $list_natives_modules = array();
|
||||
protected $list_modules_categories = array();
|
||||
protected $list_partners_modules = array();
|
||||
protected $list_natives_modules = array();
|
||||
|
||||
private $nb_modules_total = 0;
|
||||
private $nb_modules_installed = 0;
|
||||
private $nb_modules_activated = 0;
|
||||
protected $nb_modules_total = 0;
|
||||
protected $nb_modules_installed = 0;
|
||||
protected $nb_modules_activated = 0;
|
||||
|
||||
private $serial_modules = '';
|
||||
private $modules_authors = array();
|
||||
protected $serial_modules = '';
|
||||
protected $modules_authors = array();
|
||||
|
||||
private $id_employee;
|
||||
private $iso_default_country;
|
||||
private $filter_configuration = array();
|
||||
protected $id_employee;
|
||||
protected $iso_default_country;
|
||||
protected $filter_configuration = array();
|
||||
|
||||
private $xml_modules_list = 'api.prestashop.com/xml/modules_list.xml';
|
||||
private $addons_url = 'api.addons.prestashop.com';
|
||||
private $logged_on_addons = false;
|
||||
private $cache_file_modules_list = '/config/xml/modules_list.xml';
|
||||
private $cache_file_default_country_modules_list = '/config/xml/default_country_modules_list.xml';
|
||||
private $cache_file_customer_modules_list = '/config/xml/customer_modules_list.xml';
|
||||
protected $xml_modules_list = 'api.prestashop.com/xml/modules_list.xml';
|
||||
protected $addons_url = 'api.addons.prestashop.com';
|
||||
protected $logged_on_addons = false;
|
||||
protected $cache_file_modules_list = '/config/xml/modules_list.xml';
|
||||
protected $cache_file_default_country_modules_list = '/config/xml/default_country_modules_list.xml';
|
||||
protected $cache_file_customer_modules_list = '/config/xml/customer_modules_list.xml';
|
||||
|
||||
/*
|
||||
** Admin Modules Controller Constructor
|
||||
@@ -779,7 +779,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
** Display Modules Lists
|
||||
**
|
||||
*/
|
||||
private $translationsTab = array();
|
||||
protected $translationsTab = array();
|
||||
public function displayModuleOptions($module)
|
||||
{
|
||||
if (!isset($this->translationsTab['Disable this module']))
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
class AdminModulesPositionsControllerCore extends AdminController
|
||||
{
|
||||
private $display_key = 0;
|
||||
protected $display_key = 0;
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
class AdminShippingControllerCore extends AdminController
|
||||
{
|
||||
private $_fieldsHandling;
|
||||
protected $_fieldsHandling;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
/*
|
||||
* @var array List of warehouses
|
||||
*/
|
||||
private $warehouses;
|
||||
protected $warehouses;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -273,7 +273,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
* @param string $target_theme_dir relative path to target dir
|
||||
* @return boolean true if success
|
||||
*/
|
||||
private static function copyTheme($base_theme_dir, $target_theme_dir)
|
||||
protected static function copyTheme($base_theme_dir, $target_theme_dir)
|
||||
{
|
||||
$res = true;
|
||||
$base_theme_dir = rtrim($base_theme_dir, '/').'/';
|
||||
|
||||
Reference in New Issue
Block a user