<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created:	11/28/2013	ELL
// 

	include ("check_session.php");
	
	$last_style_sheet_edited = $_SESSION['last_style_sheet_edited'];
	$last_class_edited = $_SESSION['last_class_edited'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit CSS Select</title>
<link rel="stylesheet" href="manager.css" type="text/css">

<script language="javascript" type="text/javascript">
function OpenHelpWindow()
{
	window.open("http://breezewebsitebuilder.com/docs/cms/help.html#edit_css", "Help", "scrollbars=1,resizable=1,status=0,toolbar=0,menubar=0,location=0,height=700,width=800");
}
</script>
</head>

<body>
<div id="sub_level_1_buttons">
        
          <div class="button_heading_sub_level_1"><div class="button_heading_text_sub_level_1">Edit Styles</div><div class="button_heading_help" onclick="OpenHelpWindow();">&nbsp;</div></div>
		    <?php
			$query = "SELECT * FROM " . BWB_TABLE_PREFIX . "style_sheets ORDER BY sort_order";
			$result = $bwb_dbh->query($query);
			while($row = $result->fetch(PDO::FETCH_ASSOC))
			{
				$name = $row["name"];
				$description = $row["description"];
				if ((strpos($name, "menu", 0) !== false) && (strpos($name, "item", 4) === false))
				{
					$query2 = "SELECT * FROM " . BWB_TABLE_PREFIX . "menus WHERE menu_name = '$name'";
					$result2 = $bwb_dbh->query($query2);
					$row2 = $result2->fetch(PDO::FETCH_ASSOC);
					$description = $row2['description'] . " Styles";
				}
				
				if ($name == $last_style_sheet_edited)
					$selected = " down_sub";
				else
					$selected = "";

				echo "<div class='button_sub_level_1$selected' onClick=\"window.location='edit_css.php?style_sheet=$name&goto_class=$last_class_edited';\"><span class='button_text_sub_level_1'>$description</span></div>\n";
			}
		?>
        	
          <div class='button_sub_level_1' onClick="window.location='edit_custom_css.php';"><span class='button_text_sub_level_1'>Custom Styles</span></div>
          
</div>

</body>
</html>