MODx.page.ResourceData=function(A){A=A||{};var B=[];if(A.canEdit==1){B.push({process:"edit",text:_("edit"),hidden:A.canEdit==1?false:true,handler:this.editResource,scope:this});B.push("-");}B.push({process:"preview",text:_("view"),handler:this.preview,scope:this});B.push("-");B.push({process:"cancel",text:_("cancel"),handler:this.cancel,scope:this});Ext.applyIf(A,{form:"modx-resource-data",actions:{"new":MODx.action["resource/create"],edit:MODx.action["resource/update"],cancel:MODx.action.welcome},buttons:B,components:[{xtype:"modx-panel-resource-data",renderTo:"modx-panel-resource-data-div",resource:A.record.id,context:A.record.context_key,class_key:A.record.class_key,pagetitle:A.record.pagetitle,border:false}]});MODx.page.ResourceData.superclass.constructor.call(this,A);};Ext.extend(MODx.page.ResourceData,MODx.Component,{preview:function(){window.open(this.config.record.preview_url);return false;},editResource:function(){location.href="?a="+MODx.action["resource/update"]+"&id="+this.config.record.id;},cancel:function(){location.href="?a="+MODx.action.welcome;}});Ext.reg("modx-page-resource-data",MODx.page.ResourceData);