DataObjects/Cms_comments.php
[Pman.Cms] / Pman.Dialog.CmsImage.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.CmsImage = {
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             background : true,
34             width : 450,
35             height : 120,
36             title : "Edit Image Details",
37             modal : true,
38             resizable : false,
39             collapsible : false,
40             closable : false,
41             items : [
42                 {
43                     xtype: 'ContentPanel',
44                     xns: Roo,
45                     background : true,
46                     fitToFrame : true,
47                     region : 'center',
48                     items : [
49                         {
50                             xtype: 'Form',
51                             xns: Roo.form,
52                             listeners : {
53                                 actionfailed : function (_self, action)
54                                 {
55                                     _this.dialog.el.unmask();
56                                     Pman.standardActionFailed(_self, action);
57                                 },
58                                 actioncomplete : function (_self, action)
59                                 {
60                                    
61                                    if (action.type =='submit') {
62                                        
63                                        _this.dialog.el.unmask();
64                                        _this.dialog.hide();
65                                        
66                                         if (_this.callback) {
67                                            _this.callback.call(_this, _this.form.getValues());
68                                         }
69                                         _this.form.reset();
70                                         return;
71                                     }
72                                 },
73                                 rendered : function (_self)
74                                 {
75                                     _this.form = _self;
76                                 }
77                             },
78                             method : 'POST',
79                             style : 'margin: 5px',
80                             url : baseURL + '/Roo/Images.php',
81                             items : [
82                                 {
83                                     xtype: 'TextField',
84                                     xns: Roo.form,
85                                     name : 'linkurl',
86                                     fieldLabel : 'Link URL',
87                                     width : 300,
88                                     vtype : 'url'
89                                 },
90                                 {
91                                     xtype: 'Hidden',
92                                     xns: Roo.form,
93                                     name : 'id'
94                                 }
95                             ]
96                         }
97                     ]
98                 }
99             ],
100             center : {
101                 xtype: 'LayoutRegion',
102                 xns: Roo,
103                 titlebar : false
104             },
105             buttons : [
106                 {
107                     xtype: 'Button',
108                     xns: Roo,
109                     text : "Cancel",
110                     listeners : {
111                         click : function() {
112                         
113                                                             _this.form.reset();
114                         
115                                                             _this.dialog.hide();
116                         
117                                                         }
118                     }
119                 },
120                 {
121                     xtype: 'Button',
122                     xns: Roo,
123                     listeners : {
124                         click : function() {
125                         
126                                                             _this.dialog.el.mask("Saving");
127                         
128                                                             _this.form.doAction("submit");
129                         
130                                                         }
131                     },
132                     text : "OK"
133                 }
134             ]
135         });
136     }
137 };