}
- function guessUsersLanguage() {
+ function guessUsersLanguage()
+ {
+ $this->sessionState(0);
$lang = !$this->authUser || empty($this->authUser->lang ) ? 'en' : $this->authUser->lang;
return explode('_', $lang);
}
- function get($s ='')
+ function get($s ='', $opts=array())
{
$this->sessionState(0);
foreach($langs as $lang)
{
//$rlang = array_shift(explode('_', strtoupper($lang)));
- $rlang = array_shift(explode('_', $lang));
+ $ll = explode('_', $lang);
+ $rlang = array_shift($ll);
$ar[$lang] = array();
$i = DB_DataObject::Factory('I18n');
}
//echo '<PRE>';print_r($ar);
header('Content-type: text/javascript');
+ echo "Roo.namespace('Pman.I18n');";
echo 'Pman.I18n.Data = ' . json_encode($ar);
exit;
function convertCurrency($val, $from, $to)
{
- DB_DAtaObject::Factory('core_curr_rates')->convert($val,$from,$to);
+ return DB_DAtaObject::Factory('core_curr_rate')->convert($val,$from,$to);
}
/**
* DO NOT USE THIS -- see core_curr_rates dataobject.
*
*/
- var $rates = array();
+
+
+
function loadRates()
- {
- if (!empty($this->rates)) {
- return true;
- }
+ {
+ static $rates = array();
- $this->rates = DB_DAtaObject::Factory('core_curr_rates')->currentRates();
+ if (!empty($rates)) {
+ $this->rates = $rates;
+ return;
+ }
+ $this->rates = $rates = DB_DAtaObject::Factory('core_curr_rate')->currentRates();
}