<?php
// -----------------------------------------------------------------------
// This file is part of AROUNDMe
//
// Copyright (C) 2003 - 2007 Barnraiser
// http://www.barnraiser.org/
// info@barnraiser.org
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with program; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
// 02110-1301, USA.
// -----------------------------------------------------------------------

?>

<script language="JavaScript" src="<?php echo $template_path_core;?>js/html_gui_editor.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
	var iconHelpBold = "<?php echo $lang['help_prompt_click']['bold'];?>";
	var iconHelpBoldRollOver = "<?php echo $lang['help_prompt_rollover']['bold'];?>";
	
	var iconHelpParagraph = "<?php echo $lang['help_prompt_click']['paragraph'];?>";
	var iconHelpParagraphRollOver = "<?php echo $lang['help_prompt_rollover']['paragraph'];?>";
	
	var iconHelpBreak = "<?php echo $lang['help_prompt_click']['break'];?>";
	var iconHelpBreakRollOver = "<?php echo $lang['help_prompt_rollover']['break'];?>";
	
	var iconHelpTable = "<?php echo $lang['help_prompt_click']['table'];?>";
	var iconHelpTableRollOver = "<?php echo $lang['help_prompt_rollover']['table'];?>";
	
	var iconHelpHeader = "<?php echo $lang['help_prompt_click']['header'];?>";
	var iconHelpHeaderRollOver = "<?php echo $lang['help_prompt_rollover']['header'];?>";
	
	var iconHelpAnchor = "<?php echo $lang['help_prompt_click']['anchor'];?>";
	var iconHelpAnchorRollOver = "<?php echo $lang['help_prompt_rollover']['anchor'];?>";
	
	var iconHelpItalic = "<?php echo $lang['help_prompt_click']['italic'];?>";
	var iconHelpItalicRollOver = "<?php echo $lang['help_prompt_rollover']['italic'];?>";
	
	var iconHelpHorizontalRule = "<?php echo $lang['help_prompt_click']['horizontalrule'];?>";
	var iconHelpHorizontalRuleRollOver = "<?php echo $lang['help_prompt_rollover']['horizontalrule'];?>";
	
	var iconHelpOrderedList = "<?php echo $lang['help_prompt_click']['orderedlist'];?>";
	var iconHelpOrderedListRollOver = "<?php echo $lang['help_prompt_rollover']['orderedlist'];?>";
	
	var iconHelpUnorderedList = "<?php echo $lang['help_prompt_click']['unorderedlist'];?>";
	var iconHelpUnorderedListRollOver = "<?php echo $lang['help_prompt_rollover']['unorderedlist'];?>";
	
	var iconHelpCode = "<?php echo $lang['help_prompt_click']['code'];?>";
	var iconHelpCodeRollOver = "<?php echo $lang['help_prompt_rollover']['code'];?>";
	
	var iconHelpImage = "<?php echo $lang['help_prompt_click']['image'];?>";
	var iconHelpImageRollOver = "<?php echo $lang['help_prompt_rollover']['image'];?>";
	
	var iconHelpFile = "<?php echo $lang['help_prompt_click']['file'];?>";
	var iconHelpFileRollOver = "<?php echo $lang['help_prompt_rollover']['file'];?>";
	
	var iconHelpWikiPage = "<?php echo $lang['help_prompt_click']['wikipage'];?>";
	var iconHelpWikiPageRollOver = "<?php echo $lang['help_prompt_rollover']['wikipage'];?>";

	var template_path_core = '<?php echo $template_path_core;?>';
</script>


