<!-- MODULE: list-news -->

<?php quick_help(txt('list-news', 'quick-help: list-news')); ?>

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

/**
 * Backend template
 *
 * @category   Module (list-news)
 * @author     Nico Wenig <nico.wenig@yellowgreen.de>
 * @version	   2009-06-26
 */

	if(!isset($module_settings["list-news"]["mode"])) $module_settings["list-news"]["mode"] = 'latest';
	if(!isset($module_settings["list-news"]["archive page"])) $module_settings["list-news"]["archive page"] = $page_info->alias;
	if(!isset($module_settings["list-news"]["latest"])) $module_settings["list-news"]["latest"] = 10;
	if(!isset($module_settings["list-news"]["pages"])) $module_settings["list-news"]["pages"] = 10;
	if(!isset($module_settings["list-news"]["show author"])) $module_settings["list-news"]["show author"] = 1;
	if(!isset($module_settings["list-news"]["show date"])) $module_settings["list-news"]["show date"] = 1;
	if(!isset($module_settings["list-news"]["show teaser"])) $module_settings["list-news"]["show teaser"] = 0;
	
?>

<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'); ?>
	
	<!-- Settings -->
	<h4><?php echo txt('list-news', 'title: list-news'); ?></h4>
	
	<div class="column">
		<p>
			<label for="list-news-mode"><?php echo txt('list-news', 'Anzeigeart'); ?>:</label>
			<select name="mode" id="list-news-mode" size="1" onchange="toggleModeContainer(this.options[this.selectedIndex].value)">
				<option value="latest" <?php if($module_settings["list-news"]["mode"] == 'latest') echo 'selected="selected"'; ?>><?php echo txt('list-news', 'Liste der neuesten Nachrichten'); ?></option>
				<option value="topics" <?php if($module_settings["list-news"]["mode"] == 'topics') echo 'selected="selected"'; ?>><?php echo txt('list-news', 'Liste der verfügbaren Themen'); ?></option>
				<option value="archive" <?php if($module_settings["list-news"]["mode"] == 'archive') echo 'selected="selected"'; ?>><?php echo txt('list-news', 'Archivliste nach Jahren und Monaten'); ?></option>
				<option value="pages" <?php if($module_settings["list-news"]["mode"] == 'pages') echo 'selected="selected"'; ?>><?php echo txt('list-news', 'Nachrichtenseiten anzeigen'); ?></option>
			</select>
		</p>
		
		<hr>
		
		<div id="container-archive" style="display: none">
			<p>
				<label for="archive-page"><?php echo txt('list-news', 'Archivseite'); ?>:</label>
				<input type="text" name="archive-page" id="archive-page" value="<?php echo $module_settings["list-news"]["archive page"]; ?>">
			</p>
		</div>

		<div id="container-topics" style="display: none">
			<p>
				<label for="archive-page"><?php echo txt('list-news', 'Archivseite'); ?>:</label>
				<input type="text" name="archive-page" id="archive-page" value="<?php echo $module_settings["list-news"]["archive page"]; ?>">
			</p>
		</div>
		
		<div id="container-latest" style="display: none">
			<p>
				<input type="text" name="latest" id="latest" class="number" value="<?php echo clean_output($module_settings["list-news"]["latest"]); ?>"> 
				<label class="checkbox" for="latest"> <?php echo txt('list-news', 'Nachrichten anzeigen'); ?></label>
			</p>
		</div>

		<div id="container-pages" style="display: none">
			<p>
				<input type="text" name="pages-number" id="pages-number" class="number" value="<?php echo clean_output($module_settings["list-news"]["pages"]); ?>"> 
				<label class="checkbox" for="pages-number"> <?php echo txt('list-news', 'Nachrichten anzeigen'); ?></label>
			</p>
			
			<hr>

			<p>
				<input type="checkbox" name="show-teaser" id="show-teaser" <?php if($module_settings["list-news"]["show teaser"] == 1) echo 'checked="checked"'; ?>> 
				<label class="checkbox" for="show-teaser"> <?php echo txt('list-news', 'Vorschautext anzeigen'); ?></label>
			</p>

			<p>
				<input type="checkbox" name="show-date" id="show-date" <?php if($module_settings["list-news"]["show date"] == 1) echo 'checked="checked"'; ?>> 
				<label class="checkbox" for="show-date"> <?php echo txt('list-news', 'Datum anzeigen'); ?></label>
			</p>

			<p>
				<input type="checkbox" name="show-author" id="show-author" <?php if($module_settings["list-news"]["show author"] == 1) echo 'checked="checked"'; ?>> 
				<label class="checkbox" for="show-author"> <?php echo txt('list-news', 'Autor anzeigen'); ?></label>
			</p>
		</div>

		<?php connector('list-news left'); ?>
    </div>
		
	<div class="column last-column">

	    <?php connector('list-news right'); ?>
    </div>

	<script type="text/javascript">
		var modeContainers = ['archive', 'latest', 'pages', 'topics'];
		
		// Toggle mode container
		var toggleModeContainer = function(modeContainer) {
			for(var i = 0; i < modeContainers.length; i++) {
				document.getElementById('container-' + modeContainers[i]).style.display = (modeContainers[i] == modeContainer) ? 'block' : 'none';
			}
		};
		
		toggleModeContainer('<?php echo $module_settings["list-news"]["mode"]; ?>');
	</script>

    <!-- Save -->
	<input name="save_list_news" type="hidden">
	<input id="save" name="save_content" type="submit" value="<?php echo txt('list-news', 'Speichern'); ?>">
	<input id="delete" name="delete_content" type="submit" value="<?php echo txt('list-news', 'Löschen'); ?>" onclick="this.form.confirm = window.confirm('<?php echo txt('list-news', 'Soll das Inhaltselement wirklich gelöscht werden?'); ?>')">
</form>