{name:htmlEncode}',
' - {description:htmlEncode}',
'
'),
pageSize: 20,
url: fred.config.connectorUrl,
baseParams: {
action: 'mgr/element_option_sets/getlist',
addEmpty: config.addEmpty || 0
}
});
fred.combo.ElementOptionSets.superclass.constructor.call(this, config);
};
Ext.extend(fred.combo.ElementOptionSets, MODx.combo.ComboBox);
Ext.reg('fred-combo-element-option-sets', fred.combo.ElementOptionSets);
fred.combo.Themes = function (config) {
config = config || {};
Ext.applyIf(config, {
name: 'theme',
hiddenName: 'theme',
displayField: 'name',
valueField: 'id',
fields: ['name', 'id', 'theme_folder'],
pageSize: 20,
isUpdate: false,
url: fred.config.connectorUrl,
baseParams: {
action: 'mgr/themes/getlist',
addAll: config.addAll || 0
}
});
fred.combo.Themes.superclass.constructor.call(this, config);
if (config.isUpdate === false) {
this.store.load();
this.store.on('load', function(store, r) {
this.setValue(r[0].id);
this.fireEvent('select', this, r[0]);
}, this, {single: true});
}
};
Ext.extend(fred.combo.Themes, MODx.combo.ComboBox);
Ext.reg('fred-combo-themes', fred.combo.Themes);
fred.combo.Template = function (config, getStore) {
config = config || {};
if (!config.clearBtnCls) {
if (MODx.config.connector_url) {
config.clearBtnCls = 'x-form-trigger';
} else {
config.clearBtnCls = null;
}
}
if (!config.expandBtnCls) {
if (MODx.config.connector_url) {
config.expandBtnCls = 'x-form-trigger';
} else {
config.expandBtnCls = null;
}
}
Ext.applyIf(config, {
name: 'templates',
hiddenName: 'templates[]',
displayField: 'templatename',
valueField: 'id',
fields: ['templatename', 'id'],
mode: 'remote',
triggerAction: 'all',
typeAhead: true,
editable: true,
forceSelection: false,
pageSize: 20,
url: fred.config.connectorUrl,
baseParams: {
action: 'mgr/extra/gettemplates',
hideUsed: 1
}
});
Ext.applyIf(config, {
store: new Ext.data.JsonStore({
url: config.url,
root: 'results',
totalProperty: 'total',
fields: config.fields,
errorReader: MODx.util.JSONReader,
baseParams: config.baseParams || {},
remoteSort: config.remoteSort || false,
autoDestroy: true
})
});
if (getStore === true) {
config.store.load();
return config.store;
}
fred.combo.Template.superclass.constructor.call(this, config);
this.config = config;
return this;
};
Ext.extend(fred.combo.Template, Ext.ux.form.SuperBoxSelect);
Ext.reg('fred-combo-template', fred.combo.Template);
fred.combo.RootCategory = function (config, getStore) {
config = config || {};
if (!config.clearBtnCls) {
if (MODx.config.connector_url) {
config.clearBtnCls = 'x-form-trigger';
} else {
config.clearBtnCls = null;
}
}
if (!config.expandBtnCls) {
if (MODx.config.connector_url) {
config.expandBtnCls = 'x-form-trigger';
} else {
config.expandBtnCls = null;
}
}
Ext.applyIf(config, {
name: 'categories',
hiddenName: 'categories[]',
displayField: 'category',
valueField: 'category',
fields: ['category'],
mode: 'remote',
triggerAction: 'all',
typeAhead: true,
editable: true,
forceSelection: false,
pageSize: 20,
url: fred.config.connectorUrl,
baseParams: {
action: 'mgr/extra/getcategories',
parent: 0
}
});
Ext.applyIf(config, {
store: new Ext.data.JsonStore({
url: config.url,
root: 'results',
totalProperty: 'total',
fields: config.fields,
errorReader: MODx.util.JSONReader,
baseParams: config.baseParams || {},
remoteSort: config.remoteSort || false,
autoDestroy: true
})
});
if (getStore === true) {
config.store.load();
return config.store;
}
fred.combo.RootCategory.superclass.constructor.call(this, config);
this.config = config;
return this;
};
Ext.extend(fred.combo.RootCategory, Ext.ux.form.SuperBoxSelect);
Ext.reg('fred-combo-root-category', fred.combo.RootCategory);
fred.combo.InstalledPackages = function (config) {
config = config || {};
Ext.applyIf(config, {
name: 'package',
hiddenName: 'package',
displayField: 'package_name',
valueField: 'package_name',
fields: ['package_name'],
pageSize: 20,
isUpdate: false,
url: fred.config.connectorUrl,
editable: true,
forceSelection: false,
typeAhead: false,
selectOnFocus: false,
baseParams: {
action: 'mgr/extra/getinstalledpackages'
}
});
fred.combo.Themes.superclass.constructor.call(this, config);
if (config.isUpdate === false) {
this.store.load();
this.store.on('load', function(store, r) {
this.setValue(r[0].id);
this.fireEvent('select', this, r[0]);
}, this, {single: true});
}
};
Ext.extend(fred.combo.InstalledPackages, MODx.combo.ComboBox);
Ext.reg('fred-combo-installed-packages', fred.combo.InstalledPackages);