// Context part 13

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7650 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-07-19 09:44:10 +00:00
parent 89213e18e5
commit 35e5efb530
35 changed files with 101 additions and 117 deletions
+1 -1
View File
@@ -235,7 +235,7 @@ class AddressFormatCore extends ObjectModel
* @addressFormat is the format
* @return double Array
*/
public static function getFormattedAddressFieldsValues($address, $addressFormat, $context = null)
public static function getFormattedAddressFieldsValues($address, $addressFormat, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+1 -1
View File
@@ -1801,7 +1801,7 @@ abstract class AdminTabCore
* @param integer $id_lang Language id (optional)
* @return string
*/
protected function getFieldValue($obj, $key, $id_lang = NULL, $context = NULL)
protected function getFieldValue($obj, $key, $id_lang = NULL, Context $context = NULL)
{
$id_shop = ($context) ? $context->shop->getID() : null;
if (!$context)
+1 -1
View File
@@ -104,7 +104,7 @@ class CMSCore extends ObjectModel
return false;
}
public static function getLinks($id_lang, $selection = NULL, $active = true, $id_shop = false, $context = null)
public static function getLinks($id_lang, $selection = NULL, $active = true, $id_shop = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+5 -5
View File
@@ -145,7 +145,7 @@ class CMSCategoryCore extends ObjectModel
*
* @return array Subcategories lite tree
*/
function recurseLiteCategTree($maxDepth = 3, $currentDepth = 0, $idLang = NULL, $excludedIdsArray = NULL, $context = null)
function recurseLiteCategTree($maxDepth = 3, $currentDepth = 0, $idLang = NULL, $excludedIdsArray = NULL, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -176,7 +176,7 @@ class CMSCategoryCore extends ObjectModel
);
}
static public function getRecurseCategory($id_lang = null, $current = 1, $active = 1, $links = 0, $id_shop = false, $context = null)
static public function getRecurseCategory($id_lang = null, $current = 1, $active = 1, $links = 0, $id_shop = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -466,14 +466,14 @@ class CMSCategoryCore extends ObjectModel
return $result['link_rewrite'];
}
public function getLink($context = null)
public function getLink(Context $context = null)
{
if (!$context)
$context = Context::getContext();
return $context->link->getCMSCategoryLink($this->id, $this->link_rewrite);
}
public function getName($id_lang = NULL, $context = null)
public function getName($id_lang = NULL, Context $context = null)
{
if (!$id_lang)
{
@@ -536,7 +536,7 @@ class CMSCategoryCore extends ObjectModel
* @param integer $id_lang Language ID
* @return array Corresponding categories
*/
public function getParentsCategories($idLang = null, $context = null)
public function getParentsCategories($idLang = null, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+10 -10
View File
@@ -333,7 +333,7 @@ class CartCore extends ObjectModel
*
* @result array Products
*/
public function getProducts($refresh = false, $id_product = false, $context = null)
public function getProducts($refresh = false, $id_product = false, Context $context = null)
{
if (!$this->id)
return array();
@@ -642,7 +642,7 @@ class CartCore extends ObjectModel
/*
** Customization management
*/
protected function _updateCustomizationQuantity($quantity, $id_customization, $id_product, $id_product_attribute, $operator = 'up', $context = null)
protected function _updateCustomizationQuantity($quantity, $id_customization, $id_product, $id_product_attribute, $operator = 'up', Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -975,7 +975,7 @@ class CartCore extends ObjectModel
* @param integer $id_carrier Carrier ID (default : current carrier)
* @return float Shipping total
*/
function getOrderShippingCost($id_carrier = NULL, $useTax = true, $context = null)
function getOrderShippingCost($id_carrier = NULL, $useTax = true, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1231,7 +1231,7 @@ class CartCore extends ObjectModel
*
* @return mixed Return a string if an error occurred and false otherwise
*/
function checkDiscountValidity($discountObj, $discounts, $order_total, $products, $checkCartDiscount = false, $id_group_shop = false, $id_shop = false, $context = null)
function checkDiscountValidity($discountObj, $discounts, $order_total, $products, $checkCartDiscount = false, $id_group_shop = false, $id_shop = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1332,7 +1332,7 @@ class CartCore extends ObjectModel
*
* @return array Cart details
*/
function getSummaryDetails($context = null)
function getSummaryDetails(Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1484,7 +1484,7 @@ class CartCore extends ObjectModel
*
* @return bool Always true
*/
public function addPictureToProduct($id_product, $index, $identifier, $context = null)
public function addPictureToProduct($id_product, $index, $identifier, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1504,7 +1504,7 @@ class CartCore extends ObjectModel
*
* @return bool Always true
*/
public function addTextFieldToProduct($id_product, $index, $textValue, $context = null)
public function addTextFieldToProduct($id_product, $index, $textValue, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1520,7 +1520,7 @@ class CartCore extends ObjectModel
*
* @return bool Always true
*/
public function deleteTextFieldFromProduct($id_product, $index, $context = null)
public function deleteTextFieldFromProduct($id_product, $index, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1534,7 +1534,7 @@ class CartCore extends ObjectModel
*
* @return bool
*/
public function deletePictureToProduct($id_product, $index, $context = null)
public function deletePictureToProduct($id_product, $index, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1552,7 +1552,7 @@ class CartCore extends ObjectModel
return false;
}
static public function deleteCustomizationInformations($id_product, $context = null)
static public function deleteCustomizationInformations($id_product, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+6 -6
View File
@@ -189,7 +189,7 @@ class CategoryCore extends ObjectModel
*
* @return array Subcategories lite tree
*/
function recurseLiteCategTree($maxDepth = 3, $currentDepth = 0, $idLang = NULL, $excludedIdsArray = NULL, $context = null)
function recurseLiteCategTree($maxDepth = 3, $currentDepth = 0, $idLang = NULL, $excludedIdsArray = NULL, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -451,7 +451,7 @@ class CategoryCore extends ObjectModel
* @param boolean $checkAccess set to false to return all products (even if customer hasn't access)
* @return mixed Products or number of products
*/
public function getProducts($id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true, $random = false, $randomNumberProducts = 1, $checkAccess = true, $context = null)
public function getProducts($id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true, $random = false, $randomNumberProducts = 1, $checkAccess = true, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -567,7 +567,7 @@ class CategoryCore extends ObjectModel
return self::getChildren(1, $id_lang, $active);
}
static public function getRootCategory($id_lang = NULL, $id_shop = false, $context = null)
static public function getRootCategory($id_lang = NULL, $id_shop = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -710,14 +710,14 @@ class CategoryCore extends ObjectModel
return $result['link_rewrite'];
}
public function getLink($context = null)
public function getLink(Context $context = null)
{
if (!$context)
$context = Context::getContext();
return $context->link->getCategoryLink($this->id, $this->link_rewrite);
}
public function getName($id_lang = NULL, $context = null)
public function getName($id_lang = NULL, Context $context = null)
{
if (!$id_lang)
{
@@ -781,7 +781,7 @@ class CategoryCore extends ObjectModel
* @param integer $id_lang Language ID
* @return array Corresponding categories
*/
public function getParentsCategories($idLang = null, $context = null)
public function getParentsCategories($idLang = null, Context $context = null)
{
//get idLang
$idLang = is_null($idLang) ? $context->language->id : $idLang;
+1 -1
View File
@@ -59,7 +59,7 @@ class ConnectionsSourceCore extends ObjectModel
return $result;
}
public static function logHttpReferer($context = null)
public static function logHttpReferer(Context $context = null)
{
if (!$context)
$context = Context::getContext();
+1 -1
View File
@@ -614,7 +614,7 @@ class CustomerCore extends ObjectModel
return self::$_defaultGroupId[(int)($id_customer)];
}
static public function getCurrentCountry($id_customer, $context = null)
static public function getCurrentCountry($id_customer, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+2 -2
View File
@@ -229,7 +229,7 @@ class DiscountCore extends ObjectModel
* @param boolean $id_customer Customer ID
* @return array Discounts
*/
static public function getCustomerDiscounts($id_lang, $id_customer, $active = false, $includeGenericOnes = true, $stock = false, $context = null)
static public function getCustomerDiscounts($id_lang, $id_customer, $active = false, $includeGenericOnes = true, $stock = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -276,7 +276,7 @@ class DiscountCore extends ObjectModel
* @param boolean $order_total_products Total cart products amount
* @return mixed Return a float value or '!' if reduction is 'Shipping free'
*/
public function getValue($nb_discounts = 0, $order_total_products = 0, $shipping_fees = 0, $idCart = false, $useTax = true, $id_group_shop = false, $id_shop = false, $context = null)
public function getValue($nb_discounts = 0, $order_total_products = 0, $shipping_fees = 0, $idCart = false, $useTax = true, $id_group_shop = false, $id_shop = false, Context $context = null)
{
$totalAmount = 0;
+4 -4
View File
@@ -179,7 +179,7 @@ class LinkCore
return Tools::getProtocol().Tools::getMediaServer($filepath).$filepath;
}
public function preloadPageLinks($context = null)
public function preloadPageLinks(Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -195,7 +195,7 @@ class LinkCore
self::$cache['page'][$row['page'].'.php_'.$context->language->id] = $this->getLangLink($context->language->id).$row['url_rewrite'];
}
public function getPageLink($filename, $ssl = false, $id_lang = NULL, $request = NULL, $context = null)
public function getPageLink($filename, $ssl = false, $id_lang = NULL, $request = NULL, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -245,7 +245,7 @@ class LinkCore
* @param integer $id_lang Language ID
* @return string link
*/
public function getLanguageLink($id_lang, $context = null)
public function getLanguageLink($id_lang, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -357,7 +357,7 @@ class LinkCore
return $url.(!strstr($url, '?') ? '?' : '&').'orderby='.urlencode($orderby).'&orderway='.urlencode($orderway);
}
protected function getLangLink($id_lang = NULL, $context = null)
protected function getLangLink($id_lang = NULL, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+1 -1
View File
@@ -201,7 +201,7 @@ class MailCore
*
* @param string $string raw sentence (write directly in file)
*/
static public function l($string, $context = null)
static public function l($string, Context $context = null)
{
global $_LANGMAIL;
if (!$context)
+1 -1
View File
@@ -273,7 +273,7 @@ class ManufacturerCore extends ObjectModel
return Tools::link_rewrite($this->name, false);
}
static public function getProducts($id_manufacturer, $id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true, $context = null)
static public function getProducts($id_manufacturer, $id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+2 -2
View File
@@ -98,7 +98,7 @@ class MessageCore extends ObjectModel
* @param boolean $private return WITH private messages
* @return array Messages
*/
static public function getMessagesByOrderId($id_order, $private = false, $context = null)
static public function getMessagesByOrderId($id_order, $private = false, Context $context = null)
{
if (!Validate::isBool($private))
die(Tools::displayError());
@@ -125,7 +125,7 @@ class MessageCore extends ObjectModel
* @param boolean $private return WITH private messages
* @return array Messages
*/
static public function getMessagesByCartId($id_cart, $private = false, $context = null)
static public function getMessagesByCartId($id_cart, $private = false, Context $context = null)
{
if (!Validate::isBool($private))
die(Tools::displayError());
+1 -1
View File
@@ -286,7 +286,7 @@ abstract class ModuleGraphCore extends Module
return call_user_func(array($render, 'hookGraphEngine'), $params, $drawer);
}
protected static function getEmployee($employee = null, $context = null)
protected static function getEmployee($employee = null, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+1 -1
View File
@@ -512,7 +512,7 @@ abstract class ObjectModelCore
return true;
}
static public function displayFieldName($field, $className = __CLASS__, $htmlentities = true, $context = null)
static public function displayFieldName($field, $className = __CLASS__, $htmlentities = true, Context $context = null)
{
global $_FIELDS;
@include(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php');
+2 -2
View File
@@ -626,7 +626,7 @@ class OrderCore extends ObjectModel
* @param boolean $showHiddenStatus Display or not hidden order statuses
* @return array Customer orders
*/
static public function getCustomerOrders($id_customer, $showHiddenStatus = false, $context = null)
static public function getCustomerOrders($id_customer, $showHiddenStatus = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -685,7 +685,7 @@ class OrderCore extends ObjectModel
'.((int)$limit ? 'LIMIT 0, '.(int)$limit : ''));
}
static public function getOrdersWithInformations($limit = NULL, $context = null)
static public function getOrdersWithInformations($limit = NULL, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+1 -1
View File
@@ -127,7 +127,7 @@ class OrderHistoryCore extends ObjectModel
return new OrderState($id_order_state, Configuration::get('PS_LANG_DEFAULT'));
}
public function addWithemail($autodate = true, $templateVars = false, $context = null)
public function addWithemail($autodate = true, $templateVars = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+1 -1
View File
@@ -132,7 +132,7 @@ class OrderReturnCore extends ObjectModel
return (int)($data['total']);
}
static public function getOrdersReturn($customer_id, $order_id = false, $no_denied = false, $context = null)
static public function getOrdersReturn($customer_id, $order_id = false, $no_denied = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+1 -1
View File
@@ -476,7 +476,7 @@ class PDFCore extends PDF_PageGroupCore
* @param object $order Order
* @param string $mode Download or display (optional)
*/
public static function invoice($order, $mode = 'D', $multiple = false, &$pdf = NULL, $slip = false, $delivery = false, $context = null)
public static function invoice($order, $mode = 'D', $multiple = false, &$pdf = NULL, $slip = false, $delivery = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+12 -12
View File
@@ -288,7 +288,7 @@ class ProductCore extends ObjectModel
),
);
public function __construct($id_product = NULL, $full = false, $id_lang = NULL, $id_shop = NULL, $context = NULL)
public function __construct($id_product = NULL, $full = false, $id_lang = NULL, $id_shop = NULL, Context $context = NULL)
{
parent::__construct($id_product, $id_lang, $id_shop);
if (!$context)
@@ -1421,7 +1421,7 @@ class ProductCore extends ObjectModel
return Product::getProductsProperties((int)$id_lang, $result);
}
static protected function _getProductIdByDate($beginning, $ending, $context = null)
static protected function _getProductIdByDate($beginning, $ending, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1707,7 +1707,7 @@ class ProductCore extends ObjectModel
*/
public static function getPriceStatic($id_product, $usetax = true, $id_product_attribute = NULL, $decimals = 6, $divisor = NULL, $only_reduc = false,
$usereduc = true, $quantity = 1, $forceAssociatedTax = false, $id_customer = NULL, $id_cart = NULL, $id_address = NULL, &$specificPriceOutput = NULL,
$with_ecotax = TRUE, $context = null)
$with_ecotax = TRUE, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1908,7 +1908,7 @@ class ProductCore extends ObjectModel
return self::$_prices[$cacheId];
}
public static function convertAndFormatPrice($price, $currency = false, $context = null)
public static function convertAndFormatPrice($price, $currency = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1917,7 +1917,7 @@ class ProductCore extends ObjectModel
return Tools::displayPrice(Tools::convertPrice($price, $currency), $currency);
}
public static function isDiscounted($id_product, $quantity = 1, $context = null)
public static function isDiscounted($id_product, $quantity = 1, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -2081,7 +2081,7 @@ class ProductCore extends ObjectModel
* @param bool $update
* @param Context $context
*/
public function setStock($quantity, $id_product_attribute = 0, $update = false, $context = null)
public function setStock($quantity, $id_product_attribute = 0, $update = false, Context $context = null)
{
if (!$this->id)
return ;
@@ -2157,7 +2157,7 @@ class ProductCore extends ObjectModel
* @param Context $context
* @return int
*/
public function getStock($id_product_attribute = 0, $context = null)
public function getStock($id_product_attribute = 0, Context $context = null)
{
if (!$this->id)
return 0;
@@ -2202,7 +2202,7 @@ class ProductCore extends ObjectModel
return $productObj->addStockMvt(-(int)$product['cart_quantity'], (int)_STOCK_MOVEMENT_ORDER_REASON_, (int)$product['id_product_attribute'], (int)$id_order, NULL);
}
public static function reinjectQuantities(&$orderDetail, $quantity, $context = null)
public static function reinjectQuantities(&$orderDetail, $quantity, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -2749,7 +2749,7 @@ class ProductCore extends ObjectModel
/**
* Get the link of the product page of this product
*/
public function getLink($context = null)
public function getLink(Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -2773,7 +2773,7 @@ class ProductCore extends ObjectModel
return Language::getIsoById((int)$id_lang).'-default';
}
public static function getProductProperties($id_lang, $row, $context = null)
public static function getProductProperties($id_lang, $row, Context $context = null)
{
if (!$row['id_product'])
return false;
@@ -2889,7 +2889,7 @@ class ProductCore extends ObjectModel
** Customization management
*/
public static function getAllCustomizedDatas($id_cart, $id_lang = null, $context = null)
public static function getAllCustomizedDatas($id_cart, $id_lang = null, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -3081,7 +3081,7 @@ class ProductCore extends ObjectModel
return Db::getInstance()->ExecuteS('SELECT `id_customization_field`, `type` FROM `'._DB_PREFIX_.'customization_field` WHERE `id_product` = '.(int)($this->id).' AND `required` = 1');
}
public function hasAllRequiredCustomizableFields($context = null)
public function hasAllRequiredCustomizableFields(Context $context = null)
{
if (!$context)
$context = Context::getContext();
+1 -1
View File
@@ -116,7 +116,7 @@ class ProductSaleCore
** @param integer $nbProducts Number of products to return (optional)
** @return array keys : id_product, link_rewrite, name, id_image, legend, sales, ean13, upc, link
*/
static public function getBestSalesLight($id_lang, $pageNumber = 0, $nbProducts = 10, $id_shop = null, $context = null)
static public function getBestSalesLight($id_lang, $pageNumber = 0, $nbProducts = 10, $id_shop = null, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+2 -2
View File
@@ -181,7 +181,7 @@ class SceneCore extends ObjectModel
*
* @return array Products
*/
static public function getScenes($id_category, $id_lang = NULL, $onlyActive = true, $liteResult = true, $hideScenePosition = true, $context = null)
static public function getScenes($id_category, $id_lang = NULL, $onlyActive = true, $liteResult = true, $hideScenePosition = true, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -206,7 +206,7 @@ class SceneCore extends ObjectModel
*
* @return array Products
*/
public function getProducts($onlyActive = true, $id_lang = NULL, $liteResult = true, $context = null)
public function getProducts($onlyActive = true, $id_lang = NULL, $liteResult = true, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+2 -2
View File
@@ -145,7 +145,7 @@ class SearchCore
return $string;
}
public static function find($id_lang, $expr, $pageNumber = 1, $pageSize = 1, $orderBy = 'position', $orderWay = 'desc', $ajax = false, $useCookie = true, $id_shop = false, $context = null)
public static function find($id_lang, $expr, $pageNumber = 1, $pageSize = 1, $orderBy = 'position', $orderWay = 'desc', $ajax = false, $useCookie = true, $id_shop = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -532,7 +532,7 @@ class SearchCore
$queryArray3 = array();
}
public static function searchTag($id_lang, $tag, $count = false, $pageNumber = 0, $pageSize = 10, $orderBy = false, $orderWay = false, $useCookie = true, $shops = null, $context = null)
public static function searchTag($id_lang, $tag, $count = false, $pageNumber = 0, $pageSize = 10, $orderBy = false, $orderWay = false, $useCookie = true, $shops = null, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+1 -1
View File
@@ -78,7 +78,7 @@ class TabCore extends ObjectModel
return false;
}
static public function initAccess($id_tab, $context = null)
static public function initAccess($id_tab, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+1 -1
View File
@@ -161,7 +161,7 @@ class TagCore extends ObjectModel
return $result;
}
public function getProducts($associated = true, $context = null)
public function getProducts($associated = true, Context $context = null)
{
if (!$context)
$context = Context::getContext();
+12 -12
View File
@@ -55,7 +55,7 @@ class ToolsCore
* @param string $url Desired URL
* @param string $baseUri Base URI (optional)
*/
public static function redirect($url, $baseUri = __PS_BASE_URI__, $context = null)
public static function redirect($url, $baseUri = __PS_BASE_URI__, Context $context = null)
{
if (strpos($url, 'http://') === FALSE && strpos($url, 'https://') === FALSE)
{
@@ -304,7 +304,7 @@ class ToolsCore
return $iso;
}
public static function switchLanguage($context = null)
public static function switchLanguage(Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -341,7 +341,7 @@ class ToolsCore
* @param object $currency Current currency (object, id_currency, NULL => context currency)
* @return string Price correctly formated (sign, decimal separator...)
*/
public static function displayPrice($price, $currency = NULL, $no_utf8 = false, $context = null)
public static function displayPrice($price, $currency = NULL, $no_utf8 = false, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -403,7 +403,7 @@ class ToolsCore
* @param object $currency Current currency object
* @param boolean $to_currency convert to currency or from currency to default currency
*/
public static function convertPrice($price, $currency = NULL, $to_currency = true, $context = null)
public static function convertPrice($price, $currency = NULL, $to_currency = true, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -525,7 +525,7 @@ class ToolsCore
*
* @param integer $code Error code
*/
public static function displayError($string = 'Fatal error', $htmlentities = true, $context = null)
public static function displayError($string = 'Fatal error', $htmlentities = true, Context $context = null)
{
global $_ERRORS;
@@ -720,7 +720,7 @@ class ToolsCore
}
public static function completeMetaTags($metaTags, $defaultValue, $context = null)
public static function completeMetaTags($metaTags, $defaultValue, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -749,7 +749,7 @@ class ToolsCore
*
* @param string $token token to encrypt
*/
public static function getToken($page = true, $context = null)
public static function getToken($page = true, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -768,7 +768,7 @@ class ToolsCore
{
return !empty($string) ? self::encrypt($string) : false;
}
public static function getAdminTokenLite($tab, $context = null)
public static function getAdminTokenLite($tab, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -783,7 +783,7 @@ class ToolsCore
* @param boolean $linkOntheLastItem Put or not a link on the current category
* @param string [optionnal] $categoryType defined what type of categories is used (products or cms)
*/
public static function getPath($id_category, $path = '', $linkOntheLastItem = false, $categoryType = 'products', $context = null)
public static function getPath($id_category, $path = '', $linkOntheLastItem = false, $categoryType = 'products', Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -847,7 +847,7 @@ class ToolsCore
/**
* @param string [optionnal] $type_cat defined what type of categories is used (products or cms)
*/
public static function getFullPath($id_category, $end, $type_cat = 'products', $context = null)
public static function getFullPath($id_category, $end, $type_cat = 'products', Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1855,7 +1855,7 @@ FileETag INode MTime Size
}
}
public static function enableCache($level = 1, $context = null)
public static function enableCache($level = 1, Context $context = null)
{
if (!$context)
$context = Context::getContext();
@@ -1870,7 +1870,7 @@ FileETag INode MTime Size
$smarty->caching = (int)($level);
}
public static function restoreCacheSettings($context = null)
public static function restoreCacheSettings(Context $context = null)
{
if (!$context)
$context = Context::getContext();