//added getWidthSize and getHeightSize method in tpl thanks to @PrestaEdit

This commit is contained in:
vAugagneur
2013-02-05 14:16:47 +01:00
parent 3f8fce6720
commit 64764c4c1e
2 changed files with 15 additions and 0 deletions
+12
View File
@@ -367,6 +367,18 @@ class ImageCore extends ObjectModel
');
return self::$_cacheGetSize[$type];
}
public static function getWidth($params, &$smarty)
{
$result = self::getSize($params['type']);
return $result['width'];
}
public static function getHeight($params, &$smarty)
{
$result = self::getSize($params['type']);
return $result['height'];
}
/**
* Clear all images in tmp dir
+3
View File
@@ -80,6 +80,9 @@ smartyRegisterFunction($smarty, 'function', 'displayPrice', array('Tools', 'disp
smartyRegisterFunction($smarty, 'modifier', 'convertAndFormatPrice', array('Product', 'convertAndFormatPrice')); // used twice
smartyRegisterFunction($smarty, 'function', 'getAdminToken', array('Tools', 'getAdminTokenLiteSmarty'));
smartyRegisterFunction($smarty, 'function', 'displayAddressDetail', array('AddressFormat', 'generateAddressSmarty'));
smartyRegisterFunction($smarty, 'function', 'getWidthSize', array('Image', 'getWidth'));
smartyRegisterFunction($smarty, 'function', 'getHeightSize', array('Image', 'getHeight'));
function smartyDieObject($params, &$smarty)
{