aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-12-04 19:07:42 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-12-04 19:07:42 +0000
commit9cfcb4bb32e2fb8f5dbabd7faa06e47adf1c23af (patch)
treec1ee0451fe37e64dfe29c98cf8c0905e9ab53767 /h-source/Application/Models
parentd30d70afd95653bb356603612db6519d6e6ebead (diff)
improved i18n
Diffstat (limited to 'h-source/Application/Models')
-rw-r--r--h-source/Application/Models/GenericModel.php26
1 files changed, 9 insertions, 17 deletions
diff --git a/h-source/Application/Models/GenericModel.php b/h-source/Application/Models/GenericModel.php
index 002149b..64f24be 100644
--- a/h-source/Application/Models/GenericModel.php
+++ b/h-source/Application/Models/GenericModel.php
@@ -72,33 +72,25 @@ class GenericModel extends Model_Tree {
{
foreach ($this->_popupItemNames as $name => $field)
{
- $this->_popupFunctions[$name] = $this->getTranslationFunction($name);
+ $this->_popupFunctions[$name] = getTranslationFunction($name);
}
}
+ //get the HTML of the popup labels
public function getPopupLabel($viewArgs)
{
$html = null;
+ $listArray = array('page','history_page');
+
foreach ($viewArgs as $field => $value)
{
- $html .= "<div class='viewall_popup_menu_status_item'>$value</div>\n";
+ if (!in_array($field,$listArray))
+ {
+ $value = getTranslationFunction($field) !== 'gtext' ? gtext(call_user_func(getTranslationFunction($field),$value)) : gtext($value);
+ $html .= "<div class='viewall_popup_menu_status_item'>".$value."</div>\n";
+ }
}
return $html;
}
- //get the translation function
- public function getTranslationFunction($fieldName)
- {
- $fieldsFunc = array(
- "vendor" => "betterVendor",
- "interface" => "translate",
- );
-
- if (array_key_exists($fieldName,$fieldsFunc))
- {
- return $fieldsFunc[$fieldName];
- }
-
- return "gtext";
- }
} \ No newline at end of file