42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
Ext.namespace('Zarafa.plugins.contacthelper');
|
|
|
|
|
|
Zarafa.plugins.contacthelper.ContactHelper = Ext.extend(Zarafa.core.Plugin, {
|
|
/**
|
|
* Initialize the plugin by calling {@link #registerInsertionPoint}.
|
|
* @protected
|
|
*/
|
|
initPlugin : function()
|
|
{
|
|
Zarafa.plugins.contacthelper.ContactHelper.superclass.initPlugin.apply(this, arguments);
|
|
this.registerInsertionPoint('context.contact.contextmenu.actions', this.createBulkCategoriesContextItem, this);
|
|
},
|
|
|
|
createBulkCategoriesContextItem : function()
|
|
{
|
|
return {
|
|
text : _('Multiple Categories'),
|
|
iconCls : 'icon_categories',
|
|
scope : this,
|
|
handler : this.onContextItemCategories,
|
|
beforeShow : function(item, records) {
|
|
var visible = records.length > 1;
|
|
item.setVisible(visible);
|
|
}
|
|
};
|
|
},
|
|
|
|
onContextItemCategories : function(item)
|
|
{
|
|
Zarafa.common.Actions.openCategoriesContent(item.parentMenu.records);
|
|
}
|
|
});
|
|
|
|
Zarafa.onReady(function() {
|
|
container.registerPlugin(new Zarafa.core.PluginMetaData({
|
|
name : 'contacthelper',
|
|
displayName : _('Contact Helper'),
|
|
pluginConstructor : Zarafa.plugins.contacthelper.ContactHelper
|
|
}));
|
|
});
|