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

/**
 * Backend template
 *
 * @category   Extension (settings)
 * @author     Nico Wenig <nico.wenig@yellowgreen.de>
 * @version	   2010-05-19
 */
 
?>

<?php if($_SESSION['user'] == sha1($administrator_name)) { ?>
	<form id="settings" action="index.php?backend=settings&amp;area=system" method="post" accept-charset="utf-8" enctype="multipart/form-data">
		<div class="column">
			<!-- System -->
			<h4><?php echo txt('settings', 'System'); ?></h4>
			
			<p>
				<label for="backend_language"><?php echo txt('settings', 'Sprache'); ?>:</label> 
			    <select id="backend_language" name="backend_language" size="1">
			    	<?php foreach($system_data['backend']['languages'] as $name => $value) { ?>
			    		<option value="<?php echo $name; ?>" <?php echo ($user_data['backend language'] == $name ? 'selected="selected"' : ''); ?> ><?php echo $value; ?> (<?php echo $name; ?>)</option>
			    	<?php } ?>
			    </select>
		    </p>
			
			<p>
				<input type="checkbox" name="quick_help" id="quick_help" <?php echo ($user_data['quick help'] == 1 ? 'checked="checked"' : ''); ?>>
		    	<label class="checkbox" for="quick_help"><?php echo txt('settings', 'Erklärungen einblenden'); ?></label>
		    </p>

			<p>
				<label for="content_preview"><?php echo txt('settings', 'Inhaltsvorschau'); ?>:</label> 
			    <select id="content_preview" name="content_preview" size="1">
			    	<option value="full" <?php if($user_data['content preview'] == 'full') echo 'selected="selected"'; ?> ><?php echo txt('settings', 'Vollständige Vorschau'); ?></option>
			    	<option value="short" <?php if($user_data['content preview'] == 'short') echo 'selected="selected"'; ?> ><?php echo txt('settings', 'Verkürzte Vorschau'); ?></option>
			    	<option value="no" <?php if($user_data['content preview'] == 'no') echo 'selected="selected"'; ?> ><?php echo txt('settings', 'Keine Vorschau'); ?></option>
			    </select>
		    </p>
		    
    		<?php connector('settings system after'); ?>

			<!-- Website -->
			<h4><?php echo txt('settings', 'Website'); ?></h4>
		    
			<p>
				<label for="site_author"><?php echo txt('settings', 'Autor'); ?>:</label>
				<input class="text" type="text" id="site_author" name="site_author" value="<?php echo clean_output($user_data['author']); ?>">
			</p>
		
			<p>
				<label id="email"><?php echo txt('settings', 'E-Mail-Adresse'); ?>:</label>
				<input class="text" type="text" id="email" name="email" value="<?php echo clean_output($user_data['email']); ?>">
			</p>
		
			<p>
				<label for="site_languages"><?php echo txt('settings', 'Sprache(n)'); ?>:</label> 
				<small><a class="look-in-help" href="index.php?backend=help#multilanguage">?</a></small>
				<input class="text" type="text" id="site_languages" name="site_languages" id="site_languages" value="<?php echo clean_output($user_data['frontend languages']); ?>">
			</p>
		
			<p>
				<label for="site_title"><?php echo txt('settings', 'Titel'); ?>:</label>
				<input class="text" type="text" id="site_title" name="site_title" value="<?php echo clean_output($user_data['site title']); ?>">
			</p>
		
			<?php connector('settings website after'); ?>

			<!-- Localization -->
		    <h4><?php echo txt('settings', 'Lokalisierung'); ?></h4>
			
			<p>
				<label for="placename"><?php echo txt('settings', 'Ortsname'); ?>:</label>
				<input class="text" type="text" id="placename" name="placename" value="<?php echo clean_output($user_data['placename']); ?>">
			</p>
			
			<p>
				<label for="region"><?php echo txt('settings', 'Regionalcode'); ?>:</label>
				<input class="text" type="text" id="region" name="region" value="<?php echo clean_output($user_data['region']); ?>">
			</p>
			
			<p>
				<label for="latitude"><?php echo txt('settings', 'Breitengrad'); ?>:</label>
				<input class="text" type="text" id="latitude" name="latitude" value="<?php echo clean_output($user_data['latitude']); ?>">
			</p>

			<p>
				<label for="longitude"><?php echo txt('settings', 'Längengrad'); ?>:</label>
				<input class="text" type="text" id="longitude" name="longitude" value="<?php echo clean_output($user_data['longitude']); ?>">
			</p>
			
			<p class="context">
				<?php echo txt('settings', 'Diese Daten ermitteln:'); ?> <a href="http://getpagemap.com/<?php echo $user_data["backend language"] == 'de' ? 'online-werkzeuge' : 'online-tools'; ?>/tool/geo-tag-generator" target="_blank"><?php echo txt('settings', 'Geo Location Finder'); ?></a>
			</p>

			<?php connector('settings localization after'); ?>
		</div>
		
		<div class="column last-column">
			<!-- Website Settings -->
			<h4><?php echo txt('settings', 'Einstellungen'); ?></h4>

			<p>
				<label for="base_url"><?php echo txt('settings', 'Adresse (URL)'); ?>:</label>
				<input class="text" type="text" id="base_url" name="base_url" value="<?php echo clean_output($user_data['base url']); ?>">
			</p>
		
			<p>
				<input type="checkbox" name="url_rewrite" id="url_rewrite" <?php echo ($user_data['url rewrite'] == 1 ? 'checked="checked"' : ''); ?>>
				<label class="checkbox" for="url_rewrite" title="<?php echo txt('settings', 'Es werden simulierte Pfadangaben statt PHP-Variablen in der URL verwendet.'); ?>"><?php echo txt('settings', 'URLs umschreiben'); ?></label> 
				<small><a class="look-in-help" href="index.php?backend=help#url_rewrite" title="<?php echo txt('settings', 'Informationen zum Thema „URLs umschreiben” in der Hilfe nachschlagen.'); ?>">?</a></small>
			</p>
			
		    <hr>

			<p>
				<input type="checkbox" name="error_reporting" id="error_reporting" <?php echo ($user_data['error reporting'] == 0 ? 'checked="checked"' : ''); ?>>
		    	<label class="checkbox" for="error_reporting"><?php echo txt('settings', 'Fehlermeldungen unterdrücken'); ?></label>
		    </p>
		    
			<?php connector('settings website settings after'); ?>

			<!-- Meta Tags -->
		    <h4><?php echo txt('settings', 'Erweiterte Metadaten'); ?></h4>

		    <p>
		    	<input type="checkbox" id="meta_language" name="meta_language" <?php echo ($user_data['meta language'] == 1 ? 'checked="checked"' : ''); ?>>
				<label class="checkbox" for="meta_language"><?php echo txt('settings', 'Seitensprache (language)'); ?></label>
			</p>

		    <p>
		    	<input type="checkbox" id="meta_last_modified" name="meta_last_modified" <?php echo ($user_data['meta last-modified'] == 1 ? 'checked="checked"' : ''); ?>>
				<label class="checkbox" for="meta_last_modified"><?php echo txt('settings', 'Änderungsdatum (last-modified)'); ?></label>
			</p>

		    <p>
		    	<input type="checkbox" id="meta_page_topic" name="meta_page_topic" <?php echo ($user_data['meta page-topic'] == 1 ? 'checked="checked"' : ''); ?>>
				<label class="checkbox" for="meta_page_topic"><?php echo txt('settings', 'Thema (page-topic)'); ?></label>
			</p>

		    <p>
		    	<input type="checkbox" id="meta_noodp" name="meta_noodp" <?php echo ($user_data['meta noodp'] == 1 ? 'checked="checked"' : ''); ?>>
				<label class="checkbox" for="meta_noodp"><?php echo txt('settings', 'No ODP (robots)'); ?></label>
			</p>

		    <p>
		    	<input type="checkbox" id="meta_canonical" name="meta_canonical" <?php echo ($user_data['meta canonical'] == 1 ? 'checked="checked"' : ''); ?>>
				<label class="checkbox" for="meta_canonical"><?php echo txt('settings', 'Quelle (canonical)'); ?></label>
			</p>

			<!-- Feed -->
		    <h4><?php echo txt('settings', 'RSS-Dienst'); ?></h4>
		    
			<p>
				<label for="feed_title"><?php echo txt('settings', 'Titel'); ?>:</label>
				<input class="text" type="text" id="feed_title" name="feed_title" value="<?php echo clean_output($user_data['rss title']); ?>">
			</p>
			
			<p>
				<label for="feed_description"><?php echo txt('settings', 'Beschreibung'); ?>:</label>
				<input class="text" type="text" id="feed_description" name="feed_description" value="<?php echo clean_output($user_data['rss description']); ?>">
			</p>

			<p>
				<label for="feed_url"><?php echo txt('settings', 'Adresse (URL)'); ?>:</label>
				<input class="text" type="text" id="feed_url" name="feed_url" value="<?php echo clean_output($user_data['rss url']); ?>">
			</p>
			
			<br>
			
		    <p>
		    	<input type="checkbox" id="feed_only_news" name="feed_only_news" <?php echo ($user_data['rss only news'] == 1 ? 'checked="checked"' : ''); ?>>
				<label class="checkbox" for="feed_only_news"><?php echo txt('settings', 'Nur Nachrichtenseiten senden'); ?></label>
			</p>

		    <p>
		    	<input type="text" id="feed_items" name="feed_items" class="number" value="<?php echo clean_output($user_data['rss items']); ?>">
				<label class="checkbox" for="feed_items"><?php echo txt('settings', 'letzte Seiten'); ?></label>
			</p>
			
			<?php connector('settings feed after'); ?>
		</div>
		
		<input id="save" name="save_settings" type="submit" value="<?php echo txt('settings', 'Speichern'); ?>">
	</form>
<?php } ?>
