<?php
// (1) Required settings
$nName = _("Text + Image");
$nDescription = _("Drop this on a page to add a 2-column Component with an image on the left, and any content you choose on the right.");
$nPageTypeLimit = ""; // Content, Homepage, Search
$nTemplateFile = "textimage.html";

// (2) Custom Functions (all must be prefaced with component name (e.g. function compname_functionname())
if(!function_exists("textimage_getAlignmentDD")){
	function textimage_getAlignmentDD($nFieldID,$nCurrentFieldValue){
		// create dropdown select field
		$nHTML = "";
		$nDDValues = array();
		$nDDValues["display:block;float:none;"] = "Place above text";
		$nDDValues["float:right;margin:0 0 0 20px;"] = "Align to the right";
		$nDDValues["float:left;margin:0 20px 0 0;"] = "Align to the left";
		foreach($nDDValues AS $nFldID => $nFldVal){
			if($nFldID==$nCurrentFieldValue){ $nHTML.="<option value=\"$nFldID\" selected>$nFldVal</option>"; } else { $nHTML.="<option value=\"$nFldID\">$nFldVal</option>"; }
		}
		$nDDHTML = "<select name=\"$nFieldID\" id=\"$nFieldID\">$nHTML</select>";
		return $nDDHTML;
	}
}

// (3) Add the fields that make up your component
// Format: addField(FieldType, Title, Caption, DefaultVal, CustomFunctionManager, CustomFunctionSite)
addField( "text" , _("Text Title") , _("(max. 200 characters)") , "" , "width:524px;" );
addField( "rte" , _("Content") , "" , "" , "width:524px; height:200px;" );
addField( "link-Page" , _("Page Link") , _("When 'more' is clicked on, choose a page to link to.") , "" , "width:300px;" );
addField( "image-Thumb" , _("Thumbnail Image") , "" , "" , "width:300px;" );
addField( "text" , _("Image Alignment") , "" , "float:right;margin:0 0 0 20px;" , "" , "getAlignmentDD" , "" ); // 2
?>