// Context part 20

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7740 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-07-26 15:55:04 +00:00
parent fddc7a6a75
commit 51b4c8591d
10 changed files with 72 additions and 73 deletions
+5 -5
View File
@@ -235,10 +235,10 @@ class AddressFormatCore extends ObjectModel
* @addressFormat is the format
* @return double Array
*/
public static function getFormattedAddressFieldsValues($address, $addressFormat, Context $context = null)
public static function getFormattedAddressFieldsValues($address, $addressFormat, $id_lang = null)
{
if (!$context)
$context = Context::getContext();
if (!$id_lang)
$id_lang = Context::getContext()->language->id;
$tab = array();
$temporyObject = array();
@@ -268,8 +268,8 @@ class AddressFormatCore extends ObjectModel
$temporyObject[$associateName[0]] = new $associateName[0]($address->{$idFieldName});
if ($temporyObject[$associateName[0]])
$tab[$pattern] = (is_array($temporyObject[$associateName[0]]->{$associateName[1]})) ?
((isset($temporyObject[$associateName[0]]->{$associateName[1]}[$context->language->id])) ?
$temporyObject[$associateName[0]]->{$associateName[1]}[$context->language->id] : '') :
((isset($temporyObject[$associateName[0]]->{$associateName[1]}[$id_lang])) ?
$temporyObject[$associateName[0]]->{$associateName[1]}[$id_lang] : '') :
$temporyObject[$associateName[0]]->{$associateName[1]};
}
}