/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include <SOGoUI/UIxComponent.h>
return label;
}
+/* enable/disable buttons */
+
+- (BOOL)isButtonEnabled {
+ // TODO: replace 'enabled' with WOAssociation when this gets a dynamic
+ // element
+ NSString *onOffKey;
+
+ if ((onOffKey = [[self buttonInfo] valueForKey:@"enabled"]) == nil)
+ return YES;
+
+ return [[[[self context] page] valueForKeyPath:onOffKey] boolValue];
+}
+
@end /* UIxMailToolbar */
cssClass = "tbicon_getmail"; label = "Get Mail"; },
{
link = "#"; // "compose"; // target = "_blank";
+ isSafe = NO;
onclick = "clickedCompose(this);return false;";
cssClass = "tbicon_compose"; label = "Write";
},
),
( // second group
{ link = "reply";
+ isSafe = NO;
cssClass = "tbicon_reply"; label = "Reply"; },
{ link = "replyall";
+ isSafe = NO;
cssClass = "tbicon_replyall"; label = "Reply All"; },
{ link = "forward";
+ isSafe = NO;
cssClass = "tbicon_forward"; label = "Forward"; },
),
( // third group
- { link = "delete";
+ { link = "delete";
+ isSafe = NO;
+ enabled = clientObject.isDeletionAllowed;
cssClass = "tbicon_delete"; label = "Delete"; },
/* TODO: enable when we know how to mark junk (#971)
{ link = "#";
+ isSafe = NO;
cssClass = "tbicon_junk"; label = "Junk"; },
*/
),
cssClass = "tbicon_getmail"; label = "Get Mail"; },
{
link = "#"; // "compose"; // target = "_blank";
+ isSafe = NO;
onclick = "clickedCompose(this);return false;";
cssClass = "tbicon_compose"; label = "Write";
},
cssClass = "tbicon_getmail"; label = "Get Mail"; },
{
link = "#"; // "compose"; // target = "_blank";
+ isSafe = NO;
onclick = "clickedCompose(this);return false;";
cssClass = "tbicon_compose"; label = "Write"; },
)
protectedBy = "View";
value = ( /* the toolbar groups */
( /* first group */
- { link = "#";
+ { link = "#"; isSafe = NO;
onclick = "clickedEditorSend(this);return false;";
cssClass = "tbicon_send"; label = "Send"; },
{ link = "#"; target = "addressbook";
{ link = "#"; target = "anais";
onclick = "openAnais(this);return false;";
cssClass = "tbicon_addressbook"; label = "Anais"; },
- { link = "#";
+ { link = "#"; isSafe = NO;
onclick = "clickedEditorAttach(this)";
cssClass = "tbicon_attach"; label = "Attach"; },
- { link = "#";
+ { link = "#"; isSafe = NO;
onclick = "clickedEditorSave(this);return false;";
cssClass = "tbicon_save"; label = "Save"; },
- { link = "delete";
+ { link = "delete"; isSafe = NO;
cssClass = "tbicon_delete"; label = "Delete"; },
)
);
xmlns:label="OGo:label"
xmlns:so="http://www.skyrix.com/od/so-lookup"
>
+ <!-- image row -->
<tr>
<var:foreach list="toolbarConfig" item="toolbarGroup">
<var:foreach list="toolbarGroup" item="buttonInfo">
- <td class="tb_icon"
+ <var:if condition="isButtonEnabled">
+ <td class="tb_icon"
><a var:href="buttonInfo.link" var:target="buttonInfo.target"
var:class="buttonInfo.cssClass"
var:onclick="buttonInfo.onclick"></a></td>
+ </var:if>
</var:foreach>
<td class="tb_spacer"> </td>
</var:foreach>
</tr>
+ <!-- label row -->
<tr>
<var:foreach list="toolbarConfig" item="toolbarGroup">
<var:foreach list="toolbarGroup" item="buttonInfo">
- <td class="tb_label"><var:string value="buttonInfo.label" /></td>
+ <var:if condition="isButtonEnabled">
+ <td class="tb_label"><var:string value="buttonInfo.label" /></td>
+ </var:if>
</var:foreach>
<td class="tb_spacer"> </td>
</var:foreach>