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

	include ("check_session.php");
	
	$style_sheet = $_REQUEST['style_sheet'];
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Managing Custom Fonts | Breeze Website Builder</title>
<link rel="stylesheet" href="theme/<?php echo $theme; ?>/manager.css" type="text/css">

<style type="text/css">
#manage_custom_fonts_heading	{	width:245px;	}
#help_button	{	
	position:relative;
	display:block;
	top:-15px;
	left:200px;
	height:31px;
	width:31px;
	z-index:100;
}
#custom_fonts_table_div	{	display:table;	}
</style>

<script src="js/browser_detect.js"></script>
<script src="js/mouse_position.js"></script>
<script src="js/popup_msg.js"></script>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/manage_custom_fonts.js"></script>

<script>
<?php
echo "var FONT_WORD = \"" . FONT_WORD . "\";\n";
echo "var SOURCE_WORD = \"" . SOURCE_WORD . "\";\n";
echo "var MANAGE_CUSTOM_FONTS_GET_FONTS_MSG = \"" . MANAGE_CUSTOM_FONTS_GET_FONTS_MSG . "\";\n";
echo "var MANAGE_CUSTOM_FONTS_GET_FONTS_COMPLETE_MSG = \"" . MANAGE_CUSTOM_FONTS_GET_FONTS_COMPLETE_MSG . "\";\n";
echo "var MANAGE_CUSTOM_FONTS_ADDING_FONT_MSG = \"" . MANAGE_CUSTOM_FONTS_ADDING_FONT_MSG . "\";\n";
echo "var MANAGE_CUSTOM_FONTS_ADDING_FONT_COMPLETE_MSG = \"" . MANAGE_CUSTOM_FONTS_ADDING_FONT_COMPLETE_MSG . "\";\n";
echo "var MANAGE_CUSTOM_FONTS_DELETE_FONT_CONFIRM_1_MSG = \"" . MANAGE_CUSTOM_FONTS_DELETE_FONT_CONFIRM_1_MSG . "\";\n";
echo "var MANAGE_CUSTOM_FONTS_DELETE_FONT_CONFIRM_2_MSG = \"" . MANAGE_CUSTOM_FONTS_DELETE_FONT_CONFIRM_2_MSG . "\";\n";
echo "var MANAGE_CUSTOM_FONTS_DELETE_FONT_CONFIRM_3_MSG = \"" . MANAGE_CUSTOM_FONTS_DELETE_FONT_CONFIRM_3_MSG . "\";\n";
echo "var YES_WORD = \"" . YES_WORD . "\";\n";
echo "var NO_WORD = \"" . NO_WORD . "\";\n";
echo "var MANAGE_CUSTOM_FONTS_DELETE_FONT_COMPLETE_MSG = \"" . MANAGE_CUSTOM_FONTS_DELETE_FONT_COMPLETE_MSG . "\";\n";
echo "var MANAGE_CUSTOM_FONTS_NO_FONTS = \"" . MANAGE_CUSTOM_FONTS_NO_FONTS . "\";\n";
?>
</script>
</head>

<body onLoad="GetCustomFonts();">
<table width="85%" border="0"><tr>
<td>
<div class="button_heading_sub_level_1" id="manage_custom_fonts_heading"><div class="button_heading_text_sub_level_1"><?php echo MANAGE_CUSTOM_FONTS_HEADING; ?></div><div class="help_button" id="help_button" onClick="OpenHelpWindow();">&nbsp;</div></div>
</td>
<td align="right">
<div class='button_console_go_back' style="width:210px;" onClick="window.location.href='edit_css.php?style_sheet=<?php echo $style_sheet; ?>'"><span class='button_console_text_w_icon'><?php echo CLASSES_BACK_TO_EDIT_CSS; ?></span></div>
</td>
</tr></table>