<table cellspacing="1" cellpadding="1" border="0" width="100%">
	<tr>
		<td width="80%">
			<br />
		</td>
		<td valign="top" align="right" nowrap="nowrap">
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '\n<p>\n', '\n</p>');" onMouseOver="AMEditorHelp(iconHelpParagraphRollOver,1);" onClick="AMEditorHelp(iconHelpParagraph,1);"><img src="<?php echo $template_path_core;?>img/am_editor_p.png" width="16" height="14" alt="p" border="0" /></a>
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '<b>', '</b>');" onMouseOver="AMEditorHelp(iconHelpBoldRollOver,1);" onClick="AMEditorHelp(iconHelpBold,1);"><img src="<?php echo $template_path_core;?>img/am_editor_b.png" width="16" height="14" alt="b" border="0" /></a>
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '<i>', '</i>');" onMouseOver="AMEditorHelp(iconHelpItalicRollOver,1);" onClick="AMEditorHelp(iconHelpItalic,1);"><img src="<?php echo $template_path_core;?>img/am_editor_i.png" width="16" height="14" alt="i" border="0" /></a>
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '<br />\n', '');" onMouseOver="AMEditorHelp(iconHelpBreakRollOver,1);" onClick="AMEditorHelp(iconHelpBreak,1);"><img src="<?php echo $template_path_core;?>img/am_editor_br.png" width="16" height="14" alt="br" border="0" /></a>
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '\n<h3>', '</h3>');" onMouseOver="AMEditorHelp(iconHelpHeaderRollOver,1);" onClick="AMEditorHelp(iconHelpHeader,1);"><img src="<?php echo $template_path_core;?>img/am_editor_h.png" width="16" height="14" alt="h" border="0" /></a>
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '<a href=&quot;http://www.barnraiser.org/&quot;>link title', '</a>');" onMouseOver="AMEditorHelp(iconHelpAnchorRollOver,1);" onClick="AMEditorHelp(iconHelpAnchor,1);"><img src="<?php echo $template_path_core;?>img/am_editor_a.png" width="17" height="14" alt="a" border="0" /></a>
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '\n<hr />\n', '');" onMouseOver="AMEditorHelp(iconHelpHorizontalRuleRollOver,1);" onClick="AMEditorHelp(iconHelpHorizontalRule,1);"><img src="<?php echo $template_path_core;?>img/am_editor_hr.png" width="16" height="14" alt="hr" border="0" /></a>
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '\n<table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;>\n<tr>\n<td>example entry</td>\n<td>example entry</td>\n</tr>\n</table>', '');" onMouseOver="AMEditorHelp(iconHelpTableRollOver,1);" onClick="AMEditorHelp(iconHelpTable,1);"><img src="<?php echo $template_path_core;?>img/am_editor_table.png" width="16" height="14" alt="table" border="0" /></a>
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '\n<ol>\n<li>list item 1</li>\n<li>list item 2</li>\n</ol>\n', '');" onMouseOver="AMEditorHelp(iconHelpOrderedListRollOver,1);" onClick="AMEditorHelp(iconHelpOrderedList,1);"><img src="<?php echo $template_path_core;?>img/am_editor_ol.png" width="16" height="14" alt="ol" border="0" /></a>
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '\n<ul>\n<li>list item 1</li>\n<li>list item 2</li>\n</ul>\n', '');" onMouseOver="AMEditorHelp(iconHelpUnorderedListRollOver,1);" onClick="AMEditorHelp(iconHelpUnorderedList,1);"><img src="<?php echo $template_path_core;?>img/am_editor_ul.png" width="16" height="14" alt="ul" border="0" /></a>
			<a href="javascript:insertTag('<?php echo $gui_expert_editor;?>', '\n<pre>\n<code>\n//&nbsp;&nbsp;code example', '\n</code>\n</pre>\n');" onMouseOver="AMEditorHelp(iconHelpCodeRollOver,1);" onClick="AMEditorHelp(iconHelpCode,1);"><img src="<?php echo $template_path_core;?>img/am_editor_code.png" width="16" height="14" alt="code" border="0" /></a>
			<br />
		</td>
		<?php
		if (isset($images)) {
		
		if (!isset($module_id)) {
			$module_id = 0;
		}
		?>
		<td valign="top" align="right">
			<select class="gui_select" style="margin:0px; border-color:#7f7f7f;height:12px; padding:0px;" onMouseOver="AMEditorHelp(iconHelpImageRollOver,1);" onChange="AMEditorHelp(iconHelpImage,1); javascript:if(this.value!= '') {insertTag('<?php echo $gui_expert_editor;?>', '<img src=&quot;get_file.php?file='+this.value+'&quot alt=&quot', '&quot; />')};">
			<option value=""><?php echo $lang['txt_images'];?></option>
			<?php
			foreach ($images as $key => $i):
			?>
			<option value="<?php echo $module_id . "-" . $i['file_md5_name'];?>"><?php echo $i['file_save_name'];?></option>	
			<?php
			endforeach;
			?>
		</td>
		<?php }?>
		
		<?php
		if (isset($files)) {
		
		if (!isset($module_id)) {
			$module_id = 0;
		}
		?>
		<td valign="top" align="right">
			<select class="gui_select" style="margin:0px; border-color:#7f7f7f;height:12px; padding:0px;" onMouseOver="AMEditorHelp(iconHelpFileRollOver,1);" onChange="AMEditorHelp(iconHelpFile,1); javascript:if(this.value!= '') {insertTag('<?php echo $gui_expert_editor;?>', '<a href=&quot;get_file.php?file='+this.value+'&quot alt=&quot&quot;>', 'file link</a>')};">
			<option value=""><?php echo $lang['txt_files'];?></option>
			<?php
			foreach ($files as $key => $i):
			?>
			<option value="<?php echo $module_id . "-" . $i['file_md5_name'] . "--" . $i['file_type'];?>"><?php echo $i['file_save_name'];?></option>	
			<?php
			endforeach;
			?>
		</td>
		<?php }?>
		
		<?php
		if (isset($pages)) {
		?>
		<td valign="top" align="right">
			<select class="gui_select" style="margin:0px; border-color:#7f7f7f;height:12px; padding:0px;" onMouseOver="AMEditorHelp(iconHelpWikiPageRollOver,1);" onChange="AMEditorHelp(iconHelpWikiPage,1); javascript:if(this.value!= '') {insertTag('<?php echo $gui_expert_editor;?>', '<interlink name=&quot'+this.value+'&quot>', this.value+'</interlink>')};">
			<option value=""><?php echo $lang['txt_wiki_pages'];?></option>
			<?php
			foreach ($pages as $key => $i):
			?>
			<option value="<?php echo $i['page_name'];?>"><?php echo $i['page_name'];?></option>
			<?php
			endforeach;
			?>
		</td>
		<?php }?>
		
		<?php
		if (isset($custom_stylesheet_elements)) {
		?>
		<td valign="top" align="right">
			<select accesskey="c" name="classes" class="gui_select" onChange="javascript:insertTags('clss', '<?php echo $txtarea;?>', this.value);">
				<option value="0"><?php echo $lang['txt_css_styles'];?></option>
				<?php
				foreach ($custom_stylesheet_elements as $key => $i):
				?>
				<option value="<?php echo $i['name'];?>"><?php echo $i['title'];?></option>
				<?php
				endforeach;
				?>
			</select><br />
		</td>
		<?php }?>
		<td>
			<a href="#" onClick="javascript:launchPopupWindow('components/core/help.php?help=core_html_editor');" style="cursor:help;"><img src="<?php echo $template_path_core;?>img/help.png" alt="<?php echo $lang['alt_help'];?>" border="0" /></a><br />
			<br />
		</td>
	</tr>
</table>