modx.grid.resource.security.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. MODx.grid.ResourceSecurity = function(config) {
  2. config = config || {};
  3. var ac = new Ext.ux.grid.CheckColumn({
  4. header: _('access')
  5. ,dataIndex: 'access'
  6. ,width: 40
  7. ,sortable: false
  8. ,hidden: MODx.perm.resourcegroup_resource_edit != 1
  9. });
  10. var qs = Ext.urlDecode(window.location.search.substring(1));
  11. Ext.applyIf(config,{
  12. id: 'modx-grid-resource-security'
  13. ,url: MODx.config.connector_url
  14. ,baseParams: {
  15. action: 'resource/resourcegroup/getList'
  16. ,resource: config.resource
  17. ,"parent": config["parent"]
  18. ,mode: config.mode || 'update'
  19. ,"token": qs.reload || ''
  20. }
  21. ,saveParams: {
  22. resource: config.resource
  23. }
  24. ,fields: ['id','name','access']
  25. ,paging: true
  26. ,remoteSort: true
  27. ,plugins: ac
  28. ,columns: [{
  29. header: _('name')
  30. ,dataIndex: 'name'
  31. ,width: 200
  32. ,sortable: true
  33. },ac]
  34. });
  35. MODx.grid.ResourceSecurity.superclass.constructor.call(this,config);
  36. this.on('rowclick',MODx.fireResourceFormChange);
  37. };
  38. Ext.extend(MODx.grid.ResourceSecurity,MODx.grid.Grid);
  39. Ext.reg('modx-grid-resource-security',MODx.grid.ResourceSecurity);