2 Copyright (C) 2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
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
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.
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
22 #import <NGObjWeb/SoObject+SoDAV.h>
23 #import <NGObjWeb/WOContext+SoObjects.h>
25 #import <SOGoUI/UIxComponent.h>
27 @interface UIxAppNavView : UIxComponent
35 @implementation UIxAppNavView
39 [lastElement release];
45 - (void)setElement:(id)_element {
46 ASSIGN(element, _element);
52 - (void)setLastElement:(id)_element {
53 ASSIGN(lastElement, _element);
61 - (NSArray *)navPathElements {
62 NSArray *traversalObjects;
63 NSMutableArray *navPathComponents;
64 unsigned int i, count;
66 traversalObjects = [[self context] objectTraversalStack];
67 count = ([traversalObjects count] - 1); /* remove SoPageInvocation */
69 navPathComponents = [[NSMutableArray alloc] initWithCapacity:count];
70 for (i = 0; i < count; i++) {
74 obj = [traversalObjects objectAtIndex:i];
76 name = [obj davDisplayName];
77 if ([name length] == 0)
78 name = NSStringFromClass([obj class]);
79 name = [self labelForKey:name];
81 if (![name hasPrefix:@"sogod"]) {
82 NSMutableDictionary *c;
85 url = [obj baseURLInContext:[self context]];
86 if (![url hasSuffix:@"/"])
87 url = [url stringByAppendingString:@"/"];
89 c = [[NSMutableDictionary alloc] initWithCapacity:2];
90 [c setObject:name forKey:@"name"];
91 [c setObject:url forKey:@"url"];
92 [navPathComponents addObject:c];
97 [self setLastElement:[navPathComponents lastObject]];
98 return [navPathComponents autorelease];
101 @end /* UIxAppNavView */