Location: PHPKode > projects > SiteX > admin/themes_scheme_edit.php
<?PHP
ob_start();
session_start();
include("../includes/globals.php.inc");
include("../includes/functions.php");
include("../lang/English.php");
if(strtolower($sxSetup['Language']) != 'english') include("../lang/".$sxSetup['Language'].".php");
include("../themes/$THEME_FOLDER/config.php.inc");

if(!userAdmin())
	loginError($sxLang['LoginRequired']);

if($Submit)
{
	$query = "UPDATE $DB_Themes_Setup 
			  SET name='$new_name', 
			      color_primary='$new_color_primary',
				  color_secondary='$new_color_secondary',
				  color_background='$new_color_background',
				  color_table='$new_color_table',
				  color_table_row='$new_color_table_row',
				  color_text='$new_color_text',
				  color_text_secondary='$new_color_text_secondary',
				  color_text_table='$new_color_text_table',
				  color_links='$new_color_links',
				  color_links_hover='$new_color_links_hover',
				  color_links_visited='$new_color_links_visited',
				  color_sitename='$new_color_sitename',
				  show_sitename='$new_show_sitename'
			  WHERE id='$schemeid'";
	$result = mysql_query($query, $Link) or queryError("38", mysql_error());
	header("Location: themes.php?message=".str_replace(" ","_",$sxLang['MessageThemesSchemeEdited']));
	die();
}

$query = "SELECT * FROM $DB_Themes_Setup WHERE id='$schemeid'";
$result = mysql_query($query, $Link) or queryError("46", mysql_error());
$ROW = mysql_fetch_object($result);

$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>

<!-- Added for color picker -->
<script type="text/javascript" src="../includes/colorpicker/ddcolorposter.js"></script>
<script type="text/javascript" src="../includes/colorpicker/YAHOO.js" ></script>
<script type="text/javascript2" src="../includes/colorpicker/log.js" ></script>
<script type="text/javascript" src="../includes/colorpicker/color.js" ></script>
<script type="text/javascript" src="../includes/colorpicker/event.js" ></script>
<script type="text/javascript" src="../includes/colorpicker/dom.js" ></script>
<script type="text/javascript" src="../includes/colorpicker/animation.js" ></script>
<script type="text/javascript" src="../includes/colorpicker/dragdrop.js" ></script>
<script type="text/javascript" src="../includes/colorpicker/slider.js" ></script>
<script type="text/javascript">

	var hue;
	var picker;
	//var gLogger;
	var dd1, dd2;
	var r, g, b;

	function init() {
		if (typeof(ygLogger) != "undefined")
			ygLogger.init(document.getElementById("logDiv"));
		pickerInit();
		ddcolorposter.fillcolorbox("colorfield1", "colorbox1") //PREFILL "colorbox1" with hex value from "colorfield1"
		ddcolorposter.fillcolorbox("colorfield2", "colorbox2") 
		ddcolorposter.fillcolorbox("colorfield3", "colorbox3") 
		ddcolorposter.fillcolorbox("colorfield4", "colorbox4") 
		ddcolorposter.fillcolorbox("colorfield5", "colorbox5") 
		ddcolorposter.fillcolorbox("colorfield6", "colorbox6") 
		ddcolorposter.fillcolorbox("colorfield7", "colorbox7") 
		ddcolorposter.fillcolorbox("colorfield8", "colorbox8") 
		ddcolorposter.fillcolorbox("colorfield9", "colorbox9")
		ddcolorposter.fillcolorbox("colorfield10", "colorbox10")
		ddcolorposter.fillcolorbox("colorfield11", "colorbox11")
		ddcolorposter.fillcolorbox("colorfield12", "colorbox12")
    }

    // Picker ---------------------------------------------------------

    function pickerInit() {
		hue = YAHOO.widget.Slider.getVertSlider("hueBg", "hueThumb", 0, 180);
		hue.onChange = function(newVal) { hueUpdate(newVal); };

		picker = YAHOO.widget.Slider.getSliderRegion("pickerDiv", "selector",
				0, 180, 0, 180);
		picker.onChange = function(newX, newY) { pickerUpdate(newX, newY); };

		hueUpdate();

		dd1 = new YAHOO.util.DD("pickerPanel");
		dd1.setHandleElId("pickerHandle");
		dd1.endDrag = function(e) {
			// picker.thumb.resetConstraints();
			// hue.thumb.resetConstraints();
        };
	}

	executeonload(init);

	function pickerUpdate(newX, newY) {
		pickerSwatchUpdate();
	}


	function hueUpdate(newVal) {

		var h = (180 - hue.getValue()) / 180;
		if (h == 1) { h = 0; }

		var a = YAHOO.util.Color.hsv2rgb( h, 1, 1);

		document.getElementById("pickerDiv").style.backgroundColor =
			"rgb(" + a[0] + ", " + a[1] + ", " + a[2] + ")";

		pickerSwatchUpdate();
	}

	function pickerSwatchUpdate() {
		var h = (180 - hue.getValue());
		if (h == 180) { h = 0; }
		document.getElementById("pickerhval").value = (h*2);

		h = h / 180;

		var s = picker.getXValue() / 180;
		document.getElementById("pickersval").value = Math.round(s * 100);

		var v = (180 - picker.getYValue()) / 180;
		document.getElementById("pickervval").value = Math.round(v * 100);

		var a = YAHOO.util.Color.hsv2rgb( h, s, v );

		document.getElementById("pickerSwatch").style.backgroundColor =
			"rgb(" + a[0] + ", " + a[1] + ", " + a[2] + ")";

		document.getElementById("pickerrval").value = a[0];
		document.getElementById("pickergval").value = a[1];
		document.getElementById("pickerbval").value = a[2];
		var hexvalue = document.getElementById("pickerhexval").value =
			YAHOO.util.Color.rgb2hex(a[0], a[1], a[2]);
			ddcolorposter.initialize(a[0], a[1], a[2], "#"+hexvalue)
	}

