25 #require_once 'Zend/Locale.php'; 26 #require_once 'Zend/Locale/Data.php'; 27 #require_once 'Zend/Locale/Format.php'; 70 'position' => self::STANDARD,
73 'display' => self::NO_SYMBOL,
81 'tag' =>
'Zend_Locale' 96 $this->_options[
'display'] =
$options[
'display'];
110 if (!isset($this->_options[
'currency']) || !is_array(
$options)) {
114 if (!isset($this->_options[
'name']) || !is_array(
$options)) {
118 if (!isset($this->_options[
'symbol']) || !is_array(
$options)) {
122 if (($this->_options[
'currency'] ===
null) and ($this->_options[
'name'] ===
null)) {
123 #require_once 'Zend/Currency/Exception.php'; 128 if ((is_array($calloptions) && !isset($calloptions[
'display']))
129 || (!is_array($calloptions) && $this->_options[
'display'] == self::NO_SYMBOL)) {
130 if (!empty($this->_options[
'symbol'])) {
132 }
else if (!empty($this->_options[
'currency'])) {
152 $value = $this->_options[
'value'];
164 if (!(isset(
$value)) or (is_numeric(
$value) ===
false)) {
165 #require_once 'Zend/Currency/Exception.php'; 171 $options[
'locale'] = $this->_options[
'locale'];
194 'precision' =>
$options[
'precision']));
196 if (
$options[
'position'] !== self::STANDARD) {
199 if (iconv_strpos(
$value,
' ') !==
false) {
204 if (
$options[
'position'] == self::LEFT) {
212 if (empty(
$options[
'script']) ===
false) {
217 if (is_numeric(
$options[
'display']) ===
false) {
222 $sign = $this->_extractPattern(
$options[
'symbol'], $original);
254 if (strpos(
$pattern,
'|') ===
false) {
263 if (strpos(
$content,
'<') !==
false) {
304 private function _checkParams($currency =
null, $locale =
null)
307 if ((empty($locale)) and (!empty($currency)) and
316 $country = substr($locale, (strpos($locale,
'_') + 1));
318 #require_once 'Zend/Currency/Exception.php'; 324 if ((empty($currency) ===
false) and (empty(
$data) ===
false)) {
325 $abbreviation = $currency;
327 $abbreviation =
$data;
330 return array(
'locale' => $locale,
'currency' => $currency,
'name' => $abbreviation,
'country' => $country);
341 public function getSymbol($currency =
null, $locale =
null)
343 if (($currency ===
null) and ($locale ===
null)) {
344 return $this->_options[
'symbol'];
347 $params = self::_checkParams($currency, $locale);
351 if (empty($symbol) ===
true) {
355 if (empty($symbol) ===
true) {
371 if (($currency ===
null) and ($locale ===
null)) {
372 return $this->_options[
'currency'];
375 $params = self::_checkParams($currency, $locale);
378 if (empty(
$params[
'currency']) ===
true) {
383 if (empty($list) ===
true) {
385 if (empty($list) ===
false) {
390 if (empty($list) ===
true) {
404 public function getName($currency =
null, $locale =
null)
406 if (($currency ===
null) and ($locale ===
null)) {
407 return $this->_options[
'name'];
410 $params = self::_checkParams($currency, $locale);
414 if (empty(
$name) ===
true) {
418 if (empty(
$name) ===
true) {
434 if ($currency ===
null) {
435 $currency = $this->_options[
'currency'];
438 if (empty($currency) ===
true) {
439 #require_once 'Zend/Currency/Exception.php'; 459 if (empty($region) ===
true) {
460 if (strlen($this->_options[
'locale']) > 4) {
461 $region = substr($this->_options[
'locale'], (strpos($this->_options[
'locale'],
'_') + 1));
554 #require_once 'Zend/Locale.php'; 557 if (strlen($locale) > 4) {
558 $this->_options[
'locale'] = $locale;
560 #require_once 'Zend/Currency/Exception.php'; 564 #require_once 'Zend/Currency/Exception.php'; 569 $this->_options[
'currency'] = $this->
getShortName(
null, $this->_options[
'locale']);
570 $this->_options[
'name'] = $this->
getName(
null, $this->_options[
'locale']);
571 $this->_options[
'symbol'] = $this->
getSymbol(
null, $this->_options[
'locale']);
583 return $this->_options[
'locale'];
593 return $this->_options[
'value'];
619 $this->_options[
'value'] += (float)
$value;
633 $this->_options[
'value'] -= (float)
$value;
647 $this->_options[
'value'] /= (float)
$value;
661 $this->_options[
'value'] *= (float)
$value;
675 $this->_options[
'value'] %= (float)
$value;
709 if ($this->_options[
'value'] ==
$value) {
726 if ($this->_options[
'value'] >
$value) {
743 if ($this->_options[
'value'] <
$value) {
761 $currency =
$value->getShortName();
771 #require_once 'Zend/Currency/Exception.php'; 789 return $this->_options[
'service'];
801 #require_once 'Zend/Loader.php'; 803 $file = str_replace(
'_', DIRECTORY_SEPARATOR,
$service) .
'.php';
813 #require_once 'Zend/Currency/Exception.php'; 817 $this->_options[
'service'] =
$service;
841 if (
$name !==
'format') {
842 if (gettype(
$value) ===
'string') {
849 if ((
$value !== self::STANDARD) and (
$value !== self::RIGHT) and (
$value !== self::LEFT)) {
850 #require_once 'Zend/Currency/Exception.php'; 858 if (!is_string(
$value) || (strpos(
$value,
'0') ===
false)) {
859 #require_once 'Zend/Currency/Exception.php'; 862 .
"' is no format token");
868 if (is_numeric(
$value) and (
$value !== self::NO_SYMBOL) and (
$value !== self::USE_SYMBOL) and
869 (
$value !== self::USE_SHORTNAME) and (
$value !== self::USE_NAME)) {
870 #require_once 'Zend/Currency/Exception.php'; 881 #require_once 'Zend/Currency/Exception.php'; 890 #require_once 'Zend/Currency/Exception.php';
getRegionList($currency=null)
getName($currency=null, $locale=null)
isMore($value, $currency=null)
static loadClass($class, $dirs=null)
compare($value, $currency=null)
getCurrencyList($region=null)
static getContent($locale, $path, $value=false)
getSymbol($currency=null, $locale=null)
div($value, $currency=null)
__construct($options=null, $locale=null)
setValue($value, $currency=null)
static isReadable($filename)
setFormat(array $options=array())
equals($value, $currency=null)
getShortName($currency=null, $locale=null)
_exchangeCurrency($value, $currency)
sub($value, $currency=null)
_checkOptions(array $options=array())
static isLocale($locale, $strict=false, $compatible=true)
add($value, $currency=null)
mul($value, $currency=null)
static findLocale($locale=null)
static setCache(Zend_Cache_Core $cache)
static setCache(Zend_Cache_Core $cache)
static clearCache($tag=null)
mod($value, $currency=null)
toCurrency($value=null, array $options=array())
isLess($value, $currency=null)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
if(!isset($_GET['name'])) $name