1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.CmsBlog = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
43 xtype: 'ContentPanel',
53 actionfailed : function (_self, action)
55 _this.dialog.el.unmask();
56 Pman.standardActionFailed(_self, action);
58 actioncomplete : function (_self, action)
61 if (action.type =='submit') {
63 _this.dialog.el.unmask();
67 _this.callback.call(_this, _this.form.getValues());
72 if (action.type == 'setdata') {
76 _this.dialog.el.mask("Loading");
77 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
80 this.findField('is_draft').setValue(1);
87 if (action.type == 'load') {
88 _this.dialog.el.unmask();
89 _this.grid.getDataSource().load();
93 rendered : function (_self)
99 style : 'margin: 5px',
100 url : baseURL + '/Roo/CmsBlog.php',
111 fieldLabel : 'Page link',
118 allowBlank : 'false',
119 displayField : 'title',
121 emptyText : "Select Category",
122 fieldLabel : 'Category',
123 forceSelection : true,
124 hiddenName : 'category_id',
126 loadingText : "Searching...",
128 name : 'category_id_title',
130 qtip : "Select Category",
132 selectOnFocus : true,
133 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
134 triggerAction : 'all',
142 beforeload : function (_self, o){
143 o.params = o.params || {};
151 url : baseURL + '/Roo/Category.php'
158 totalProperty : 'total',
159 fields : [{"name":"id","type":"int"},{"name":"title","type":"string"}]
169 displayField : 'page_link',
171 emptyText : "Select Parent",
172 fieldLabel : 'Parent page',
173 forceSelection : true,
174 hiddenName : 'parent_id',
176 loadingText : "Searching...",
178 name : 'parent_id_page_link',
180 qtip : "Select Category ",
181 queryParam : '_search',
182 selectOnFocus : true,
183 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b><br/><i>{page_link}</i> </div>',
184 triggerAction : 'all',
192 beforeload : function (_self, options)
194 options.params['query[page_link_no_empty]'] =1;
198 sortInfo : { field: 'page_link', direction: 'ASC' },
203 url : baseURL + '/Roo/CmsBlog.php'
210 totalProperty : 'total',
212 { name: 'id', type: 'int' },
226 altFormats : 'Y-m-d H:i:s',
227 fieldLabel : 'Date to Publish',
235 fieldLabel : 'Replaces',
236 name : 'to_replace_id',
258 boxLabel : 'Extended Vis.?',
260 name : 'has_extended',
266 boxLabel : 'Display in RSS',
275 fieldLabel : 'Title',
288 fieldLabel : 'Contents',
304 fieldLabel : 'Extended Contents',
326 tableName : 'Images',
329 activate : function() {
332 _this.grid.footer.onClick('first');
340 autoExpandColumn : 'filename',
343 render : function() {
345 //_this.dialog = Pman.Dialog.FILL_IN
346 if (_this.panel.active) {
347 //this.footer.onClick('first');
350 rowdblclick : function (_self, rowIndex, e)
352 var rd = _this.grid.getDataSource().getAt(rowIndex);
354 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
355 _this.form.findField('contents').execCmd('insertimage', url);
363 beforeload : function (_self, o)
365 if (!_this.data.id) {
368 o.params = o.params || {};
369 o.params.onid = _this.data.id;
370 o.params.ontable = 'CmsBlog';
373 reader : Pman.Readers.Images,
378 url : baseURL + '/Roo/Images.php'
391 Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'CmsBlog' }, function() {
392 _this.grid.getDataSource().load();
397 cls : 'x-btn-text-icon',
399 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
405 cls : 'x-btn-text-icon',
406 icon : rootURL + '/Pman/templates/images/trash.gif',
410 Pman.genericDelete(_this, _this.panel.tableName);
418 xtype: 'ColumnModel',
423 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); },
427 xtype: 'ColumnModel',
431 dataIndex : 'filename',
432 renderer : function(v) { return String.format('{0}', v); }
439 xtype: 'LayoutRegion',
444 xtype: 'LayoutRegion',
471 _this.dialog.el.mask("Saving");
472 _this.form.findField('body').syncValue();
473 _this.form.doAction("submit");