modx.grid.resource.security.local.js 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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: true
  8. ,hidden: MODx.perm.resourcegroup_resource_edit != 1
  9. });
  10. Ext.applyIf(config,{
  11. id: 'modx-grid-resource-security'
  12. ,fields: ['id','name','access']
  13. ,paging: false
  14. ,remoteSort: false
  15. ,autoHeight: true
  16. ,plugins: ac
  17. ,columns: [{
  18. header: _('name')
  19. ,dataIndex: 'name'
  20. ,width: 200
  21. ,sortable: true
  22. },ac]
  23. });
  24. MODx.grid.ResourceSecurity.superclass.constructor.call(this,config);
  25. this.propRecord = Ext.data.Record.create(config.fields);
  26. this.on('rowclick',MODx.fireResourceFormChange);
  27. this.store.sortInfo = {
  28. field: 'access',
  29. direction: 'DESC'
  30. };
  31. };
  32. Ext.extend(MODx.grid.ResourceSecurity,MODx.grid.LocalGrid);
  33. Ext.reg('modx-grid-resource-security',MODx.grid.ResourceSecurity);