Merge remote branch 'upstream/master'

This commit is contained in:
Julio Cesar Laura
2013-05-16 09:03:32 -04:00
3 changed files with 31 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
<?php
/**
* To implement pmos translation function on smarty templates
*
* example use:
*
* <h1>{translate label="ID_HOME_TITLE"}</h1>
*
* @params $params mixed array containg all parameters passed from smarty plugin call
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
*/
function translate($params)
{
if (array_key_exists('lang', $params)) {
$lang = $params['lang'];
} elseif (defined('SYS_LANG')) {
$lang = SYS_LANG;
} else {
$lang = 'en';
}
if (! array_key_exists('label', $params)) {
throw new Exception('Error: Param "label" is missing on "tranlate" smarty function, it should be called like: {translate label="SOME_LABEL_ID"}');
}
echo G::loadTranslation($params['label'], $lang);
}

View File

@@ -543,6 +543,7 @@ class SkinEngine
private function _mvc()
{
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php'; // put full path to Smarty.class.php
require_once PATH_GULLIVER_HOME . 'includes' . PATH_SEP . 'smarty_plugins' . PATH_SEP . 'function.pmos.php';
G::LoadClass('serverConfiguration');
$oServerConf =& serverConf::getSingleton();
$oHeadPublisher =& headPublisher::getSingleton();
@@ -552,6 +553,7 @@ class SkinEngine
$smarty->compile_dir = PATH_SMARTY_C;
$smarty->cache_dir = PATH_SMARTY_CACHE;
$smarty->config_dir = PATH_THIRDPARTY . 'smarty/configs';
$smarty->register_function('translate', 'translate');
$viewVars = $oHeadPublisher->getVars();
@@ -784,6 +786,4 @@ class SkinEngine
$smarty->display($this->layoutFile['basename']);
}
}
}

View File

@@ -312,7 +312,7 @@ Ext.onReady(function(){
editor: new fm.ComboBox({
typeAhead: true,
triggerAction: 'all',
editable: true,
editable: false,
lazyRender: true,
mode: 'local',
displayField:'type',