check file exists
[Pman.Core] / Pman.Dialog.CoreImportUrl.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Dialog');
6
7 Pman.Dialog.CoreImportUrl = {
8
9  _strings : {
10   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
11   'c8c55f55be8cbe3141db7e26ab0a8b4e' :"Import URL",
12   'e0aa021e21dddbd6d8cecec71e9cf564' :"OK",
13   'e6b391a8d2c4d45902a23a8b6585703d' :"URL"
14  },
15
16  dialog : false,
17  callback:  false,
18
19  show : function(data, cb)
20  {
21   if (!this.dialog) {
22    this.create();
23   }
24
25   this.callback = cb;
26   this.data = data;
27   this.dialog.show(this.data._el);
28   if (this.form) {
29    this.form.reset();
30    this.form.setValues(data);
31    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
32   }
33
34  },
35
36  create : function()
37  {
38    var _this = this;
39    this.dialog = Roo.factory({
40     xtype : 'LayoutDialog',
41     closable : false,
42     collapsible : false,
43     draggable : false,
44     height : 140,
45     modal : true,
46     resizable : false,
47     title : _this._strings['c8c55f55be8cbe3141db7e26ab0a8b4e'] /* Import URL */,
48     width : 500,
49     xns : Roo,
50     '|xns' : 'Roo',
51     center : {
52      xtype : 'LayoutRegion',
53      xns : Roo,
54      '|xns' : 'Roo'
55     },
56     buttons : [
57      {
58       xtype : 'Button',
59       text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
60       listeners : {
61        click : function (_self, e)
62         {
63             _this.dialog.hide();
64         }
65       },
66       xns : Roo,
67       '|xns' : 'Roo'
68      },
69      {
70       xtype : 'Button',
71       text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */,
72       listeners : {
73        click : function (_self, e)
74         {
75             _this.form.doAction("submit");
76         }
77       },
78       xns : Roo,
79       '|xns' : 'Roo'
80      }
81     ],
82     items  : [
83      {
84       xtype : 'ContentPanel',
85       region : 'center',
86       xns : Roo,
87       '|xns' : 'Roo',
88       items  : [
89        {
90         xtype : 'Form',
91         method : 'POST',
92         style : 'margin:10px;',
93         url : baseURL,
94         listeners : {
95          actioncomplete : function (_self, action)
96           {
97                if (action.type == 'setdata') {
98                   if(_this.data.target){
99                       _this.form.url = baseURL + _this.data.target;
100                   }\r
101                  // _this.dialog.el.mask("Loading");\r
102                  // if(_this.data.id*1 > 0)\r
103                  //     this.load({ method: 'GET', params: { '_id' : _this.data.id }});\r
104                  \r
105                  return;\r
106               }\r
107               if (action.type == 'load') {\r
108            \r
109                   return;\r
110               }\r
111               if (action.type =='submit') {\r
112               \r
113                   //action.result.data\r
114                   _this.dialog.hide();\r
115               //    Roo.log(_this.callback);\r
116                    if (_this.callback) {\r
117                       _this.callback.call(_this, action.result.data);\r
118                    }\r
119                    _this.form.reset();\r
120                    return;\r
121               }
122           },
123          rendered : function (form)
124           {
125               _this.form= form;
126           }
127         },
128         xns : Roo.form,
129         '|xns' : 'Roo.form',
130         items  : [
131          {
132           xtype : 'TextField',
133           fieldLabel : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
134           name : 'importUrl',
135           vtype : 'url',
136           width : 250,
137           xns : Roo.form,
138           '|xns' : 'Roo.form'
139          }
140         ]
141        }
142       ]
143      }
144     ]
145    });
146  }
147 };