//
//  CourseDetailsViewController.m
//  mTluPrototype
//
//  Created by Developer on 3/7/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "CourseDetailsViewController.h"


@implementation CourseDetailsViewController

@synthesize courseId;
@synthesize courseTitle;
- (id)init
{
    self = [super init];
    NSLog(@"init");
    if (self) {

    }
    return self;
}

- (void)loadView
{
    // If you create your views manually, you MUST override this method and use it to create your views.
    // If you use Interface Builder to create your views, then you must NOT override this method.
    self.view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)];

}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    UIImageView *courseBackground=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 55)];
    courseBackground.image=[UIImage imageNamed:@"course_title_bg.png"];
    //
    UILabel *idLabel=[[UILabel alloc] initWithFrame:CGRectMake(11,11, 100, 20)];
    idLabel.textColor=[UIColor darkGrayColor];
    idLabel.backgroundColor=[UIColor clearColor];
    idLabel.font=[UIFont boldSystemFontOfSize:17];
    idLabel.text=courseId;
    
    //
    UILabel *titleLabel=[[UILabel alloc] initWithFrame:CGRectMake(11, 31, 300, 20)];
    titleLabel.textColor=[UIColor darkGrayColor];
    titleLabel.backgroundColor=[UIColor clearColor];
    titleLabel.font=[UIFont systemFontOfSize:13];
    titleLabel.text=courseTitle;
    //
    UIWebView *webView=[[UIWebView alloc] initWithFrame:CGRectMake(0,55,320,380)];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"content" ofType:@"html"]isDirectory:NO]]];
    //
    self.title=@"mTLU";
    [self.view addSubview:courseBackground];
    [self.view addSubview:idLabel];
    [self.view addSubview:titleLabel];
    [self.view addSubview:webView];
    
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
