<?php

class CarouselSlide extends DataObject {
	private static $db = array(
		'Title' => 'Varchar(100)',
		'External' => 'Boolean',
		'ExternalLink' => 'Varchar(200)',
		'SlideSort' => 'Int'
	);

	private static $has_one = array(
		'SlideImage' => 'Image',
		'HolderPage' => 'Page',
		'IntenalLink' => 'SiteTree'
	);

	private static $default_sort = 'SlideSort';	

	public function getCMSFields() {
		$fields = new FieldList();
		$fields->push(new TextField('Title', 'Title'));
		$fields->push(new UploadField('SlideImage', 'SlideImage'));
		$fields->push(new TreeDropdownField("IntenalLinkID", "Choose a page to link to", "SiteTree"));
		$fields->push(new CheckboxField('External', 'Using external link'));
		$fields->push(new TextField('ExternalLink', 'External Link URL'));
		
		return $fields;		
	}
}

<?php

class CarouselSlide extends DataObject {
	private static $db = array(
		'Title' => 'Varchar(100)',
		'External' => 'Boolean',
		'ExternalLink' => 'Varchar(200)',
		'SlideSort' => 'Int'
	);

	private static $has_one = array(
		'SlideImage' => 'Image',
		'HolderPage' => 'Page',
		'IntenalLink' => 'SiteTree'
	);

	private static $default_sort = 'SlideSort';	

	public function getCMSFields() {
		$fields = new FieldList();
		$fields->push(new TextField('Title', 'Title'));
		$fields->push($image = new UploadField('SlideImage', 'SlideImage'));
		$image->setAllowedFileCategories('image');
		$image->setAllowedMaxFileNumber(1);
		$image->setCanAttachExisting(true);
		$image->setFolderName('Carousel');
		
		$fields->push(new TreeDropdownField("IntenalLinkID", "Choose a page to link to", "SiteTree"));
		$fields->push(new CheckboxField('External', 'Using external link'));
		$fields->push(new TextField('ExternalLink', 'External Link URL'));
		
		return $fields;		
	}
}

Add some sensible defaults to slide image upload field
Add some sensible defaults to slide image upload field
