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