aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models/GenericModel.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-12-03 12:30:25 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-12-03 12:30:25 +0000
commitd30d70afd95653bb356603612db6519d6e6ebead (patch)
tree8ca2f2a7f24eeea1203b0042015d25f18f97496b /h-source/Application/Models/GenericModel.php
parentf56fa1fc50484d99906a0a22e2931f9c1fe708b6 (diff)
improved i18n
Diffstat (limited to 'h-source/Application/Models/GenericModel.php')
-rw-r--r--h-source/Application/Models/GenericModel.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/h-source/Application/Models/GenericModel.php b/h-source/Application/Models/GenericModel.php
index 9a619fd..002149b 100644
--- a/h-source/Application/Models/GenericModel.php
+++ b/h-source/Application/Models/GenericModel.php
@@ -66,4 +66,39 @@ class GenericModel extends Model_Tree {
$this->_popupWhere[$field] = 'type="'.$this->type.'" and deleted="no" and cleared="no"';
}
}
+
+ //set the fuction to be applied upon each popup name
+ public function setPopupFunctions()
+ {
+ foreach ($this->_popupItemNames as $name => $field)
+ {
+ $this->_popupFunctions[$name] = $this->getTranslationFunction($name);
+ }
+ }
+
+ public function getPopupLabel($viewArgs)
+ {
+ $html = null;
+ foreach ($viewArgs as $field => $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