<!-- MODULE: source-code -->

<?php quick_help(txt('source-code', 'quick-help: source-code')); ?>

<?php if(!defined('master_script')) die();

/**
 * Default settings
 *
 * @category   Module (source-code)
 * @author     Nico Wenig <nico.wenig@yellowgreen.de>
 * @version	   2009-04-21
 */

	if(!isset($module_settings['source-code']['content'])) $module_settings['source-code']['content'] = '';
	
?>

<form accept-charset="utf-8" method="post" action="index.php?backend=edit-content&amp;page=<?php echo $_GET['page']; ?>&amp;module-to-edit=<?php echo $_GET['module-to-edit']; ?>&amp;module-position=<?php echo $_GET['module-position']; ?>" onsubmit="return this.confirm">
	<?php include($system_data['folder']['modules'] . 'module-properties/backend-template.tpl'); ?>
	
	<?php connector('source-code backend before'); ?>
	
	<h4><?php echo txt('source-code', 'title: source-code'); ?></h4>
	
	<p><textarea name="codefield" id="codefield" cols="50" rows="10"><?php echo strip_custom_tags(stripslashes($module_settings["source-code"]["content"]), true, false, true, false, false); ?></textarea></p>
	
	<?php connector('source-code backend after'); ?>
	
	<!-- Save -->
	<input name="save_source_code" type="hidden">
	<input id="save" name="save_content" type="submit" value="<?php echo txt('source-code', 'Speichern'); ?>">
	<input id="delete" name="delete_content" type="submit" value="<?php echo txt('source-code', 'Löschen'); ?>" onclick="this.form.confirm = window.confirm('<?php echo txt('source-code', 'Soll das Inhaltselement wirklich gelöscht werden?'); ?>')">
</form>

<script type="text/javascript">
	var path = '<?php echo $system_data['folder']['plugins']; ?>code-mirror/';
	
	// Init Code Editor
	var editor = CodeMirror.fromTextArea('codefield', {
		height: "405px",
		continuousScanning: 500,
		lineNumbers: true,
		textWrapping: false,
		path: path + "js/",
		parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"],
		stylesheet: [path + "css/xmlcolors.css", path + "css/jscolors.css", path + "css/csscolors.css"]
	});
</script>