DataObjects/Cms_page.php
[Pman.Cms] / Pman.Dialog.CmsApplyStyleSheets.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.CmsApplyStyleSheets = {
8
9  _strings : {
10   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
11   '4f6a786f206270451624db40d61d9855' :"Add Stylesheets",
12   '85e8231d44b865e90f6a39b356ded9bd' :"Stylesheets",
13   'e0aa021e21dddbd6d8cecec71e9cf564' :"OK"
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     closable : false,
41     collapsible : false,
42     height : 300,
43     modal : true,
44     resizable : false,
45     title : _this._strings['4f6a786f206270451624db40d61d9855'] /* Add Stylesheets */,
46     width : 600,
47     xns : Roo,
48     '|xns' : 'Roo',
49     xtype : 'LayoutDialog',
50     center : {
51      xns : Roo,
52      '|xns' : 'Roo',
53      xtype : 'LayoutRegion'
54     },
55     buttons : [
56      {
57       text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
58       xns : Roo,
59       '|xns' : 'Roo',
60       xtype : 'Button',
61       listeners : {
62        click : function (_self, e)
63         {
64             _this.dialog.hide();
65         }
66       }
67      },
68      {
69       text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */,
70       xns : Roo,
71       '|xns' : 'Roo',
72       xtype : 'Button',
73       listeners : {
74        click : function (_self, e)
75         {
76             var stylesheets = _this.form.findField('_stylesheets').getValue();
77             
78             
79             _this.form.doAction("submit");
80         }
81       }
82      }
83     ],
84     items  : [
85      {
86       region : 'center',
87       xns : Roo,
88       '|xns' : 'Roo',
89       xtype : 'ContentPanel',
90       items  : [
91        {
92         labelAlign : 'top',
93         method : 'POST',
94         style : 'margin:10px;',
95         url : baseURL + '/Roo/Cms_page.php',
96         xns : Roo.form,
97         '|xns' : 'Roo.form',
98         xtype : 'Form',
99         listeners : {
100          actioncomplete : function(_self,action)
101           {
102               if (action.type == 'setdata') {
103                   
104                   this.load({ method: 'GET', params: { '_stylesheets' : 1 }});
105                   return;
106               }
107               if (action.type == 'load') {
108                   _this.dialog.el.unmask();
109                   return;
110               }
111               if (action.type =='submit') {
112               
113                   _this.dialog.el.unmask();
114                   _this.dialog.hide();
115           
116                    if (_this.callback) {
117                       _this.callback.call(_this, _this.form.getValues());
118                    }
119                    _this.form.reset();
120                    return;
121               }
122           },
123          actionfailed : function (_self, action)
124           {
125               _this.dialog.el.unmask();
126               
127               Pman.standardActionFailed(_self, action);
128           },
129          rendered : function (form)
130           {
131               _this.form= form;
132           }
133         },
134         items  : [
135          {
136           allowBlank : true,
137           fieldLabel : _this._strings['85e8231d44b865e90f6a39b356ded9bd'] /* Stylesheets */,
138           height : 200,
139           name : '_stylesheets',
140           width : 550,
141           xns : Roo.form,
142           '|xns' : 'Roo.form',
143           xtype : 'TextArea'
144          }
145         ]
146        }
147       ]
148      }
149     ]
150    });
151  }
152 };