<br />
<table class="group_box_table"><tr><td>
<form name="frmAddFont" id="frmAddFont" action="add_custom_font.php" method="post" enctype="multipart/form-data">
<table class="layout_box_table" width="870">
	<tr><td colspan="6" class="title"><?php echo MANAGE_CUSTOM_FONTS_ADD_FONT; ?></td></tr>
	<tr>
    	<td><?php echo FONT_WORD; ?>: </td>
        <td colspan="2"><?php echo SOURCE_WORD; ?>:</td>
        <td><?php echo MANAGE_CUSTOM_FONTS_STRETCH; ?>:</td>
        <td><?php echo MANAGE_CUSTOM_FONTS_STYLE; ?>:</td>
        <td><?php echo MANAGE_CUSTOM_FONTS_WEIGHT; ?>:</td>
	</tr>
    <tr>
        <td><input type="text" name="font" id="font" /></td>
        <td style="max-width: 200px;">
        	<input type="file" name="src_file" id="src_file" />
            <input type="text" name="src_url" id="src_url" style="display:none;" />
        </td>
        <td style="min-width: 120px;">
        	<input type="radio" name="src_type" id="src_type[0]" value="upload" onChange="ChangeSRC(this.value);" checked="checked" /> <?php echo EDIT_FAVICON_UPLOAD_BTN; ?>
            <br />
            <input type="radio" name="src_type" id="src_type[1]" value="url" onChange="ChangeSRC(this.value);" /> <?php echo EDIT_MENU_ITEMS_URL; ?>
        </td>
        <td>
        	<select id="stretch" name="stretch">
            	<option value="normal"><?php echo NORMAL_WORD; ?></option>
                <option value="condensed"><?php echo CONDENSED_WORD; ?></option>
                <option value="ultra-condensed"><?php echo ULTRA_CONDENSED_WORD; ?></option>
                <option value="extra-condensed"><?php echo EXTRA_CONDENSED_WORD; ?></option>
                <option value="semi-condensed"><?php echo SEMI_WORD; ?></option>
                <option value="expanded"><?php echo EXPANDED_WORD; ?></option>
                <option value="semi-expanded"><?php echo SEMI_EXPANDED_WORD; ?></option>
                <option value="extra-expanded"><?php echo EXTRA_EXPANDED_WORD; ?></option>
                <option value="ultra-expanded"><?php echo ULTRA_EXPANDED_WORD; ?></option>
            </select>
        </td>
        <td>
        	<select id="style" name="style">
            	<option value="normal"><?php echo NORMAL_WORD; ?></option>
                <option value="italic"><?php echo ITALIC_WORD; ?></option>
                <option value="oblique"><?php echo OBLIQUE_WORD; ?></option>
            </select>
        </td>
        <td>
        	<select id="weight" name="weight">
	            <option value="normal"><?php echo NORMAL_WORD; ?></option>
                <option value="bold"><?php echo BOLD_WORD; ?></option>
                <option value="100">100</option>
                <option value="200">200</option>
                <option value="300">300</option>
                <option value="400">400</option>
                <option value="500">500</option>
                <option value="600">600</option>
                <option value="700">700</option>
                <option value="800">800</option>
                <option value="900">900</option>
            </select>
        </td>
	</tr>
    <tr>
    	<td colspan="6" align="center">
        	<div class='button_console_add' style="width:110px;" onClick="AddFont();"><span class='button_console_text_w_icon'><?php echo ADD_WORD; ?></span></div>
            <input type="hidden" name="style_sheet" id="style_sheet" value="<?php echo $style_sheet; ?>" />
        </td>
    </tr>
</table>
</form>
</td></tr></table>

<table class="group_box_table"><tr><td>
<table class="layout_box_table" width="870">
	<tr><td colspan="4" class="title"><?php echo MANAGE_CUSTOM_FONTS_DELETE_FONT; ?></td></tr>
	<tr>
    	<td><?php echo FONT_WORD; ?>: </td>
        <td><?php echo SOURCE_WORD; ?>:</td>
        <td><?php echo MANAGE_CUSTOM_FONTS_STRETCH; ?>:</td>
        <td><?php echo MANAGE_CUSTOM_FONTS_STYLE; ?>:</td>
        <td><?php echo MANAGE_CUSTOM_FONTS_WEIGHT; ?>:</td>
	</tr>
    <tr>
        <td id="delete_font_td">&nbsp;</td>
        <td id="delete_src_td">&nbsp;</td>
        <td><div id="stretch_div">&nbsp;</div></td>
        <td><div id="style_div">&nbsp;</div></td>
        <td><div id="weight_div">&nbsp;</div></td>
	</tr>
    <tr>
    	<td colspan="4" align="center">
        	<div class='button_console_delete' style="width:110px;" onClick="DeleteConfirm();"><span class='button_console_text_w_icon'><?php echo EDITOR_DELETE; ?></span></div>
        </td>
    </tr>
</table>
</td></tr></table>

<?php include("lib/popup_msg.html"); ?>

<script language="JavaScript"  type="text/javascript">
	HidePopupMsg();
<?php
	if (isset($_REQUEST['font_added']))
		echo "	CompleteAddFont();\n";
?>
</script>
</body>
</html>