// Use protected instead of private for classes we can override #PSCFV-1976

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