</script>

<!--[if gte IE 5.5000]>
<script type="text/javascript">

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }

YAHOO.util.Event.addListener(window, "load", correctPNG);

</script>
<![endif]-->

<div class="bodyWrapper">
   <h1 class="sxAdminHeading"><?PHP echo $sxLang['ThemesHeadingSchemeEdit']; ?></h1>
   <div class="sxAdminBreadcrumbs"><?PHP if(userAdmin()) { ?><a href="index.php"><?PHP echo $sxLang['AdminBreadcrumb']; ?><?PHP }?><?PHP if(userEditor()) { ?><a href="editor_index.php"><?PHP echo $sxLang['EditorBreadcrumb']; ?><?PHP }?></a> > <a href="themes.php"><?PHP echo $sxLang['ThemesHeadingSiteDesign']; ?></a> > <?PHP echo $sxLang['ThemesHeadingSchemeEdit']; ?></div>   
   <?PHP echoMessage($message); ?>   
		<div id="pickerPanel" class="dragPanel">
		
          <h4 id="pickerHandle">&nbsp;</h4>
		  
			<div id="pickerDiv">
			
			 <img id="pickerbg" src="<?PHP echo $sxSetup['Url'] ?>/images/pickerbg.png" alt="">
			 <div id="selector"><img src="<?PHP echo $sxSetup['Url'] ?>/images/select.gif">
			 </div>
			</div>

			<div id="hueBg">
			 <div id="hueThumb"><img src="<?PHP echo $sxSetup['Url'] ?>/images/hline.png">
			 </div>
			</div>

			<div id="pickervaldiv">
			    <form name="pickerform" onsubmit="return pickerUpdate()">
			    <br />
			    R <input class="input" name="pickerrval" id="pickerrval" type="text" value="0" size="3" maxlength="3" />
			    H <input class="input" name="pickerhval" id="pickerhval" type="text" value="0" size="3" maxlength="3" />
			    <br />
			    G <input class="input" name="pickergval" id="pickergval" type="text" value="0" size="3" maxlength="3" />
			    S <input class="input" name="pickergsal" id="pickersval" type="text" value="0" size="3" maxlength="3" />
			    <br />
			    B <input class="input" name="pickerbval" id="pickerbval" type="text" value="0" size="3" maxlength="3" />
			    V <input class="input" name="pickervval" id="pickervval" type="text" value="0" size="3" maxlength="3" />
			    <br />
			    <br />
			     <input class="input" name="pickerhexval" id="pickerhexval" type="text" value="0" size="8" maxlength="7" />
			    <br />
			
			    </form>
			</div>
			<div id="pickerSwatch">&nbsp;
			</div>
			<div id="pickerhelptext">
			<?PHP echo $sxLang['ThemesInfoSchemeColorpicker']; ?>
			</div>
		</div>   
<table border="0" cellspacing="3" cellpadding="5">
<form name="sxFileSchemeEdit" action="<?PHP print $PHP_SELF; ?>" method="post" enctype="multipart/form-data">
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeName']; ?></td>
  <td ><input name="new_name" type="text" id="new_name" value="<?PHP echo htmlspecialchars($ROW->name); ?>" /></td>

 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorPrimary']; ?></td>
  <td><input id="colorfield1" onFocus="ddcolorposter.echocolor(this, 'colorbox1')" name="new_color_primary" type="text" value="<?PHP echo $ROW->color_primary; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox1" class="colorbox" style="background: <?PHP echo $ROW->color_primary; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
  </td>
