Skip to content

Commit

Permalink
(feat) new SOGoHelpURL preference to set a custom URL for SOGo help (…
Browse files Browse the repository at this point in the history
…fixes #2768)
  • Loading branch information
extrafu committed Mar 22, 2016
1 parent fee3109 commit 916806c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 9 deletions.
5 changes: 5 additions & 0 deletions Documentation/SOGoInstallationGuide.asciidoc
Expand Up @@ -1819,6 +1819,11 @@ behaviour of SOGo.
Defaults to `SOGo` when unset.
|S |SOGoHelpURL
|Parameter used to define the URL to online help for SOGo. When set,
an additional icon will appear near the logout button in SOGo's
web interface. The URL will always be open in a blank target.
|U |SOGoLoginModule
|Parameter used to specify which module to show after login. Possible
values are:
Expand Down
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -9,6 +9,7 @@ Enhancements
- [web] updated Angular Material to version 1.0.6
- [web] added Lithuanan (lt) translation - thanks to Mantas Liobė
- [web] we now "cc" delegates during invitation updates (#3195)
- [web] new SOGoHelpURL preference to set a custom URL for SOGo help (#2768)

Bug fixes
- [web] fixed missing columns in SELECT statements (PostgreSQL)
Expand Down
3 changes: 2 additions & 1 deletion SoObjects/SOGo/SOGoSystemDefaults.h
@@ -1,6 +1,6 @@
/* SOGoSystemDefaults.h - this file is part of SOGo
*
* Copyright (C) 2009-2015 Inverse inc.
* Copyright (C) 2009-2016 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -67,6 +67,7 @@
- (BOOL) easDebugEnabled;

- (NSString *) pageTitle;
- (NSString *) helpURL;

- (NSArray *) supportedLanguages;
- (NSString *) loginSuffix;
Expand Down
5 changes: 5 additions & 0 deletions SoObjects/SOGo/SOGoSystemDefaults.m
Expand Up @@ -435,6 +435,11 @@ - (NSString *) pageTitle
return [self stringForKey: @"SOGoPageTitle"];
}

- (NSString *) helpURL
{
return [self stringForKey: @"SOGoHelpURL"];
}

- (NSArray *) supportedLanguages
{
static NSArray *supportedLanguages = nil;
Expand Down
17 changes: 9 additions & 8 deletions UI/Common/UIxPageFrame.m
Expand Up @@ -112,20 +112,21 @@ - (NSString *) doctype
return (@"<!DOCTYPE html>");
}

/* Help URL/target */

/* Help URL */
- (NSString *) helpURL
{
return [NSString stringWithFormat: @"help/%@.html", title];
}
SOGoSystemDefaults *sd;
NSString *s;

- (NSString *) helpWindowTarget
{
return [NSString stringWithFormat: @"Help_%@", title];
sd = [SOGoSystemDefaults sharedSystemDefaults];

if ((s = [sd helpURL]))
return s;

return @"";
}

/* notifications */

- (void) sleep
{
[item release];
Expand Down
7 changes: 7 additions & 0 deletions UI/Templates/UIxTopnavToolbarTemplate.wox
Expand Up @@ -53,6 +53,13 @@
</md-button>
<div class="hide-xs" style="width: 40px"
ng-show="activeUser.path.logoff.length"><!-- divider --></div>
<md-button class="md-icon-button"
ng-show="activeUser.path.help.length"

This comment has been minimized.

Copy link
@cgx

cgx Mar 23, 2016

Contributor

How about using SOPE instead of JS? You could wrap the button with a <var:if> tag and use the helpURL method directly.

ng-href="{{activeUser.path.help}}"
target="_blank">
<md-icon>help_outline</md-icon>
<md-tooltip><var:string label:value="Help"/></md-tooltip>
</md-button>
<md-button class="md-icon-button"
ng-show="activeUser.path.logoff.length"
ng-href="{{activeUser.path.logoff}}">
Expand Down

0 comments on commit 916806c

Please sign in to comment.