<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created:	11/28/2013	ELL
// Revised: 11/21/2014	ELL
// Off-loaded JavaScript.
// Revised: 21/1/2014	ELL
// Added edit is source view checkbox.
// Revised: 4/28/2016	ELL
// Added ability to use either desktop styles or mobile styles.
// 

	include ("check_session.php");

	$last_border_edited = $_SESSION['last_border_edited'];
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Manage Border Area Select | Breeze Website Builder</title>
<link rel="stylesheet" href="theme/<?php echo $theme; ?>/manager.css" type="text/css">

<script src="js/ajax.js"> </script>
<script type="text/javascript" src="js/manage_border_area_select.js"></script>

<style>
#editor_options_div	{
<?php if (($access_level == "admin") || ($access_level == "power_user"))	{	?>
	display:block;
	position:absolute;
	top:50px;
	left:400px;
<?php	} else	echo "	display:none;\n";	?>
}
</style>
</head>

<body>
 <div id="sub_level_1_buttons">
	 	
            <div class="button_heading_sub_level_1"><div class="button_heading_text_sub_level_1"><?php echo EDIT_BORDER_AREA_SELECT_HEADING; ?></div><div class="button_heading_help" onClick="OpenHelpWindow();">&nbsp;</div></div>
		<?php
			$query = "SELECT page_name FROM " . BWB_TABLE_PREFIX . "page_data_special ORDER BY page_name";
			$result = $bwb_dbh->query($query);
			$num_results = $result->rowCount();
			for ($i = 0; $i < $num_results; $i++)
			{
				$row = $result->fetch(PDO::FETCH_ASSOC);
				$page_name = $row["page_name"];
					
				if ($page_name == $last_border_edited)
					$selected = " down_sub";
				else
					$selected = "";
					
				echo "<div class='button_sub_level_1$selected' onClick=\"window.location='edit_page.php?page_name=$page_name&mode=border&special=1';\"><span class='button_text_sub_level_1'>$page_name</span></div>\n";
			}
		?>

		<div class="button_heading_sub_level_1"><div class="button_heading_text_sub_level_1"><?php echo MANAGE_BORDER_AREA_HEADING; ?></div><div class="button_heading_help" onClick="OpenHelpWindow();">&nbsp;</div></div>
        
        <div class='button_sub_level_1' onClick="window.location='manage_border_area.php';"><span class='button_text_sub_level_1'><?php echo MANAGE_BORDER_AREA_BTN; ?></span></div>
</div>
     
     <div id="editor_options_div">
    <span class="bold"><?php echo EDIT_PAGE_SELECT_OPTIONS_HEADING; ?></span><br /><br />
    <input type="checkbox" id="editor_mode" name="editor_mode" onChange="SetEditorMode('editor_mode');" <?php if (isset($_SESSION['editor_mode']) && ($_SESSION['editor_mode'] == 1)) echo "checked='checked'"; ?> />
    <?php echo EDIT_PAGE_SELECT_SOURCE_VIEW_OPTION; ?><br />
    <input type="checkbox" id="style_mode" name="style_mode" onChange="SetEditorMode('style_mode');" <?php if (isset($_SESSION['style_mode']) && ($_SESSION['style_mode'] == 1)) echo "checked='checked'"; ?> />
    <?php echo EDIT_PAGE_SELECT_MOBILE_STYLE_OPTION; ?><br /><br />
    </div>
</body>
</html>