mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-24 07:32:44 +00:00
Monotone-Parent: 27ade59da309caaf33ffd176d44a95672955e9c4
Monotone-Revision: d3b9346b7ff729aa3e123d710cf798285311dc5c Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-02-04T22:22:14 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -28,11 +28,14 @@
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <NGObjWeb/SoSecurityManager.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
|
||||
#import "UIxCalMainView.h"
|
||||
|
||||
#import <Appointments/SOGoAppointmentFolder.h>
|
||||
@@ -42,6 +45,27 @@ static NSMutableArray *yearMenuItems = nil;
|
||||
|
||||
@implementation UIxCalMainView
|
||||
|
||||
- (void) _setupContext
|
||||
{
|
||||
SOGoUser *activeUser;
|
||||
NSString *module;
|
||||
SOGoAppointmentFolders *clientObject;
|
||||
|
||||
activeUser = [context activeUser];
|
||||
clientObject = [self clientObject];
|
||||
|
||||
module = [clientObject nameInContainer];
|
||||
|
||||
ud = [activeUser userSettings];
|
||||
moduleSettings = [ud objectForKey: module];
|
||||
if (!moduleSettings)
|
||||
{
|
||||
moduleSettings = [NSMutableDictionary new];
|
||||
[moduleSettings autorelease];
|
||||
}
|
||||
[ud setObject: moduleSettings forKey: module];
|
||||
}
|
||||
|
||||
- (NSArray *) monthMenuItems
|
||||
{
|
||||
unsigned int count;
|
||||
@@ -100,4 +124,44 @@ static NSMutableArray *yearMenuItems = nil;
|
||||
return yearMenuItem;
|
||||
}
|
||||
|
||||
- (WOResponse *) getDragHandlesStateAction
|
||||
{
|
||||
NSArray *dragHandles;
|
||||
NSString *vertical, *horizontal;
|
||||
|
||||
[self _setupContext];
|
||||
|
||||
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
|
||||
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
|
||||
dragHandles = [[NSArray alloc] initWithObjects:
|
||||
vertical != nil ? vertical : @"",
|
||||
horizontal ? horizontal : @"",
|
||||
nil];
|
||||
|
||||
return [self responseWithStatus: 200
|
||||
andString: [dragHandles jsonRepresentation]];
|
||||
}
|
||||
|
||||
- (WOResponse *) saveDragHandleStateAction
|
||||
{
|
||||
WORequest *request;
|
||||
NSString *dragHandle;
|
||||
|
||||
[self _setupContext];
|
||||
request = [context request];
|
||||
|
||||
if ((dragHandle = [request formValueForKey: @"vertical"]) != nil)
|
||||
[moduleSettings setObject: dragHandle
|
||||
forKey: @"DragHandleVertical"];
|
||||
else if ((dragHandle = [request formValueForKey: @"horizontal"]) != nil)
|
||||
[moduleSettings setObject: dragHandle
|
||||
forKey: @"DragHandleHorizontal"];
|
||||
else
|
||||
return [self responseWithStatus: 400];
|
||||
|
||||
[ud synchronize];
|
||||
|
||||
return [self responseWithStatus: 204];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user