Pman.I18n.js
authorAlan Knowles <alan@akbkhome.com>
Thu, 6 Oct 2011 07:54:59 +0000 (15:54 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 6 Oct 2011 07:54:59 +0000 (15:54 +0800)
Pman.I18n.js

index e44de6b..55eacf3 100644 (file)
@@ -131,7 +131,21 @@ Pman.I18n = {
         return Pman.I18n.Data[lang][type];
     },
     
-    simpleStoreData : function(type)
+    /**
+     * simpleStoreData:
+     * return a simplestore to be used by country/language combos
+     * eg.
+     * store: (function() {
+            return Pman.I18n.simpleStoreData('c');
+        })(),
+     *
+     * @param {Char} type (c,l,m)
+     * @param {function} (optional) filter language list
+     *     called with object { code: xxx , title: xxx }
+     *     if it exists then returning false will hide the entry.
+     */
+    
+    simpleStoreData : function(type, filter)
     {
         var lang =  'en';
         try {
@@ -140,6 +154,9 @@ Pman.I18n = {
         lang = lang || 'en';
         var ret = [];
         Roo.each(Pman.I18n.Data[lang][type], function (o) {
+            if (filter && filter(o) === false) {
+                return;
+            }
             ret.push([ o.code, o.title ]);
         });