added a testString binding to messagecat, since z3950.js is generating keys and getSt...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 8 Mar 2008 09:18:41 +0000 (09:18 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 8 Mar 2008 09:18:41 +0000 (09:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8926 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/main/bindings.xml
Open-ILS/xul/staff_client/server/cat/z3950.js

index f302a69..1bf2c10 100644 (file)
                                </body>
                        </method>
 
+                       <method name="testString">
+                               <parameter name="key"/>
+                               <body>
+                                       <![CDATA[
+                                               try {
+                            var str = this._props[key];
+                            return (typeof str != 'undefined');
+                                               } catch(e) {
+                            return false;
+                                               }
+                                       ]]>
+                               </body>
+                       </method>
+
+
                        <method name="getString">
                                <parameter name="key"/>
                                <body>
index 24924f2..075f835 100644 (file)
@@ -206,7 +206,7 @@ cat.z3950.prototype = {
                                                         }
                                                         if (attr.label) {
                                                             attrs[i].labels[ attr.label ] = true;
-                                                        } else if (document.getElementById('commonStrings').getString('staff.z39_50.search_class.' + i)) {
+                                                        } else if (document.getElementById('commonStrings').testString('staff.z39_50.search_class.' + i)) {
                                                             attrs[i].labels[ document.getElementById('commonStrings').getString('staff.z39_50.search_class.' + i) ] = true;
                                                         } else if (attr.name) {
                                                             attrs[i].labels[ attr.name ] = true;