Index: /controller/wpsg_AdminController.class.php
===================================================================
--- /controller/wpsg_AdminController.class.php	(revision 6306)
+++ /controller/wpsg_AdminController.class.php	(revision 6307)
@@ -2027,4 +2027,15 @@
 		public function ueberAction()
 		{
+            
+            if (wpsg_isSizedString($_REQUEST['subaction'], 'clearSysLog'))
+            {
+                
+                @unlink($GLOBALS['wpsg_sc']->getStorageRoot().'exception.log');
+                
+                $this->addBackendMessage(__('Fehlerprotokoll gelÃ¶scht.', 'wpsg'));
+                
+                $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber&subaction=systemlog');
+                
+            }
 			
 			$this->shop->view = array(
@@ -2094,4 +2105,6 @@
 				$this->update_option('wpsg_options_nl2br', $_REQUEST['wpsg_options_nl2br']);
 				$this->update_option('wpsg_debugModus', $_REQUEST['wpsg_debugModus']);
+                $this->update_option('wpsg_displayTemplates', $_REQUEST['wpsg_displayTemplates']);
+                $this->update_option('wpsg_displayTemplatesLog', $_REQUEST['wpsg_displayTemplatesLog']);
 				
 				if ($this->shop->hasMod('wpsg_mod_core')) $this->update_option('wpsg_debugURL', $_REQUEST['wpsg_debugURL']);
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 6306)
+++ /controller/wpsg_ShopController.class.php	(revision 6307)
@@ -1162,5 +1162,5 @@
 			}
 			 
-			if ($this->view['data']['pstatus'] == 1) return '';
+			if (wpsg_isSizedInt($this->view['data']['pstatus'])) return '';
 			
 			// Produkt, bei dem die EU Leistungsortregel gilt ?
@@ -1237,5 +1237,5 @@
 			
 		} // public function renderProdukt($produkt_id)
