- see ChangeLog;

Monotone-Parent: 568b85ef47fb295fcbb767ce70799e2091003ad6
Monotone-Revision: d3c9c2e311e8b691ae22a71396569a698fc505e6

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-07-07T21:19:48
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2006-07-07 21:19:48 +00:00
parent 2e2b0ffee0
commit ba5eca0941
3 changed files with 79 additions and 10 deletions

View File

@ -1,5 +1,13 @@
2006-07-07 Wsourdeau Sourdeau <wsourdeau@inverse.ca>
* UI/Common/UIxPageFrame.m ([UIxPageFrame -productJavaScriptURL]):
added method to determine the possible URL for a product-specific
javascript filename of the forme <productname>.js.
([UIxPageFrame -hasProductSpecificJavaScript]): new method.
([UIxPageFrame -isPopup]): new method to determine whether the
application navigator bar should be displayed (main page) or not
(popup page).
* SoObjects/SOGo/SOGoAuthenticator.m ([SOGoAuthenticator
-LDAPCheckLogin:_loginpassword:_pwd]): new method to authenticate
the user through LDAP.

View File

@ -19,7 +19,14 @@
02111-1307, USA.
*/
#include <SOGoUI/UIxComponent.h>
#import <SOGoUI/UIxComponent.h>
#import <SOGo/SOGoUser.h>
@interface WOComponent (PopupExtension)
- (BOOL) isPopup;
@end
@interface UIxPageFrame : UIxComponent
{
@ -109,7 +116,18 @@
return rm;
}
- (NSString *)pageJavaScriptURL {
- (BOOL) isPopup
{
WOComponent *page;
page = [[self context] page];
return ([page respondsToSelector: @selector(isPopup)]
&& [page isPopup]);
}
- (NSString *) pageJavaScriptURL
{
static NSMutableDictionary *pageToURL = nil;
WOResourceManager *rm;
WOComponent *page;
@ -122,26 +140,64 @@
if ((url = [pageToURL objectForKey:pageName]) != nil)
return [url isNotNull] ? url : nil;
if (pageToURL == nil)
pageToURL = [[NSMutableDictionary alloc] initWithCapacity:32];
rm = [self pageResourceManager];
jsname = [pageName stringByAppendingString:@".js"];
url = [rm urlForResourceNamed:jsname
inFramework:
[[NSBundle bundleForClass:[page class]] bundlePath]
url = [rm urlForResourceNamed: jsname
inFramework: [[NSBundle bundleForClass: [page class]] bundlePath]
languages:nil
request:[[self context] request]];
/* cache */
[pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:pageName];
return url;
}
- (BOOL)hasPageSpecificJavaScript {
return [[self pageJavaScriptURL] length] > 0 ? YES : NO;
- (NSString *) productJavaScriptURL
{
static NSMutableDictionary *pageToURL = nil;
WOResourceManager *rm;
WOComponent *page;
NSString *jsname, *pageName;
NSString *url;
page = [[self context] page];
pageName = NSStringFromClass([page class]);
// TODO: does not seem to work! (gets reset): pageName = [page name];
if ((url = [pageToURL objectForKey:pageName]) != nil)
return [url isNotNull] ? url : nil;
if (pageToURL == nil)
pageToURL = [[NSMutableDictionary alloc] initWithCapacity:32];
rm = [self pageResourceManager];
jsname = [[page frameworkName] stringByAppendingString:@".js"];
url = [rm urlForResourceNamed: jsname
inFramework: [[NSBundle bundleForClass: [page class]] bundlePath]
languages:nil
request:[[self context] request]];
/* cache */
[pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:pageName];
return url;
}
- (BOOL) hasPageSpecificJavaScript
{
return ([[self pageJavaScriptURL] length] > 0);
}
- (BOOL) hasProductSpecificJavaScript
{
return ([[self productJavaScriptURL] length] > 0);
}
@end /* UIxPageFrame */

View File

@ -19,12 +19,16 @@
<link href="mailto:hh@skyrix.com" rev="made"/>
<script rsrc:src="generic.js"> <!-- space required --></script>
<var:if condition="hasProductSpecificJavaScript">
<script var:src="productJavaScriptURL"> <!-- space required --></script>
</var:if>
<var:if condition="hasPageSpecificJavaScript">
<script var:src="pageJavaScriptURL"> <!-- space required --></script>
</var:if>
</head>
<body>
<var:if condition="isPopup" const:negate="YES">
<div class="linkbanner">
<a var:href="relativeHomePath"
><var:string label:value="Home" /></a> |
@ -37,6 +41,7 @@
<a href="http://to.be.done/"
><var:string label:value="Right Administration" /></a>
</div>
</var:if>
<var:component className="UIxToolbar" />