init
[Pman.Builder] / Pman.Dialog.BuilderAppEdit.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by Builder Module - do not edit directly
4 Pman.Dialog.BuilderAppEdit = {
5
6     dialog : false,
7     callback:  false,
8
9     show : function(data, cb)
10     {
11         if (!this.dialog) {
12             this.create();
13         }
14
15         this.callback = cb;
16         this.data = data;
17         this.dialog.show();
18         if (this.form) {
19            this.form.reset();
20            this.form.setValues(data);
21         }
22
23     },
24
25     create : function()
26     {
27         var _this = this;
28         this.dialog = Roo.factory({
29             xtype : 'LayoutDialog',
30             background : true,
31             width : 500,
32             height : 165,
33             title : "Edit \/ Create Module",
34             listeners : {
35                 show: function (_self)
36                 {
37                    _this.dialog = _self;
38                 }
39             },
40             closable : false,
41             collapsible : false,
42             resizable : false,
43             xns: Roo,
44             modal : true,
45             items : [
46                 {
47                     xtype : 'ContentPanel',
48                     background : true,
49                     fitToFrame : true,
50                     region : 'center',
51                     items : [
52                         {
53                             xtype : 'Form',
54                             style : 'margin: 5px',
55                             url: baseURL + '/Roo/Builder_app.php',
56                             method : 'POST',
57                             listeners : {
58                                 actionfailed: function (_self, action)
59                                 {
60                                     _this.dialog.el.unmask();
61                                     Pman.standardActionFailed(_self, action);
62                                 }
63                                 ,
64                                 actioncomplete: function (_self, action)
65                                 {
66                                    _this.dialog.el.unmask();
67                                    _this.dialog.hide();
68                                    
69                                     if (_this.callback) {
70                                        _this.callback.call(_this, _this.form.getValues());
71                                     }
72                                     _this.form.reset();
73                                 }
74                                 ,
75                                 rendered: function (_self)
76                                 {
77                                     _this.form = _self;
78                                 }
79                                 
80                             },
81                             items : [
82                                 {
83                                     name : 'id',
84                                     xtype : 'Hidden'
85                                 },
86                                 {
87                                     name : 'app',
88                                     fieldLabel : "Module",
89                                     width : 200,
90                                     xtype : 'TextField'
91                                 },
92                                 {
93                                     name : 'davurl',
94                                     fieldLabel : "Webdav URL",
95                                     width : 350,
96                                     xtype : 'TextField',
97                                     vtype : 'url'
98                                 },
99                                 {
100                                     name : 'davwrite',
101                                     fieldLabel : "Write to WebDav",
102                                     xtype : 'Checkbox',
103                                     allowDecimals : false,
104                                     boxLabel : 'Check to enable PUT to Dav after save',
105                                     inputValue : 1
106                                 }
107                             ]
108                         }
109                     ]
110                 }
111             ],
112             center : {
113                 titlebar : false
114             },
115             buttons : [
116                 {
117                     xtype : 'Button',
118                     xns: Roo,
119                     text : "Cancel",
120                     listeners : {
121                         click: function (_self, e)
122                         {
123                              _this.form.reset();
124                              _this.dialog.hide();
125                         }
126                     }
127                 },
128                 {
129                     xtype : 'Button',
130                     xns: Roo,
131                     text : "OK",
132                     listeners : {
133                         click: function (_self, e)
134                         {
135                             _this.dialog.el.mask("Saving");
136                              _this.form.doAction('submit');
137                             
138                         }
139                     }
140                 }
141             ]
142         });
143     }
144 };