<?

/*
FlexCMS (http://www.flexcms.com)
Flexible, Powerful, Affordable.

Contents of this file are protected by the copyright
notice found at http://www.flexcms.com/flex/pages/copyright.html,
and its usage is subject to the terms of the licensing agreement 
available at http://www.flexcms.com/flex/pages/license.html
*/



	// ========================================================================================
	// Manage Calendar Colors
	// ========================================================================================
	
	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_calendar.gif" width="28" height="18"> '.$MsgText[1][4];
	$BrowserTitle = $MsgText[1][4];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[1][4];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[101] == 'y') {
		
			$query = "select * from `".$Settings['DBPrefix']."cl-Settings`";
			$result = mysql_query($query) or die (mysql_error());
			while ($row = mysql_fetch_array($result)) {
				$clSettings[$row['Name']] = $row['Value'];
			}
			
	
			$OverridesArray = explode('%%',$clSettings['ColorOverrides']);
			/*
			$Colors['CLBorder'] = '#888888';			// main calendar border
			$Colors['CLTitleBG'] = '#272727';			// top title (month and year, next/prev month links) background
			$Colors['CLTitleText'] = '#ffffff';			// top title text
			$Colors['CLDaysBG'] = '#272727';			// day names background
			$Colors['CLDaysText'] = '#ffffff';			// day names text
			$Colors['CLCalDaysBG'] = '#272727';			// grid squares that are a calendar day
			$Colors['CLFillerDaysBG'] = '#141414';		// grid squares that are fillers (not a day)
			$Colors['CLCurrentDayBG'] = '#484848';		// grid square that is today's date
			$Colors['CLDayNumbersText'] = '#ffffff';	// day numbers text
			$Colors['CLEventTitleText'] = '#ffffff';	// event title link text
			$Colors['CLEventDetailsText'] = '#ffffff';	// event details text
			$Colors['CLContentBG'] = '#ffffff';	// content pages bg
			*/
			
				
	
			$PageContents = '<br>'.$MsgText[1][66].'<br><br><form name="PostForm" action="'.$MainURL.'/admin/calendar_colors-save" method="post">
			
			
			<img id="PreviousColorsControlImage" src="'.$ImagesURL.'/admin/spacer.gif" width="1" height="1" alt="" border="0">

<script>
var ColorPickerWindowCode = "";
var ColorDestination = "";

function GetCurrentColor() {
	if (ColorDestination != "") {
		return document.forms["PostForm"].elements[ColorDestination].value.substring(1);
	}
	else {
		return "";
	}
}

function LaunchColorPicker(ColorDest) {
	ColorDestination = ColorDest;
	
	var WindowProperties = "width=420,height=300,left=" + (screen.width-420)/2 + ",top=" + (screen.height-300)/2 + ",location=no,menubar=no,directories=no,toolbar=no,status=no,scrollbars=no,resizable=yes";

	ColorPickerWindowCode = window.open("'.$BaseURL.'/color_picker.html","colorpicker",WindowProperties);
}

function ColorSelected(ColorCode) {
	//alert(ColorCode);
	ColorPickerWindowCode.close();
	
	document.forms["PostForm"].elements[ColorDestination].value = ColorCode;
		
	document.getElementById("PreviousColorsControlImage").src = "'.$BaseURL.'/inc-core-admin-editor-previouscolors.php?"+ColorCode.substring(1)+"/"+(Math.random()*123456);
}

</script>
			
			
			<table border="0" cellpadding="0" cellspacing="0">
    
			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][67].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co1" size="7" value="'.$OverridesArray[1].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co1\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'"></td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][68].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co2" size="7" value="'.$OverridesArray[2].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co2\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][69].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co3" size="7" value="'.$OverridesArray[3].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co3\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'"></td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][70].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co4" size="7" value="'.$OverridesArray[4].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co4\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][71].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co5" size="7" value="'.$OverridesArray[5].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co5\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'"></td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][72].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co6" size="7" value="'.$OverridesArray[6].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co6\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][73].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co7" size="7" value="'.$OverridesArray[7].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co7\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][74].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co8" size="7" value="'.$OverridesArray[8].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co8\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'"></td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][75].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co9" size="7" value="'.$OverridesArray[9].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co9\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][76].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co10" size="7" value="'.$OverridesArray[10].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co10\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][77].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co11" size="7" value="'.$OverridesArray[11].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co11\');"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'"></td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"></td></tr>

			<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[1][78].':</td><td>&nbsp;&nbsp;</td><td><font face="'.$FontFace.'" size="'.$FontSize.'"><input type="text" name="co12" size="7" value="'.$OverridesArray[12].'">&nbsp;<input type="button" value="'.$MsgText[0][556].'" onClick="LaunchColorPicker(\'co12\');"></td></tr>


			<tr><td colspan="3" align="center"><font face="'.$FontFace.'" size="'.$FontSize.'"><br><br>
			<input type="submit" value="'.$MsgText[0][123].'">
			</form></td></tr>

			
			</table>';
			
			
	
	
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}
	

	// ========================================================================================




?>