- 		
+ 				
 		/**
 		 * Shortcode fÃŒr Warenkorbbutton, um Produkte aus KategorieÃŒbersicht in Warenkorb zu legen (muss in jedem Beitrag eingefÃŒgt werden)
@@ -1871,11 +1871,5 @@
 			{
 				
-				// Sollte nicht auftreten. Da es mit dem Update auf 3.1.2 Probleme gab, hab ich hier eine Debug Meldung eingebaut
-				wpsg_debug("Systemfehler! Fehlercode: 100 (Parameter: ".$produkt_key.")");				
-				
-				wpsg_debug($_SESSION);
-				echo '<pre>';debug_print_backtrace();echo '</pre>';
-				//die();
-				
+				throw new \wpsg\Exception(_('Produkt ID konnte nicht gebildet werden.'), \wpsg\Exception::TYP_UNEXPECTED);				
 				return 0;
 				
Index: /controller/wpsg_SystemController.class.php
===================================================================
--- /controller/wpsg_SystemController.class.php	(revision 6306)
+++ /controller/wpsg_SystemController.class.php	(revision 6307)
@@ -719,7 +719,32 @@
 			}
 			
-			//if ($this->debugTemplateFile) wpsg_debug_console($file);
+			if ($this->get_option('wpsg_displayTemplatesLog') > 0) wpsg_debug_console($this->clearPathForDebug($file));
+			
+			if (!is_admin() && $this->get_option('wpsg_displayTemplates') > 0)
+			{
+				
+				if (!preg_match('/\/form\//', $file))
+				{
+				
+					echo '<div style="display:inline-block; box-shadow: inset 0px 0px 0px 1px #003C6A; position:relative;">';			
+					echo '<div style="background-color:#003C6A; color:#FFFFFF; white-space:nowrap; font-size:11px; font-family:monospace; line-height:14px; margin-top:-14px; position:absolute;">'.$this->clearPathForDebug($file).'</div>';
+					
+				}
+				
+			}
 			
 			include $render_file;
+			
+			if (!is_admin() && $this->get_option('wpsg_displayTemplates') > 0)
+			{
+				
+				if (!preg_match('/\/form\//', $file))
+				{
+					
+					echo '</div>';
+					
+				}
+				
+			}
 			
 			if (sizeof($this->arTemplateStack) == 1 && $this->get_option('wpsg_autoraw') === '1' && !is_admin() && !$this->bShortcode) echo '[/raw]';
@@ -730,4 +755,14 @@
 			
 		} // public function render($file)
+		
+		private function clearPathForDebug($file)
+		{
+			
+			$file = preg_replace('/(\/\/)|(\\\)/', '/', $file);
+			$file = str_replace(get_home_path(), '/', $file);
+			
+			return $file;
+			
+		} // private function clearPath($file)
 		
 		/**
Index: /lib/helper_functions.inc.php
===================================================================
--- /lib/helper_functions.inc.php	(revision 6306)
+++ /lib/helper_functions.inc.php	(revision 6307)
@@ -390,8 +390,8 @@
 	} // function wpsg_drawForm_Checkbox($field_name, $field_label, $conf = array())
 
-	function wpsg_drawForm_AdminboxStart($title = false, $wrap_class = '')
-	{
-		
-		echo '<div class="panel panel-default '.$wrap_class.'">';
+	function wpsg_drawForm_AdminboxStart($title = false, $wrap_class = '', $arConf = array())
+	{
+		
+		echo '<div class="panel panel-default '.$wrap_class.'" style="'.wpsg_getStr($arConf['style']).'">';
 
 		if (wpsg_isSizedString($title))
@@ -646,42 +646,4 @@
 		
 		return $TC->render(WPSG_PATH_VIEW.'admin/form/textarea.phtml', false);
-		
-		/*
-		$field_id = $field_name;
-		
-		$strReturn = '
-			<div class="wpsg_form_field">
-				<div class="wpsg_form_left">
-					<label for="'.$field_id.'">'.$field_label.':</label>
-				</div>
-				<div class="wpsg_form_right">
-					<textarea id="'.$field_id.'" name="'.$field_name.'">'.wpsg_hspc($field_value).'</textarea>
-		';
-		
-		if (isset($conf['help']))
-		{
-		
-			$strReturn .= '<a href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field='.wpsg_hspc($conf['help']).'" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field='.wpsg_hspc($conf['help']).'" class="wpsg_form_help"></a>';
-
-		}
-		
-		if (isset($conf['hint']))
-		{
-		
-			if (substr($conf['hint'], 0, 7) == 'nohspc_')
-				$strReturn .= '<div class="wpsg_clear"></div><p class="wpsg_hinweis">'.substr($conf['hint'], 7).'</p>';
-			else
-				$strReturn .= '<div class="wpsg_clear"></div><p class="wpsg_hinweis">'.wpsg_hspc($conf['hint']).'</p>';
-		
-		}
-		
-		$strReturn .= '
-				</div>
-				<div class="wpsg_clear"></div>
-			</div>
-		';
-		
-		return $strReturn;
-		*/
 		
 	} // function wpsg_drawForm_Textarea($field_name, $field_label, $field_value, $conf = array())
Index: /views/admin/extended.phtml
===================================================================
--- /views/admin/extended.phtml	(revision 6306)
+++ /views/admin/extended.phtml	(revision 6307)
@@ -29,4 +29,6 @@
 				<?php echo wpsg_drawForm_Checkbox('wpsg_options_nl2br', __('RTE Felder mit nl2br speichern', 'wpsg'), $this->get_option('wpsg_options_nl2br'), array('help' => 'wpsg_options_nl2br')); ?>
 				<?php echo wpsg_drawForm_Checkbox('wpsg_debugModus', __('Debug Modus', 'wpsg'), $this->get_option('wpsg_debugModus'), array('help' => 'wpsg_debugModus')); ?>
