2004-10-05 Helge Hess <helge.hess@opengroupware.org>
+ * v0.9.21
+
+ * UIxMailTree: made toolbar configurable using 'toolbar' slot on the
+ clientObject
+
+ * product.plist: added toolbar configurations
+
+ * UIxMailMainFrame.wox: moved toolbar to own component
+
* UIxMailListView: added simple navigation (v0.9.20)
* v0.9.19
\
UIxMailMainFrame.m \
UIxMailTree.m \
+ UIxMailToolbar.m \
\
UIxMailAccountsView.m \
UIxMailAccountView.m \
MailerUI_RESOURCE_FILES += \
UIxMailMainFrame.wox \
UIxMailTree.wox \
+ UIxMailToolbar.wox \
\
UIxMailAccountsView.wox \
UIxMailAccountView.wox \
}
- (NSString *)imap4SortKey {
+ NSString *sort;
+
+ sort = [[[self context] request] formValueForKey:@"sort"];
+
return @"SUBJECT";
}
<!-- TODO: see AB for sorting -->
<td class="tbtv_headercell" width="60%">
- <a href="?sort=subject"><var:string label:value="Subject" /></a>
+ <a href="view" _sort="subject"><var:string label:value="Subject" /></a>
</td>
<td class="tbtv_headercell">
<var:if condition="showToAddress" const:negate="YES">
- <a href="?sort=from"><var:string label:value="From" /></a>
+ <a href="view" _sort="from"><var:string label:value="From" /></a>
</var:if>
<var:if condition="showToAddress">
- <a href="?sort=to"><var:string label:value="To" /></a>
+ <a href="view" _sort="to"><var:string label:value="To" /></a>
</var:if>
</td>
<td class="tbtv_headercell" width="17">
<img rsrc:src="icon_read.gif" />
</td>
<td class="tbtv_headercell">
- <a href="?sort=date"><var:string label:value="Date" /></a>
+ <a href="view" _sort="date"><var:string label:value="Date" /></a>
</td>
</tr>
<tr class="tableview">
<!-- this table is required for right alignment -->
<tr>
<td valign="top" class="vertframerow">
- <table border="0">
- <tr>
- <td class="tb_icon"
- ><a href="getMail" class="tbicon_getmail"> </a></td>
- <td class="tb_icon"><a href="compose" target="_blank"
- class="tbicon_compose"> </a></td>
- <td class="tb_icon"><a href="addressbook" target="addressbook"
- class="tbicon_addressbook"> </a></td>
- <td class="tb_spacer"> </td>
-
- <!-- TODO: should do a form submit? -->
- <td class="tb_icon"><a href="#" class="tbicon_reply" > </a></td>
- <td class="tb_icon"><a href="#" class="tbicon_replyall"> </a></td>
- <td class="tb_icon"><a href="#" class="tbicon_forward" > </a></td>
- <td class="tb_spacer"> </td>
-
- <td class="tb_icon"><a href="#" class="tbicon_delete"> </a></td>
- <td class="tb_icon"><a href="#" class="tbicon_junk" > </a></td>
- <td class="tb_spacer"> </td>
-
- <td class="tb_icon"><a href="#" class="tbicon_print"> </a></td>
- <td class="tb_icon"><a href="#" class="tbicon_stop" > </a></td>
- </tr>
- <tr>
- <td class="tb_label">Get Mail</td>
- <td class="tb_label">Write</td>
- <td class="tb_label">Address Book</td>
- <td class="tb_spacer"> </td>
- <td class="tb_label">Reply</td>
- <td class="tb_label">Reply All</td>
- <td class="tb_label">Forward</td>
- <td class="tb_spacer"> </td>
- <td class="tb_label">Delete</td>
- <td class="tb_label">Junk</td>
- <td class="tb_spacer"> </td>
- <td class="tb_label">Print</td>
- <td class="tb_label">Stop</td>
- </tr>
- </table>
+ <var:component className="UIxMailToolbar" />
</td>
<td align="right" width="80" class="vertframerow">
<table border="0">
--- /dev/null
+/*
+ Copyright (C) 2004 SKYRIX Software AG
+
+ This file is part of OpenGroupware.org.
+
+ OGo is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with OGo; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+// $Id$
+
+#include <SOGoUI/UIxComponent.h>
+
+@class NSArray, NSDictionary;
+
+@interface UIxMailToolbar : UIxComponent
+{
+ NSArray *toolbarConfig;
+ NSArray *toolbarGroup;
+ NSDictionary *buttonInfo;
+}
+@end
+
+#include <SOGo/SoObjects/Mailer/SOGoMailBaseObject.h>
+#include "common.h"
+#include <NGObjWeb/SoComponent.h>
+
+@implementation UIxMailToolbar
+
+- (void)dealloc {
+ [self->toolbarGroup release];
+ [self->toolbarConfig release];
+ [self->buttonInfo release];
+ [super dealloc];
+}
+
+/* notifications */
+
+- (void)sleep {
+ [self->toolbarGroup release]; self->toolbarGroup = nil;
+ [self->toolbarConfig release]; self->toolbarConfig = nil;
+ [self->buttonInfo release]; self->buttonInfo = nil;
+ [super sleep];
+}
+
+/* accessors */
+
+- (void)setToolbarGroup:(id)_group {
+ ASSIGN(self->toolbarGroup, _group);
+}
+- (id)toolbarGroup {
+ return self->toolbarGroup;
+}
+
+- (void)setButtonInfo:(id)_info {
+ ASSIGN(self->buttonInfo, _info);
+}
+- (id)buttonInfo {
+ return self->buttonInfo;
+}
+
+/* toolbar */
+
+- (id)toolbarConfig {
+ id tmp;
+
+ if (self->toolbarConfig != nil)
+ return [self->toolbarConfig isNotNull] ? self->toolbarConfig : nil;
+
+ tmp = [[self clientObject] lookupName:@"toolbar" inContext:[self context]
+ acquire:NO];
+ if ([tmp isKindOfClass:[NSException class]]) {
+ [self logWithFormat:
+ @"ERROR: not toolbar configuration found on SoObject: %@ (%@)",
+ [self clientObject], [[self clientObject] soClass]];
+ self->toolbarConfig = [[NSNull null] retain];
+ return nil;
+ }
+ self->toolbarConfig = [tmp retain];
+ return self->toolbarConfig;
+}
+
+/* labels */
+
+- (NSString *)buttonLabel {
+ WOResourceManager *rm;
+ NSArray *languages;
+ WOContext *ctx;
+ NSString *key, *label;
+
+ key = [[self buttonInfo] valueForKey:@"label"];
+
+ /* lookup languages */
+
+ ctx = [self context];
+ languages = [ctx hasSession]
+ ? [[ctx session] languages]
+ : [[ctx request] browserLanguages];
+
+ /* lookup resource manager */
+
+ if ((rm = [self resourceManager]) == nil)
+ rm = [[WOApplication application] resourceManager];
+ if (rm == nil)
+ [self debugWithFormat:@"WARNING: missing resource manager!"];
+
+ /* lookup string */
+
+ label = [rm stringForKey:key inTableNamed:nil withDefaultValue:key
+ languages:languages];
+ return label;
+}
+
+@end /* UIxMailToolbar */
--- /dev/null
+<?xml version="1.0" standalone="yes"?>
+<table
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:var="http://www.skyrix.com/od/binding"
+ xmlns:const="http://www.skyrix.com/od/constant"
+ xmlns:rsrc="OGo:url"
+ xmlns:label="OGo:label"
+ xmlns:so="http://www.skyrix.com/od/so-lookup"
+>
+ <tr>
+ <var:foreach list="toolbarConfig" item="toolbarGroup">
+ <var:foreach list="toolbarGroup" item="buttonInfo">
+ <td class="tb_icon"
+ ><a var:href="buttonInfo.link"
+ var:class="buttonInfo.cssClass"></a></td>
+ </var:foreach>
+ <td class="tb_spacer"> </td>
+ </var:foreach>
+ </tr>
+ <tr>
+ <var:foreach list="toolbarConfig" item="toolbarGroup">
+ <var:foreach list="toolbarGroup" item="buttonInfo">
+ <td class="tb_label"><var:string value="buttonInfo.label" /></td>
+ </var:foreach>
+ <td class="tb_spacer"> </td>
+ </var:foreach>
+ </tr>
+</table>
# $Id$
-SUBMINOR_VERSION:=20
+SUBMINOR_VERSION:=21
categories = {
SOGoMailFolder = {
+ slots = {
+ toolbar = {
+ protectedBy = "View";
+ value = ( /* the toolbar groups */
+ ( /* first group */
+ {
+ link = "getMail";
+ cssClass = "tbicon_getmail"; label = "Get Mail";
+ },
+ {
+ link = "compose"; target = "_blank";
+ cssClass = "tbicon_compose"; label = "Write";
+ },
+ {
+ link = "addressbook"; target = "addressbook";
+ cssClass = "tbicon_addressbook"; label = "Write";
+ }
+ ),
+ ( /* second group */
+ { link = "#";
+ cssClass = "tbicon_reply"; label = "Reply"; },
+ { link = "#";
+ cssClass = "tbicon_replyall"; label = "Reply All"; },
+ { link = "#"; cssClass = "tbicon_forward"; label = "Forward"; },
+ ),
+ ( /* third group */
+ { link = "#";
+ cssClass = "tbicon_delete"; label = "Delete"; },
+ { link = "#";
+ cssClass = "tbicon_junk"; label = "Junk"; },
+ ),
+ ( /* fourth group */
+ { link = "#"; cssClass = "tbicon_print"; label = "Print"; },
+ { link = "#"; cssClass = "tbicon_stop"; label = "Stop"; },
+ ),
+ );
+ };
+ };
methods = {
view = {
protectedBy = "View";
pageName = "UIxMailListView";
actionName = "getMail";
};
+
+ compose = {
+ protectedBy = "View";
+ pageName = "UIxMailEditor";
+ };
};
};
SOGoMailObject = {
+ slots = {
+ toolbar = {
+ protectedBy = "View";
+ value = ( /* the toolbar groups */
+ ( /* first group */
+ {
+ link = "getMail";
+ cssClass = "tbicon_getmail"; label = "Get Mail";
+ },
+ {
+ link = "compose"; target = "_blank";
+ cssClass = "tbicon_compose"; label = "Write";
+ },
+ {
+ link = "addressbook"; target = "addressbook";
+ cssClass = "tbicon_addressbook"; label = "Write";
+ }
+ ),
+ ( /* second group */
+ { link = "#";
+ cssClass = "tbicon_reply"; label = "Reply"; },
+ { link = "#";
+ cssClass = "tbicon_replyall"; label = "Reply All"; },
+ { link = "#"; cssClass = "tbicon_forward"; label = "Forward"; },
+ ),
+ ( /* third group */
+ { link = "#";
+ cssClass = "tbicon_delete"; label = "Delete"; },
+ { link = "#";
+ cssClass = "tbicon_junk"; label = "Junk"; },
+ ),
+ ( /* fourth group */
+ { link = "#"; cssClass = "tbicon_print"; label = "Print"; },
+ { link = "#"; cssClass = "tbicon_stop"; label = "Stop"; },
+ ),
+ );
+ };
+ };
methods = {
view = {
protectedBy = "View";
};
SOGoMailAccounts = {
+ slots = {
+ toolbar = {
+ protectedBy = "View";
+ value = ( /* the toolbar groups */
+ ( /* first group */
+ {
+ link = "getMail";
+ cssClass = "tbicon_getmail"; label = "Get Mail";
+ },
+ )
+ );
+ };
+ };
methods = {
view = {
protectedBy = "View";
};
SOGoMailAccount = {
+ slots = {
+ toolbar = {
+ protectedBy = "View";
+ value = ( /* the toolbar groups */
+ ( /* first group */
+ {
+ link = "getMail";
+ cssClass = "tbicon_getmail"; label = "Get Mail";
+ },
+ )
+ );
+ };
+ };
methods = {
view = {
protectedBy = "View";