sql/cms_page.sql
[Pman.Cms] / Pman.Dialog.CmsTranslateTemplates.js
index 812f11f..7bdd170 100644 (file)
@@ -33,11 +33,11 @@ Pman.Dialog.CmsTranslateTemplates = {
             background : true,
             closable : false,
             collapsible : false,
-            height : 300,
+            height : 450,
             modal : true,
-            resizable : false,
-            title : "Add / Edit Location Details",
-            width : 600,
+            resizable : true,
+            title : "Edit Translation",
+            width : 800,
             items : [
                 {
                     xtype: 'ContentPanel',
@@ -58,14 +58,22 @@ Pman.Dialog.CmsTranslateTemplates = {
                                 actioncomplete : function (_self, action)
                                 {
                                       
-                                  if (action.type == 'submit' ) {
-                                    _this.dialog.el.unmask();
-                                   _this.dialog.hide();
-                                   
-                                    if (_this.callback) {
-                                       _this.callback.call(_this, _this.form.getValues());
+                                    if (action.type == 'setdata') {
+                                       //_this.dialog.el.mask("Loading");
+                                       
+                                       Roo.log(_this.data);
+                                       return;
+                                    }
+                                    if (action.type == 'load') {
+                                         return;
                                     }
-                                    _this.form.reset();
+                                    if (action.type =='submit') {
+                                        _this.dialog.hide();
+                                        if (_this.callback) {
+                                            _this.callback.call(_this, _this.form.getValues());
+                                        }
+                                        _this.form.reset();
+                                        return;
                                     }
                                 },
                                 rendered : function (form)
@@ -75,7 +83,6 @@ Pman.Dialog.CmsTranslateTemplates = {
                             },
                             method : 'POST',
                             style : 'margin: 5px',
-                            url : baseURL + '/Roo/Ris_location.php',
                             items : [
                                 {
                                     xtype: 'Row',
@@ -85,39 +92,29 @@ Pman.Dialog.CmsTranslateTemplates = {
                                         {
                                             xtype: 'TextArea',
                                             xns: Roo.form,
+                                            readOnly : true,
                                             fieldLabel : 'Original',
-                                            name : ''
+                                            height : 150,
+                                            name : 'src_id_txt',
+                                            value : "",
+                                            width : 750
                                         }
                                     ]
                                 },
-                                {
-                                    xtype: 'TextArea',
-                                    xns: Roo.form,
-                                    fieldLabel : 'Original',
-                                    name : ''
-                                },
-                                {
-                                    xtype: 'TextField',
-                                    xns: Roo.form,
-                                    allowBlank : false,
-                                    fieldLabel : 'Town / City',
-                                    name : 'name',
-                                    width : 250
-                                },
-                                {
-                                    xtype: 'Checkbox',
-                                    xns: Roo.form,
-                                    fieldLabel : 'Active Search',
-                                    name : 'active_search'
-                                },
-                                {
-                                    xtype: 'Hidden',
-                                    xns: Roo.form,
-                                    name : 'id'
-                                },
                                 {
                                     xtype: 'Row',
-                                    xns: Roo.form
+                                    xns: Roo.form,
+                                    labelAlign : 'top',
+                                    items : [
+                                        {
+                                            xtype: 'TextArea',
+                                            xns: Roo.form,
+                                            fieldLabel : 'Translation',
+                                            height : 150,
+                                            name : 'txt',
+                                            width : 750
+                                        }
+                                    ]
                                 }
                             ]
                         }
@@ -127,7 +124,8 @@ Pman.Dialog.CmsTranslateTemplates = {
             center : {
                 xtype: 'LayoutRegion',
                 xns: Roo,
-                titlebar : false
+                titlebar : true,
+                title : "Note: If the original text contains template variables like  {TEMPLATE_VARIABLE} <br/>Be careful to retain them otherwise the translation may not work"
             },
             buttons : [
                 {
@@ -144,14 +142,19 @@ Pman.Dialog.CmsTranslateTemplates = {
                 {
                     xtype: 'Button',
                     xns: Roo,
-                    text : "OK",
                     listeners : {
                         click : function() {
                             _this.dialog.el.mask("Saving");
-                            _this.form.doAction('submit');
-                            
+                            //_this.form.doAction('submit');
+                            _this.dialog.hide();
+                            if (_this.callback) {
+                                _this.callback.call(_this, _this.form.getValues());
+                            }
+                            _this.dialog.el.unmask();
+                            _this.form.reset();
                         }
-                    }
+                    },
+                    text : "OK"
                 }
             ]
         });