<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created:	11/16/2014	ELL
// Modified: 9/12/2016	ELL
// Added ability to drill down thru file tree.
// 

	include ("check_session.php");
	
	if ($access_level != "admin")
		exit;
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit File Select | Breeze Website Builder</title>
<link rel="stylesheet" href="theme/<?php echo $theme; ?>/manager.css" type="text/css">
<style>
	#show_hidden_div	{
		display:block;
		position:absolute;
		right:50px;
		bottom:10px;
	}
</style>

<script src="js/jquery.min.js"></script>
<script src="js/browser_detect.js"></script>
<script src="js/mouse_position.js"></script>
<script src="js/popup_msg.js"></script>
<script src="js/edit_file_select.js"></script>
<script>
	var theme = "<?php echo $theme; ?>";
<?php
	echo "	var FOLDER_NAME = \"" . FOLDER_NAME . "\";\n";
	echo "	var CANCEL_WORD = \"" . CANCEL_WORD . "\";\n";
	echo "	var OK_WORD = \"" . OK_WORD . "\";\n";
	echo "	var EDITOR_FOLDER_BLANK_ERR = \"" . EDITOR_FOLDER_BLANK_ERR . "\";\n";
	echo "	var EDITOR_FOLDER_ALREADY_EXISTS_1_ERR = \"" . EDITOR_FOLDER_ALREADY_EXISTS_1_ERR . "\";\n";
	echo "	var EDITOR_FOLDER_ALREADY_EXISTS_2_ERR = \"" . EDITOR_FOLDER_ALREADY_EXISTS_2_ERR . "\";\n";
	echo "	var EDITOR_ERROR_CREATING_FOLDER_ERR = \"" . EDITOR_ERROR_CREATING_FOLDER_ERR . "\";\n";
	
	echo "	var BWB_SCRIPTS_DIR = \"" . BWB_SCRIPTS_DIR . "\";\n";
	echo "	var BWB_LIB_DIR = \"" . BWB_LIB_DIR . "\";\n";
	
	echo "	var http = '$http';\n";
?>
</script>
</head>
<?php
if (BWB_BASE_DIR == '')
	$pages_path = "/" . BWB_WEBPAGE_DIR;
else
	$pages_path = "/" . BWB_BASE_DIR . "/" . BWB_WEBPAGE_DIR;

if (BWB_BASE_DIR == '')
	$scripts_path = "/" . BWB_SCRIPTS_DIR;
else
	$scripts_path = $document_root . "/" . BWB_BASE_DIR . "/" . BWB_SCRIPTS_DIR;

if (BWB_BASE_DIR == '')
	$lib_path = "/" . BWB_LIB_DIR;
else
	$lib_path = $document_root . "/" . BWB_BASE_DIR . "/" . BWB_LIB_DIR;
?>
<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_FILE_SELECT_HEADING; ?></div><div class="button_heading_help" onClick="OpenHelpWindow();">&nbsp;</div>
	</div>
	
    <div class='button_sub_level_1' style='width:258px;' onClick="ShowFiles('<?php echo $pages_path; ?>', 'root', this);" id="btn_pages"><span class='button_text_sub_level_1'><?php echo EDIT_FILE_SELECT_PAGE_FILES_BTN; ?></span></div>
    
    <div class='button_sub_level_1' style='width:258px;' onClick="ShowFiles('<?php echo $scripts_path; ?>', 'root', this);" id="btn_scripts"><span class='button_text_sub_level_1'><?php echo EDIT_FILE_SELECT_INCLUDE_SCRIPTS_BTN; ?></span></div>
    
    <div class='button_sub_level_1' style='width:258px;' onClick="ShowFiles('<?php echo $lib_path; ?>', 'root', this);" id="btn_php"><span class='button_text_sub_level_1'><?php echo EDIT_FILE_SELECT_LIB_MODULES_BTN; ?></span></div>
</div>

<div id="sub_level_2_buttons" style="display:none; left:280px;">
	<div class="button_heading_sub_level_1">
		<div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
	</div> 
    <div id="file_list_div">&nbsp;</div>
    
    <div id="sub_level_3_buttons" class="sub_level_3_buttons" style="display:none;">
        <div class="button_heading_sub_level_1">
            <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
        </div> 
        <div id="file_list_div_2">&nbsp;</div>
        
        <div id="sub_level_4_buttons" class="sub_level_3_buttons" style="display:none;">
            <div class="button_heading_sub_level_1">
                <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
            </div> 
            <div id="file_list_div_3">&nbsp;</div>
            
            <div id="sub_level_5_buttons" class="sub_level_3_buttons" style="display:none;">
                <div class="button_heading_sub_level_1">
                    <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
                </div> 
                <div id="file_list_div_4">&nbsp;</div>
                
                <div id="sub_level_6_buttons" class="sub_level_3_buttons" style="display:none;">
                    <div class="button_heading_sub_level_1">
                        <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
                    </div> 
                    <div id="file_list_div_5">&nbsp;</div>
                    
                    <div id="sub_level_7_buttons" class="sub_level_3_buttons" style="display:none;">
                        <div class="button_heading_sub_level_1">
                            <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
                        </div> 
                        <div id="file_list_div_6">&nbsp;</div>
                        
                        <div id="sub_level_8_buttons" class="sub_level_3_buttons" style="display:none;">
                            <div class="button_heading_sub_level_1">
                                <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
                            </div> 
                            <div id="file_list_div_7">&nbsp;</div>
                            
                            <div id="sub_level_9_buttons" class="sub_level_3_buttons" style="display:none;">
                                <div class="button_heading_sub_level_1">
                                    <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
                                </div> 
                                <div id="file_list_div_8">&nbsp;</div>
                                
                                <div id="sub_level_10_buttons" class="sub_level_3_buttons" style="display:none;">
                                    <div class="button_heading_sub_level_1">
                                        <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
                                    </div> 
                                    <div id="file_list_div_9">&nbsp;</div>
                                    
                                    <div id="sub_level_11_buttons" class="sub_level_3_buttons" style="display:none;">
                                        <div class="button_heading_sub_level_1">
                                            <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
                                        </div> 
                                        <div id="file_list_div_10">&nbsp;</div>
                                        
                                        <div id="sub_level_12_buttons" class="sub_level_3_buttons" style="display:none;">
                                            <div class="button_heading_sub_level_1">
                                                <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
                                            </div> 
                                            <div id="file_list_div_11">&nbsp;</div>
                                            
                                            <div id="sub_level_13_buttons" class="sub_level_3_buttons" style="display:none;">
                                                <div class="button_heading_sub_level_1">
                                                    <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
                                                </div> 
                                                <div id="file_list_div_12">&nbsp;</div>
                                                
                                                <div id="sub_level_14_buttons" class="sub_level_3_buttons" style="display:none;">
                                                    <div class="button_heading_sub_level_1">
                                                        <div class="button_heading_text_sub_level_1"><?php echo EDIT_FILE_SELECT_SELECT_FILE; ?></div>
                                                    </div> 
                                                    <div id="file_list_div_13">&nbsp;</div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="show_hidden_div" class="medium_message">
<?php echo SHOW_BACKUP_FILES; ?>: <input type="checkbox" id="show_hidden" class="show_hidden" />
</div>
<?php include("lib/popup_msg.html"); ?>

<script>
	popup_msg.HidePopupMsg();
</script>

</body>
</html>