Index: locales/fr/plugins.po
===================================================================
--- locales/fr/plugins.po	(revision 2647)
+++ locales/fr/plugins.po	(revision 2663)
@@ -1992,4 +1992,13 @@
 msgstr "Du jeu de template :"
 
+msgid "Reset"
+msgstr "Réinitialiser"
+
+msgid "Are you sure you want to reset this file?"
+msgstr "Êtes-vous sûr de vouloir réinitialiser ce fichier ?"
+
+msgid "The file has been reset."
+msgstr "Le fichier a été réinitialisé."
+
 #~ msgid "RSS or Atom feed subscription links"
 #~ msgstr "Liens d'abonnement aux flux RSS ou Atom"
Index: plugins/themeEditor/_define.php
===================================================================
--- plugins/themeEditor/_define.php	(revision 2566)
+++ plugins/themeEditor/_define.php	(revision 2663)
@@ -16,5 +16,5 @@
 	/* Description*/		"Theme Editor",
 	/* Author */			"Olivier Meunier",
-	/* Version */			'1.0',
+	/* Version */			'1.1',
 	array(
 		'type'		=>		'plugin'
Index: plugins/themeEditor/class.themeEditor.php
===================================================================
--- plugins/themeEditor/class.themeEditor.php	(revision 2651)
+++ plugins/themeEditor/class.themeEditor.php	(revision 2663)
@@ -158,4 +158,55 @@
 	}
 
+	public function deletableFile($type,$f)
+	{
+		if ($type != 'tpl') {
+			// Only tpl files may be deleted
+			return false;
+		}
+
+		$files = $this->getFilesFromType($type);
+		if (isset($files[$f])) {
+			$dest = $this->getDestinationFile($type,$f);
+			if ($dest) {
+				if (file_exists($dest) && is_writable($dest)) {
+					// Is there a model (parent theme or template set) ?
+					if (isset($this->tpl_model[$f])) {
+						return true;
+					}
+				}
+			}
+		}
+		return false;
+	}
+
+	public function deleteFile($type,$f)
+	{
+		if ($type != 'tpl') {
+			// Only tpl files may be deleted
+			return;
+		}
+
+		$files = $this->getFilesFromType($type);
+		if (!isset($files[$f])) {
+			throw new Exception(__('File does not exist.'));
+		}
+
+		try
+		{
+			$dest = $this->getDestinationFile($type,$f);
+			if ($dest) {
+				// File exists and may be deleted
+				unlink($dest);
+
+				// Updating template files list
+				$this->findTemplates();
+			}
+		}
+		catch (Exception $e)
+		{
+			throw new Exception(sprintf(__('Unable to delete file %s. Please check your theme files and folders permissions.'),$f));
+		}
+	}
+
 	protected function getDestinationFile($type,$f)
 	{
@@ -235,7 +286,9 @@
 		$this->tpl = array_merge(
 			$this->getFilesInDir($this->tplset_theme),
-			$this->getFilesInDir($this->parent_theme.'/tpl'),
-			$this->getFilesInDir($this->user_theme.'/tpl')
+			$this->getFilesInDir($this->parent_theme.'/tpl')
 			);
+		$this->tpl_model = $this->tpl;
+
+		$this->tpl = array_merge($this->tpl,$this->getFilesInDir($this->user_theme.'/tpl'));
 
 		# Then we look in 'default-templates' plugins directory
@@ -243,4 +296,5 @@
 		foreach ($plugins as $p) {
 			$this->tpl = array_merge($this->getFilesInDir($p['root'].'/default-templates'),$this->tpl);
+			$this->tpl_model = array_merge($this->getFilesInDir($p['root'].'/default-templates'),$this->tpl_model);
 		}
 
Index: plugins/themeEditor/index.php
===================================================================
--- plugins/themeEditor/index.php	(revision 2566)
+++ plugins/themeEditor/index.php	(revision 2663)
@@ -52,4 +52,12 @@
 		$o->writeFile($file['type'],$file['f'],$file['c']);
 	}
+
+	# Delete file
+	if (!empty($_POST['delete']))
+	{
+		$o->deleteFile($file['type'],$file['f']);
+		dcPage::addSuccessNotice(__('The file has been deleted.'));
+		http::redirect($p_url.'&'.$file['type'].'='.$file['f']);
+	}
 }
 catch (Exception $e)
@@ -68,4 +76,5 @@
   <?php echo dcPage::jsVar('dotclear.msg.document_saved',__("Document saved")); ?>
   <?php echo dcPage::jsVar('dotclear.msg.error_occurred',__("An error occurred:")); ?>
+  <?php echo dcPage::jsVar('dotclear.msg.confirm_reset_file',__("Are you sure you want to reset this file?")); ?>
   <?php echo dcPage::jsVar('dotclear.colorsyntax',$user_ui_colorsyntax); ?>
   //]]>
@@ -122,4 +131,5 @@
 		echo
 		'<p><input type="submit" name="write" value="'.__('Save').' (s)" accesskey="s" /> '.
+		($o->deletableFile($file['type'],$file['f']) ? '<input type="submit" name="delete" class="delete" value="'.__('Reset').'" />' : '').
 		$core->formNonce().
 		($file['type'] ? form::hidden(array($file['type']),$file['f']) : '').
Index: plugins/themeEditor/script.js
===================================================================
--- plugins/themeEditor/script.js	(revision 2566)
+++ plugins/themeEditor/script.js	(revision 2663)
@@ -1,3 +1,4 @@
 $(function() {
+	// Cope with saving
 	var msg = false;
 	$('#file-form input[name="write"]').click(function() {
@@ -31,3 +32,9 @@
 		return false;
 	});
+
+	// Confirm for deleting current file
+	$('#file-form input[name="delete"]').click(function() {
+		return window.confirm(dotclear.msg.confirm_reset_file);
+	});
+
 });
