]> git.proxmox.com Git - pmg-gui.git/blobdiff - js/ObjectGroupConfiguration.js
quarantine: refactor spamquarantine controller
[pmg-gui.git] / js / ObjectGroupConfiguration.js
index 962e375f6da83884d1a00efb0fd1663869994a10..1d728510a14d0b40d065aef71540c8fe1afc090e 100644 (file)
@@ -3,42 +3,44 @@ Ext.define('PMG.ObjectGroupConfiguration', {
 
     ogclass: undefined, // who, when, what
     otype_list: [],
-    
-    layout: { type: 'hbox', align: 'stretch' },
+
+    layout: 'border',
     border: false,
-    
-    initComponent : function() {
+
+    initComponent: function() {
        var me = this;
 
        if (me.ogclass === undefined) {
-           throw "undefined object group class"
+           throw "undefined object group class";
        }
-       
-       if (!(me.title = PMG.Utils.oclass_text[me.ogclass])) {
+
+       if (!PMG.Utils.oclass_text[me.ogclass]) {
            throw "unknown object group class";
        }
 
        var left = Ext.create('PMG.ObjectGroupList', {
            width: 250,
            ogclass: me.ogclass,
-           subject: me.title,
-           border: false
+           subject: PMG.Utils.oclass_text[me.ogclass],
+           title: PMG.Utils.oclass_text[me.ogclass],
+           border: false,
+           split: true,
+           region: 'west',
        });
-       
+
        var right = Ext.create('PMG.ObjectGroup', {
            otype_list: me.otype_list,
            border: false,
-           flex: 1,
+           region: 'center',
            listeners: {
                dblclickOGInfo: function(w, e, t, ogdata) {
                    // test if the correct groups is selected (just to be sure)
                    var rec = left.selModel.getSelection()[0];
                    if (rec && rec.data && rec.data.id === ogdata.id) {
                        left.run_editor();
-                       return;
                    }
-               }
-           }
+               },
+           },
        });
 
        me.mon(left.store, "refresh", function() {
@@ -60,34 +62,34 @@ Ext.define('PMG.ObjectGroupConfiguration', {
            var baseurl = '/config/ruledb/' + me.ogclass + '/' + rec.data.id;
            right.setBaseUrl(baseurl);
        });
-       
-       me.items = [ left, { xtype: 'splitter' }, right ];
+
+       me.items = [left, right];
 
        me.callParent();
-    }
+    },
 });
 
 Ext.define('PMG.WhoConfiguration', {
     extend: 'PMG.ObjectGroupConfiguration',
-    alias: 'widget.pmgWhoConfiguration',
+    xtype: 'pmgWhoConfiguration',
 
     ogclass: 'who',
-    otype_list: [1000, 1001, 1002, 1003, 1004, 1005]
+    otype_list: [1000, 1001, 1002, 1003, 1004, 1005, 1006],
 });
 
 Ext.define('PMG.WhenConfiguration', {
     extend: 'PMG.ObjectGroupConfiguration',
-    alias: 'widget.pmgWhenConfiguration',
+    xtype: 'pmgWhenConfiguration',
 
     ogclass: 'when',
-    otype_list: [2000]
+    otype_list: [2000],
 });
 
 Ext.define('PMG.WhatConfiguration', {
     extend: 'PMG.ObjectGroupConfiguration',
-    alias: 'widget.pmgWhatConfiguration',
+    xtype: 'pmgWhatConfiguration',
 
     ogclass: 'what',
-    otype_list: []
+    otype_list: [3000, 3001, 3002, 3003, 3004, 3005, 3006],
 });