</tr>
<tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorSecondary']; ?></td>
  <td><input id="colorfield2" onFocus="ddcolorposter.echocolor(this, 'colorbox2')" name="new_color_secondary" type="text" value="<?PHP echo $ROW->color_secondary; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox2" class="colorbox" style="background: <?PHP echo $ROW->color_secondary; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorBackground']; ?></td>
  <td><input id="colorfield3" onFocus="ddcolorposter.echocolor(this, 'colorbox3')" name="new_color_background" type="text" value="<?PHP echo $ROW->color_background; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox3" class="colorbox" style="background: <?PHP echo $ROW->color_background; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorTableTitle']; ?></td>
  <td><input id="colorfield4" onFocus="ddcolorposter.echocolor(this, 'colorbox4')" name="new_color_table" type="text" value="<?PHP echo $ROW->color_table; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox4" class="colorbox" style="background: <?PHP echo $ROW->color_table; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorTableItem']; ?></td>
  <td><input id="colorfield5" onFocus="ddcolorposter.echocolor(this, 'colorbox5')" name="new_color_table_row" type="text" value="<?PHP echo $ROW->color_table_row; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox5" class="colorbox" style="background: <?PHP echo $ROW->color_table_row; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> </td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorText']; ?></td>
  <td><input id="colorfield6" onFocus="ddcolorposter.echocolor(this, 'colorbox6')" name="new_color_text" type="text" value="<?PHP echo $ROW->color_text; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox6" class="colorbox" style="background: <?PHP echo $ROW->color_text; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> </td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorTextSecondary']; ?></td>
  <td><input id="colorfield7" onFocus="ddcolorposter.echocolor(this, 'colorbox7')" name="new_color_text_secondary" type="text" value="<?PHP echo $ROW->color_text_secondary; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox7" class="colorbox" style="background: <?PHP echo $ROW->color_text_secondary; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> </td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorTableText']; ?></td>
  <td><input id="colorfield8" onFocus="ddcolorposter.echocolor(this, 'colorbox8')" name="new_color_text_table" type="text" value="<?PHP echo $ROW->color_text_table; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox8" class="colorbox" style="background: <?PHP echo $ROW->color_text_table; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> </td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorLink']; ?></td>
  <td><input id="colorfield9" onFocus="ddcolorposter.echocolor(this, 'colorbox9')" name="new_color_links" type="text" value="<?PHP echo $ROW->color_links; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox9" class="colorbox" style="background: <?PHP echo $ROW->color_links; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> </td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorLinkVisited']; ?></td>
  <td><input id="colorfield10" onFocus="ddcolorposter.echocolor(this, 'colorbox10')" name="new_color_links_visited" type="text" value="<?PHP echo $ROW->color_links_visited; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox10" class="colorbox" style="background: <?PHP echo $ROW->color_links_visited; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> </td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorLinkHover']; ?></td>
  <td><input id="colorfield11" onFocus="ddcolorposter.echocolor(this, 'colorbox11')" name="new_color_links_hover" type="text" value="<?PHP echo $ROW->color_links_hover; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox11" class="colorbox" style="background: <?PHP echo $ROW->color_links_hover; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> </td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeColorSitename']; ?></td>
  <td><input id="colorfield12" onFocus="ddcolorposter.echocolor(this, 'colorbox12')" name="new_color_sitename" type="text" value="<?PHP echo $ROW->color_sitename; ?>" size="9" maxlength="7" />&nbsp;<span id="colorbox12" class="colorbox" style="background: <?PHP echo $ROW->color_sitename; ?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> </td>
 </tr>
 <tr> 
  <td class="sxTdItem"><?PHP echo $sxLang['ThemesItemSchemeShowSitename']; ?></td>
  <td ><input type="checkbox" name="new_show_sitename" value="1"<?PHP if($ROW->show_sitename == 1) echo ' checked'; ?> /></td>
 </tr>
 <tr> 
  <td valign="top">&nbsp;</td>
  <td valign="top">
	<input type="hidden" name="schemeid" value="<?PHP echo $schemeid; ?>" />	
	<input type="submit" name="Submit" value="<?PHP echo $sxLang['ThemesButtonSchemeEdit']; ?>" class="sxButton" /></td>
 </tr>
</form>
</table>
</div>


	
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX