Uncommited changes synced
[Pman.Cms] / Pman.Tab.CmsTranslateTemplates.bjs
index f93a43b..29625e5 100644 (file)
@@ -2,7 +2,7 @@
  "name" : "Pman.Tab.CmsTranslateTemplates",
  "parent" : "Pman.Tab.Cms",
  "title" : "Pman.Tab.CmsTranslateTemplates",
- "path" : "/home/edward/gitlive/Pman.Cms/Pman.Tab.CmsTranslateTemplates.bjs",
+ "path" : "/home/alan/gitlive/Pman.Cms/Pman.Tab.CmsTranslateTemplates.bjs",
  "permname" : "",
  "modOrder" : "800",
  "strings" : {
@@ -23,8 +23,8 @@
  "items" : [
   {
    "region" : "center",
-   "title" : "Translate Templates",
    "xtype" : "NestedLayoutPanel",
+   "title" : "Translate Templates",
    "$ xns" : "Roo",
    "items" : [
     {
@@ -34,8 +34,8 @@
      "items" : [
       {
        "xtype" : "LayoutRegion",
-       "$ xns" : "Roo",
        "width" : 300,
+       "$ xns" : "Roo",
        "split" : true,
        "* prop" : "west"
       },
        "listeners" : {
         "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
        },
+       "fitToframe" : true,
        "background" : false,
        "region" : "center",
-       "fitToframe" : true,
        "title" : "Page",
        "xtype" : "GridPanel",
        "fitContainer" : true,
           {
            "listeners" : {
             "update" : "function (_self, rec, operation)\n{\n    Roo.log(operation);\n    \n    if (operation != 'commit') {\n        return;\n    }\n    \n\n    _this.grid.getView().el.mask(\"Saving\");\n    new Pman.Request({\n        url : baseURL + '/Roo/cms_templatestr',\n        method: 'POST',\n        params : {\n            id : rec.get('id'),\n            txt : rec.get('txt')\n        },\n        success : function()\n        {\n            _this.grid.getView().el.unmask();\n                //g.getDataSource().reload();\n        },\n        failure : function()\n        {\n            _this.grid.getView().el.unmask();\n            Roo.MessageBox.alert(\"Error\", \"There was a problem saving the data - try reloading\");\n         }\n            \n    });\n    \n}",
-            "beforeload" : "function (_self, o)\n{\n   \n    var sn = _this.treepanel.tree.getSelectionModel().getSelectedNode();\n\n    if (!sn || typeof(sn.attributes) == 'undefined' || typeof(sn.attributes.leaf) == 'undefined' || !sn.attributes.leaf) { \n        _this.grid.ds.removeAll();\n        return false;\n    }\n\n    o.params = o.params || {};\n    o.params.lang = sn.parentNode.attributes.id ;\n    o.params.template_id = sn.attributes.id * 1;\n    o.params.active = 1;\n    o.params['!src_id'] = 0;\n    \n    if (_this.searchBox && _this.searchBox.getValue().length) { \n        o.params['_search_txt'] = _this.searchBox.getValue();\n    }\n    \n    \n    if(sn.attributes.on_table){\n        o.params.on_table = sn.attributes.on_table;\n    }\n    \n}\n\n\n"
+            "beforeload" : "function (_self, o)\n{\n   \n    var sn = _this.treepanel.tree.getSelectionModel().getSelectedNode();\n\n    if (!sn || typeof(sn.attributes) == 'undefined' || typeof(sn.attributes.leaf) == 'undefined' || !sn.attributes.leaf) { \n        _this.grid.ds.removeAll();\n        return false;\n    }\n\n    o.params = o.params || {};\n    \n    //var pn = sn.parentNode.attributes.id.split(':')[1]; // should be view:en:{module}\n    \n    \n    o.params.lang = sn.parentNode.attributes.id;\n    o.params.template_id = sn.attributes.id * 1;\n    o.params.active = 1;\n    o.params['!src_id'] = 0;\n    \n    if (_this.searchBox && _this.searchBox.getValue().length) { \n        o.params['_search_txt'] = _this.searchBox.getValue();\n    }\n    \n    \n    if(sn.attributes.on_table){\n        o.params.on_table = sn.attributes.on_table;\n    }\n    \n}\n\n\n"
            },
            "xtype" : "Store",
            "remoteSort" : true,
            "items" : [
             {
              "$ url" : "baseURL + '/Roo/cms_templatestr.php'",
-             "method" : "GET",
              "xtype" : "HttpProxy",
+             "method" : "GET",
              "$ xns" : "Roo.data",
              "* prop" : "proxy"
             },
           },
           {
            "xtype" : "ColumnModel",
-           "header" : "Original",
            "width" : 200,
+           "header" : "Original",
            "$ renderer" : "function(v,x,r) \n{\n    var c = '#666';\n    if (r.data.updated  < r.data.src_id_updated) {\n        c = 'red';\n    }\n    \n    return String.format('<div style=\"color:'+c+'\";>{0}</div>', v)\n\n}",
            "$ xns" : "Roo.grid",
            "* prop" : "cm[]",
           },
           {
            "xtype" : "ColumnModel",
-           "header" : "Translation",
            "width" : 200,
+           "header" : "Translation",
            "$ renderer" : "function(v,x,r) \n{ \n\n    var c = '#666';\n    if (r.data.updated  < r.data.src_id_updated) {\n        c = 'red';\n    }\n    \n    return String.format('<div style=\"color:'+c+'\";>{0}</div>', v)\n\n}",
            "$ xns" : "Roo.grid",
            "* prop" : "cm[]",
           },
           {
            "xtype" : "ColumnModel",
-           "header" : "md5",
            "width" : 250,
+           "header" : "md5",
            "$ renderer" : "function(v,x,r) \n{\n    return v ? v : '';\n\n}",
            "$ xns" : "Roo.grid",
            "* prop" : "cm[]",