"Fossies" - the Fresh Open Source Software Archive 
Member "opengroupware-5.5rc3/WebUI/Common/OGoUIElements/SkyCalendarScript.m" (5 Dec 2015, 2331 Bytes) of package /linux/privat/opengroupware-5.5rc3.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Matlab source code syntax highlighting (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "SkyCalendarScript.m" see the
Fossies "Dox" file reference documentation and the latest
Fossies "Diffs" side-by-side code changes report:
5.5rc2_vs_5.5rc3.
1 /*
2 Copyright (C) 2000-2005 SKYRIX Software AG
3
4 This file is part of OpenGroupware.org.
5
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
9 later version.
10
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA.
20 */
21
22 #include <OGoFoundation/OGoComponent.h>
23
24 @interface SkyCalendarScript : OGoComponent
25 {
26 NSString *scriptPath; // > optional: scriptPath, default: skycalendar.js
27 }
28
29 @end /* SkyCalendarScript */
30
31 #include "common.h"
32
33 @implementation SkyCalendarScript
34
35 static NSNumber *yesNum = nil;
36
37 + (void)initialize {
38 if (yesNum == nil) yesNum = [[NSNumber numberWithBool:YES] retain];
39 }
40
41 - (void)dealloc {
42 [self->scriptPath release];
43 [super dealloc];
44 }
45
46 /* accessors */
47
48 - (void)setScriptPath:(NSString *)_path {
49 ASSIGNCOPY(self->scriptPath, _path);
50 }
51 - (NSString *)scriptPath {
52 return self->scriptPath;
53 }
54
55 - (NSString *)scriptURL {
56 WOResourceManager *rm;
57 NSString *url;
58 WOSession *s;
59
60 if ([self->scriptPath length] > 0)
61 return scriptPath;
62
63 s = [self session];
64 rm = [[WOApplication application] resourceManager];
65
66 url = [rm urlForResourceNamed:@"skycalendar.js"
67 inFramework:nil
68 languages:[s languages]
69 request:[[self context] request]];
70
71 if (url == nil) {
72 NSLog(@"WARNING[%s]: could not locate calendar script",
73 __PRETTY_FUNCTION__);
74 url = @"/OpenGroupware.woa/WebServerResources/skycalendar.js";
75 }
76
77 return url;
78 }
79
80 /* generating response */
81
82 - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
83 if ([[_ctx objectForKey:@"SkyCalendarScriptIncluded"] boolValue])
84 return;
85
86 [super appendToResponse:_response inContext:_ctx];
87 [_ctx takeValue:yesNum forKey:@"SkyCalendarScriptIncluded"];
88 }
89
90 @end /* SkyCalendarScript */