aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Models')
-rw-r--r--h-source/Application/Models/AcquisitioncardsModel.php4
-rw-r--r--h-source/Application/Models/BluetoothModel.php6
-rw-r--r--h-source/Application/Models/EthernetcardsModel.php4
-rw-r--r--h-source/Application/Models/FingerprintreadersModel.php4
-rw-r--r--h-source/Application/Models/GenericModel.php35
-rw-r--r--h-source/Application/Models/ModemsModel.php4
-rw-r--r--h-source/Application/Models/NotebooksModel.php4
-rw-r--r--h-source/Application/Models/PrintersModel.php2
-rw-r--r--h-source/Application/Models/ScannersModel.php2
-rw-r--r--h-source/Application/Models/SdcardreadersModel.php4
-rw-r--r--h-source/Application/Models/SoundcardsModel.php4
-rw-r--r--h-source/Application/Models/ThreegcardsModel.php7
-rw-r--r--h-source/Application/Models/VideocardsModel.php2
-rw-r--r--h-source/Application/Models/WebcamsModel.php2
-rw-r--r--h-source/Application/Models/WifiModel.php4
15 files changed, 55 insertions, 33 deletions
diff --git a/h-source/Application/Models/AcquisitioncardsModel.php b/h-source/Application/Models/AcquisitioncardsModel.php
index ab04fed..147aa94 100644
--- a/h-source/Application/Models/AcquisitioncardsModel.php
+++ b/h-source/Application/Models/AcquisitioncardsModel.php
@@ -42,9 +42,7 @@ class AcquisitioncardsModel extends GenericModel
'interface' => gtext("interface"),
);
- $this->_popupFunctions = array(
- 'vendor' => 'betterVendor',
- );
+ $this->setPopupFunctions();
$this->createPopupWhere('vendor,compatibility,comm_year,interface');
diff --git a/h-source/Application/Models/BluetoothModel.php b/h-source/Application/Models/BluetoothModel.php
index 82aab59..022c889 100644
--- a/h-source/Application/Models/BluetoothModel.php
+++ b/h-source/Application/Models/BluetoothModel.php
@@ -42,11 +42,9 @@ class BluetoothModel extends GenericModel
'interface' => gtext("interface"),
);
- $this->_popupFunctions = array(
- 'vendor' => 'betterVendor',
- );
-
$this->createPopupWhere('vendor,bluetooth_works,comm_year,interface');
+
+ $this->setPopupFunctions();
$this->diffFields = array(
'vendor' => gtext("vendor"),
diff --git a/h-source/Application/Models/EthernetcardsModel.php b/h-source/Application/Models/EthernetcardsModel.php
index 1727f71..08dc997 100644
--- a/h-source/Application/Models/EthernetcardsModel.php
+++ b/h-source/Application/Models/EthernetcardsModel.php
@@ -42,9 +42,7 @@ class EthernetcardsModel extends GenericModel
'interface' => gtext("interface"),
);
- $this->_popupFunctions = array(
- 'vendor' => 'betterVendor',
- );
+ $this->setPopupFunctions();
$this->createPopupWhere('vendor,ethernet_card_works,comm_year,interface');
diff --git a/h-source/Application/Models/FingerprintreadersModel.php b/h-source/Application/Models/FingerprintreadersModel.php
index 8e3f8da..7a2f3e8 100644
--- a/h-source/Application/Models/FingerprintreadersModel.php
+++ b/h-source/Application/Models/FingerprintreadersModel.php
@@ -42,9 +42,7 @@ class FingerprintreadersModel extends GenericModel
'interface' => gtext("interface"),
);
- $this->_popupFunctions = array(
- 'vendor' => 'betterVendor',
- );
+ $this->setPopupFunctions();
$this->createPopupWhere('vendor,fingerprint_works,comm_year,interface');
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
diff --git a/h-source/Application/Models/ModemsModel.php b/h-source/Application/Models/ModemsModel.php
index 5417524..92571d2 100644
--- a/h-source/Application/Models/ModemsModel.php
+++ b/h-source/Application/Models/ModemsModel.php
@@ -42,9 +42,7 @@ class ModemsModel extends GenericModel
'interface' => gtext("interface"),
);
- $this->_popupFunctions = array(
- 'vendor' => 'betterVendor',
- );
+ $this->setPopupFunctions();
$this->createPopupWhere('vendor,compatibility,comm_year,interface');
diff --git a/h-source/Application/Models/NotebooksModel.php b/h-source/Application/Models/NotebooksModel.php
index cc1b9eb..ce158a1 100644
--- a/h-source/Application/Models/NotebooksModel.php
+++ b/h-source/Application/Models/NotebooksModel.php
@@ -41,9 +41,7 @@ class NotebooksModel extends GenericModel {
'subtype' => gtext("subtype"),
);
- $this->_popupFunctions = array(
- 'vendor' => 'betterVendor',
- );
+ $this->setPopupFunctions();
$this->createPopupWhere('vendor,compatibility,comm_year,subtype');
diff --git a/h-source/Application/Models/PrintersModel.php b/h-source/Application/Models/PrintersModel.php
index 74cc0af..355bb67 100644
--- a/h-source/Application/Models/PrintersModel.php
+++ b/h-source/Application/Models/PrintersModel.php
@@ -41,6 +41,8 @@ class PrintersModel extends GenericModel
'comm_year' => gtext("year"),
'interface' => gtext("interface"),
);
+
+ $this->setPopupFunctions();
$this->createPopupWhere('vendor,compatibility,comm_year,interface');
diff --git a/h-source/Application/Models/ScannersModel.php b/h-source/Application/Models/ScannersModel.php
index 430142d..4710503 100644
--- a/h-source/Application/Models/ScannersModel.php
+++ b/h-source/Application/Models/ScannersModel.php
@@ -44,6 +44,8 @@ class ScannersModel extends GenericModel
$this->createPopupWhere('vendor,compatibility,comm_year,interface');
+ $this->setPopupFunctions();
+
$this->diffFields = array(
'vendor' => gtext("vendor"),
'model' => gtext('model name'),
diff --git a/h-source/Application/Models/SdcardreadersModel.php b/h-source/Application/Models/SdcardreadersModel.php
index f580d87..85950a5 100644
--- a/h-source/Application/Models/SdcardreadersModel.php
+++ b/h-source/Application/Models/SdcardreadersModel.php
@@ -42,9 +42,7 @@ class SdcardreadersModel extends GenericModel
'interface' => gtext("interface"),
);
- $this->_popupFunctions = array(
- 'vendor' => 'betterVendor',
- );
+ $this->setPopupFunctions();
$this->createPopupWhere('vendor,sd_card_works,comm_year,interface');
diff --git a/h-source/Application/Models/SoundcardsModel.php b/h-source/Application/Models/SoundcardsModel.php
index cda9c99..7137d79 100644
--- a/h-source/Application/Models/SoundcardsModel.php
+++ b/h-source/Application/Models/SoundcardsModel.php
@@ -42,9 +42,7 @@ class SoundcardsModel extends GenericModel
'interface' => gtext("interface"),
);
- $this->_popupFunctions = array(
- 'vendor' => 'betterVendor',
- );
+ $this->setPopupFunctions();
$this->createPopupWhere('vendor,sound_card_works,comm_year,interface');
diff --git a/h-source/Application/Models/ThreegcardsModel.php b/h-source/Application/Models/ThreegcardsModel.php
index 4a89a97..88ae580 100644
--- a/h-source/Application/Models/ThreegcardsModel.php
+++ b/h-source/Application/Models/ThreegcardsModel.php
@@ -41,11 +41,8 @@ class ThreegcardsModel extends GenericModel
'wifi_works' => gtext("does it work?"),
'interface' => gtext("interface"),
);
-
- $this->_popupFunctions = array(
- 'vendor' => 'betterVendor',
- 'interface' => 'betterVendor',
- );
+
+ $this->setPopupFunctions();
$this->createPopupWhere('vendor,wifi_works,comm_year,interface');
diff --git a/h-source/Application/Models/VideocardsModel.php b/h-source/Application/Models/VideocardsModel.php
index 2e9a3ee..961340e 100644
--- a/h-source/Application/Models/VideocardsModel.php
+++ b/h-source/Application/Models/VideocardsModel.php
@@ -43,6 +43,8 @@ class VideocardsModel extends GenericModel
);
$this->createPopupWhere('vendor,video_card_works,comm_year,interface');
+
+ $this->setPopupFunctions();
$this->diffFields = array(
'vendor' => gtext("vendor"),
diff --git a/h-source/Application/Models/WebcamsModel.php b/h-source/Application/Models/WebcamsModel.php
index a59da6e..0942bcb 100644
--- a/h-source/Application/Models/WebcamsModel.php
+++ b/h-source/Application/Models/WebcamsModel.php
@@ -47,6 +47,8 @@ class WebcamsModel extends GenericModel
);
$this->createPopupWhere('vendor,webcam_works,comm_year,interface');
+
+ $this->setPopupFunctions();
$this->diffFields = array(
'vendor' => gtext("vendor"),
diff --git a/h-source/Application/Models/WifiModel.php b/h-source/Application/Models/WifiModel.php
index 12dedc2..0b6d6c2 100644
--- a/h-source/Application/Models/WifiModel.php
+++ b/h-source/Application/Models/WifiModel.php
@@ -42,9 +42,7 @@ class WifiModel extends GenericModel
'interface' => gtext("interface"),
);
- $this->_popupFunctions = array(
- 'interface' => 'betterVendor',
- );
+ $this->setPopupFunctions();
$this->createPopupWhere('vendor,wifi_works,comm_year,interface');