aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models/GenericModel.php
diff options
context:
space:
mode:
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