Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-01-2010, 01:14 AM
New Member
 
Posts: 4
Default zimlet with compose toolbar button

Hi,
I'm trying to add a new custom button in the email compose toolbar. The button seems to be add by the javascript module, but the button does not appear in the toolbar.
I have the same behavior using the sms simlet that I use as source code example.
Is it a zimbra bug? A problem with my zimbra server configuration?
Thanks.
Reply With Quote
  #2 (permalink)  
Old 03-01-2010, 08:24 AM
Zimbra Employee
 
Posts: 187
Default

SMS Zimlet needs to be upgraded to work for 6.x. In 6.x we support multiple compose (and compose in tabs). Also in 6.x we have a newer api initializeToolbar that helps to easily add toolbar buttons.

The code below adds button to compose
Code:
com_zimbra_hellotoolbarbtns.prototype.initializeToolbar =
function(app, toolbar, controller, view) {

	//for compose view since 6.x supports multiple compose tabs(and has dynamic ids)	that look like “123_COMPOSE_DWT123”
	if(viewId.indexOf("COMPOSE")  >=0){
		//get the index of View menu so we can display it after that.
		var buttonIndex = -1;
		for (var i = 0, count = toolbar.opList.length; i < count; i++) {
			if (toolbar.opList[i] == ZmOperation.VIEW_MENU) {
				buttonIndex = i + 1;
				break;
			}
		}
		//create params obj with button details
		var buttonArgs = {
			text    : "Toolbar Button",
			tooltip: "This button shows up in Conversation view, traditional view, and in convlist view",
			index: buttonIndex, //position of the button
			image: "zimbraicon" //icon
		};

		//toolbar.createOp api creates the button with some id and  params containing button details.
		var button = toolbar.createOp("HELLOTEST_ZIMLET_TOOLBAR_BUTTON", buttonArgs);
		button.addSelectionListener(new AjxListener(this, this._showSelectedMail, controller));
	}
};

com_zimbra_hellotoolbarbtns.prototype._showSelectedMail =
function(controller) {
	var message = controller.getMsg();
	appCtxt.getAppController().setStatusMsg("Subject:"+ message.subject);
};
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #3 (permalink)  
Old 03-02-2010, 10:31 AM
Zimbra Employee
 
Posts: 105
Default

A similar example is available at:

ZCS 6.0:Zimlet Developers Guide:Examples:Adding Toolbar Buttons - Zimbra :: Wiki
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.