diff options
Diffstat (limited to 'h-source/Application/Models')
-rw-r--r-- | h-source/Application/Models/GenericModel.php | 26 |
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 |