| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- VersionX.panel.Plugins = function(config) {
- config = config || {};
- Ext.apply(config,{
- id: 'versionx-panel-plugins',
- border: false,
- forceLayout: true,
- width: '98%',
- items: [{
- layout: 'column',
- border: false,
- items: [{
- columnWidth:.5,
- layout: 'form',
- border: false,
- items: [{
- xtype: (VersionX.inVersion) ? 'hidden' : 'textfield', //'versionx-combo-plugins',
- fieldLabel: _('plugin'),
- name: 'fltr_plugin',
- width: '95%',
- id: 'plugin-f-plugin',
- value: (VersionX.inVersion) ? MODx.request.id : ''
- },{
- xtype: 'modx-combo-user',
- fieldLabel: _('user'),
- name: 'fltr_user',
- hiddenName: 'fltr_user',
- anchor: '1',
- id: 'plugin-f-user'
- },{
- xtype: 'datefield',
- fieldLabel: _('versionx.filter.datefrom'),
- name: 'fltr_from',
- anchor: '1',
- id: 'plugin-f-from'
- }]
- },{
- columnWidth:.5,
- layout: 'form',
- border: false,
- items: [{
- xtype: (VersionX.inVersion) ? 'hidden' : 'modx-combo-category',
- fieldLabel: _('category'),
- name: 'fltr_category',
- anchor: '1',
- id: 'plugin-f-category'
- },{
- fieldLabel: '',
- style: 'height: 36px !important',
- border: false
- },{
- xtype: 'datefield',
- fieldLabel: _('versionx.filter.dateuntil'),
- name: 'fltr_until',
- anchor: '1',
- id: 'plugin-f-until'
- }]
- }]
- },{
- layout: 'column',
- padding: '10px 0 0 0',
- border: false,
- defaults: {
- border: false
- },
- items: [{
- width: 90,
- items: [{
- border: false,
- html: ' '
- }]
- },{
- items: [{
- xtype: 'button',
- cls: 'primary-button',
- handler: this.doFilter,
- text: _('versionx.filter',{what: _('plugins')})
- }]
- },{
- items: [{
- xtype: 'button',
- handler: this.resetFilter,
- text: _('versionx.filter.reset')
- }]
- },{
- columnWidth: 1,
- items: [{
- html: ' ',
- border: false
- }]
- }]
- }],
- listeners: {
- 'success': function () {}
- }
- });
- VersionX.panel.Plugins.superclass.constructor.call(this,config);
- };
- Ext.extend(VersionX.panel.Plugins,MODx.Panel,{
- doFilter: function() {
- var g = Ext.getCmp('versionx-grid-plugins');
- if (g) {
- g.baseParams['plugin'] = Ext.getCmp('plugin-f-plugin').getValue();
- g.baseParams['category'] = Ext.getCmp('plugin-f-category').getValue();
- g.baseParams['user'] = Ext.getCmp('plugin-f-user').getValue();
- g.baseParams['from'] = Ext.getCmp('plugin-f-from').getValue();
- g.baseParams['until'] = Ext.getCmp('plugin-f-until').getValue();
- g.getBottomToolbar().changePage(1);
- g.refresh();
- }
- },
- resetFilter: function() {
- var g = Ext.getCmp('versionx-grid-plugins');
- g.baseParams['plugin'] = (VersionX.inVersion) ? MODx.request.id : '';
- g.baseParams['category'] = '';
- g.baseParams['user'] = '';
- g.baseParams['from'] = '';
- g.baseParams['until'] = '';
- g.getBottomToolbar().changePage(1);
- g.refresh();
- Ext.getCmp('plugin-f-plugin').reset();
- Ext.getCmp('plugin-f-category').reset();
- Ext.getCmp('plugin-f-user').reset();
- Ext.getCmp('plugin-f-from').reset();
- Ext.getCmp('plugin-f-until').reset();
- }
- });
- Ext.reg('versionx-panel-plugins',VersionX.panel.Plugins);
|