Location: PHPKode > projects > Aratix > aratix/admin/templates/pages_edit.tpl
<div class="heading">Seite editieren</div>
<div class="content">
<form action="index.php" method="post" name="new_page" onSubmit="define_art(); return true;">
	<table class="pages">
		<tr class="pages_header">
			<td class="pages_input_heading">Men&uuml;text</td>
			<td class="pages_input_input"><input type="text" class="pages_heading" name="menutext" value="{$edit_array.menu_text}" /></td>
		</tr>
		<tr class="pages_header">
			<td class="pages_input_heading">&Uuml;berschrift</td>
			<td class="pages_input_input"><input type="text" class="pages_heading" name="heading" value="{$edit_array.head_text}" onchange="nice_text()" onkeydown="nice_text()" onkeyup="nice_text()" onfocus="nice_text()" /></td>
		</tr>
		<tr class="pages_header">
			<td class="pages_input_heading">Nice Text</td>
			<td class="pages_input_input"><input type="text" class="pages_heading" name="nicetext" value="{$edit_array.nice_text}" /></td>
		</tr>
		<tr class="pages_header">
			<td class="pages_input_heading">Vorspann<div class="counter">Noch <input type="text" class="counter" value="" name="counter"/><br />Zeichen &uuml;brig</div></td>
			<td class="pages_input_input"><textarea cols="88" rows="5" class="splash" name="splash" onkeydown="check_chars(this.value)" onkeyup="check_chars(this.value)" onfocus="check_chars(this.value)" onchange="check_chars(this.value)">{$edit_array.splash_text}</textarea></td>
		</tr>
	{if $module_list ne "false"}
		<tr class="pages_header">
			<td class="pages_input_heading">Umschaltung</td>
			<td class="pages_input_input"><input type="button" name="switcher" value="" onclick="switchit()" class="switcher" /></td>
		</tr>
	</table>
	<table class="pages" id="act_module">
		<tr class="pages_header">
			<td class="pages_input_heading">Modulname</td>
			<td class="pages_input_input">
				<select class="module_dropdown" name="module_name">
					{foreach from=$module_list item=module}
						<option value="{$module.name}"{if $edit_array.module_name eq $module.name} selected{/if}>{$module.name} - {$module.description}</option>
					{/foreach}
				</select>
			</td>
		</tr>
	{/if}
	</table>
	<table class="pages" id="act_content">
		<tr class="pages_header">
			<td class="pages_input_heading">Seiteninhalt</td>
			<td class="pages_input_input"><textarea cols="88" rows="15" class="content_area" id="page_area" name="page_area">{$edit_array.content}</textarea></td>
		</tr>
	</table>
	<table class="pages">
		<tr class="pages_header">
			<td class="pages_button" colspan="2"><input type="submit" class="pages_button" value="Absenden" name="submit" /><!--&nbsp;&nbsp;<input type="button" class="pages_button" value="Vorschau" onclick="open_preview()" />--></td>
		</tr>
	</table>
	<input type="hidden" name="session" value="{$session}" />
	<input type="hidden" name="ident" value="{$ident}" />
	<input type="hidden" name="module" value="pages" />
	<input type="hidden" name="action" value="edit" />
	<input type="hidden" name="id" value="{$edit_array.id}" />
	<input type="hidden" name="art" value="" />
</form>
</div>
{literal}
<script type="text/javascript">
	var max_chars = 255; // Maximale Zeichenanzahl (Muss in der Datenbank speicherbar sein, aktuell varchar(255))
	document.new_page.counter.value = max_chars;

	function check_chars(text) {
		var act_chars = text.length;
		var chars_left = max_chars - act_chars;

		if(chars_left < 0)
			document.new_page.splash.value = text.substring(0, max_chars);

		document.new_page.counter.value = chars_left;
	}
	function nice_text(){
		var nicetext = document.new_page.heading.value.toLowerCase();
		var words = nicetext.split(" ");
		var lower_text = "";
		var new_nice_text = "";

		for(var counter = 0; counter < words.length; counter++){
			var old_word = words[counter];

			if(counter == 0)
				lower_text = old_word;
			else
				lower_text = lower_text + "-" + old_word;
		}
		for(var counter = 0; counter < lower_text.length; counter++){
			if(lower_text.substr(counter, 1) == "ä")						// ä ausfiltern und ersetzen
				new_nice_text = new_nice_text + "ae";
			else if(lower_text.substr(counter, 1) == "ü")					// ü ausfiltern und ersetzen
				new_nice_text = new_nice_text + "ue";
			else if(lower_text.substr(counter, 1) == "ö")					// ö ausfiltern und ersetzen
				new_nice_text = new_nice_text + "oe";
			else if(lower_text.substr(counter, 1) == "ß")					// ß ausfiltern und ersetzen
				new_nice_text = new_nice_text + "ss";
			else if(lower_text.substr(counter, 1) == "'")					// ' ausfiltern und ersetzen
				new_nice_text = new_nice_text + "";
			else if(lower_text.substr(counter, 1) == "\"")					// " ausfiltern und ersetzen
				new_nice_text = new_nice_text + "";
			else
				new_nice_text = new_nice_text + lower_text.substr(counter, 1);
		}
		document.new_page.nicetext.value = new_nice_text;
	}
	function switchit(){
		if(act_content == "module"){
			var val = "Umschalten auf Text";
			act_content = "content";
			document.getElementById("act_content").style.display = "none";
			document.getElementById("act_module").style.display = "block";
		}
		else if(act_content == "content"){
			var val = "Umschalten auf Modul";
			act_content = "module";
			document.getElementById("act_content").style.display = "block";
			document.getElementById("act_module").style.display = "none";
		}
		document.new_page.switcher.value = val;
	}
	function open_preview(){
		alert("Vorschau noch nicht verfügbar!");
	}
	function init(){
		check_chars(document.new_page.splash.value);
		act_content = "{/literal}{if $edit_array.module_name ne ""}module{else}content{/if}{literal}";
		switchit();
		nice_text();
	}
	function define_art(){
		if(act_content == "module")
			document.new_page.art.value = "content";
		if(act_content == "content")
			document.new_page.art.value = "module";
	}
</script>
{/literal}








Return current item: Aratix