+				<?php echo wpsg_drawForm_Checkbox('wpsg_displayTemplates', __('Verwendete Templates anzeigen (Nur im Frontend)', 'wpsg'), $this->get_option('wpsg_displayTemplates'), array('help' => 'wpsg_displayTemplates')); ?>
+				<?php echo wpsg_drawForm_Checkbox('wpsg_displayTemplatesLog', __('Verwendete Templates in Entwicklerkonsole anzeigen', 'wpsg'), $this->get_option('wpsg_displayTemplatesLog'), array('help' => 'wpsg_displayTemplatesLog')); ?>
 				
 				<?php if ($this->hasMod('wpsg_mod_core')) { ?>
Index: /views/admin/form/textarea.phtml
===================================================================
--- /views/admin/form/textarea.phtml	(revision 6306)
+++ /views/admin/form/textarea.phtml	(revision 6307)
@@ -13,5 +13,11 @@
 		<div class="wpsg_field_wrap">
 			
-			<textarea class="form-control" id="<?php echo $this->view['field_id']; ?>" name="<?php echo $this->view['field_name']; ?>"><?php echo wpsg_hspc($this->view['field_value']); ?></textarea>
+			<textarea <?php 
+			
+				if (wpsg_isTrue($this->view['field_config']['readonly'])) echo ' readonly="readonly" ';
+				if (wpsg_isTrue($this->view['field_config']['disabled'])) echo ' disabled="disabled" ';
+				if (wpsg_isSizedString($this->view['field_config']['style'])) echo 'style="'.$this->view['field_config']['style'].'" ';			
+			
+			?> class="form-control" id="<?php echo $this->view['field_id']; ?>" name="<?php echo $this->view['field_name']; ?>"><?php echo wpsg_hspc($this->view['field_value']); ?></textarea>
 			
 			<?php if (wpsg_isSizedString($this->view['field_config']['help'])) { ?>
Index: /views/admin/ueber.phtml
===================================================================
--- /views/admin/ueber.phtml	(revision 6306)
+++ /views/admin/ueber.phtml	(revision 6307)
@@ -21,4 +21,7 @@
 				<a class="list-group-item <?php echo ((isset($_REQUEST['subaction']) && $_REQUEST['subaction'] == 'systemcheck')?'active':''); ?>" 
 				href="<?php echo wpsg_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber&subaction=systemcheck'); ?>"><?php echo __('Systemcheck', 'wpsg'); ?></a>
+			
+				<a class="list-group-item <?php echo ((isset($_REQUEST['subaction']) && $_REQUEST['subaction'] == 'systemlog')?'active':''); ?>" 
+				href="<?php echo wpsg_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber&subaction=systemlog'); ?>"><?php echo __('Fehlerprotokoll', 'wpsg'); ?></a>
 		
 		</div>
@@ -75,4 +78,19 @@
 <?php } ?>
 
+<?php if (isset($_REQUEST['subaction']) && $_REQUEST['subaction'] == 'systemlog') { ?>	
+<?php echo wpsg_drawForm_AdminboxStart(__('Fehlerprotokoll', 'wpsg'), '', array('style' => 'width:892px;')); ?>
+
+	<?php if (!file_exists($GLOBALS['wpsg_sc']->getStorageRoot().'exception.log')) { ?>
+		<p><?php echo __('Es wurden noch keine Systemfehler aufgezeichnet.', 'wpsg'); ?></p>	
+	<?php } else { ?>
+	
+		<textarea style="width:860px; height:500px; font-size:12px; font-family:Courier;"><?php echo file_get_contents($GLOBALS['wpsg_sc']->getStorageRoot().'exception.log'); ?></textarea>
+		
+		<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=ueber&subaction=clearSysLog&noheader=1" class="button"><?php echo __('Protokolldatei lÃ¶schen', 'wpsg'); ?></a>
+		
+	<?php } ?>
+	
+<?php echo wpsg_drawForm_AdminboxEnd(); ?>
+<?php } ?>
 
 <?php if (isset($_REQUEST['subaction']) && $_REQUEST['subaction'] == 'phpinfo') { ?>	
