Index: /extensions/ContactForm/admin.php
===================================================================
--- /extensions/ContactForm/admin.php	(revision 25871)
+++ /extensions/ContactForm/admin.php	(revision 25872)
@@ -7,5 +7,5 @@
 
 // tabsheet
-include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');    
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
 $tabsheet = new tabsheet();
 $tabsheet->add('config', l10n('Configuration'), CONTACT_FORM_ADMIN . '-config');
@@ -17,7 +17,7 @@
 include(CONTACT_FORM_PATH . 'admin/' . $page['tab'] . '.php');
 
-if (!$conf['ContactForm']['cf_ready'])
+if (!$conf['ContactForm_ready'])
 {
-  array_push($page['errors'], l10n('No active email address'));
+  $page['errors'][] = l10n('No active email address');
 }
 
@@ -29,4 +29,2 @@
 
 $template->assign_var_from_handle('ADMIN_CONTENT', 'contact_form');
-
-?>
Index: /extensions/ContactForm/admin/config.php
===================================================================
--- /extensions/ContactForm/admin/config.php	(revision 25871)
+++ /extensions/ContactForm/admin/config.php	(revision 25872)
@@ -5,6 +5,21 @@
 if (isset($_POST['save_config']))
 {
-  $was_ready = $conf['ContactForm']['cf_ready'];
-  
+  if ($_POST['cf_redirect_url']=='http://')
+  {
+    $_POST['cf_redirect_url'] = null;
+  }
+  else if (!empty($_POST['cf_redirect_url']))
+  {
+    if (strpos($_POST['cf_redirect_url'], 'http') !== 0)
+    {
+      $_POST['cf_redirect_url'] = 'http://' . $_POST['cf_redirect_url'];
+    }
+    if (!url_check_format($_POST['cf_redirect_url']))
+    {
+      $page['errors'][] = l10n('Invalid redirect URL');
+      $_POST['cf_redirect_url'] = $conf['ContactForm']['cf_redirect_url'];
+    }
+  }
+
   $conf['ContactForm'] = array(
     'cf_must_initialize' =>   false,
@@ -16,17 +31,14 @@
     'cf_mandatory_name' =>    isset($_POST['cf_mandatory_name']),
     'cf_mail_type' =>         $_POST['cf_mail_type'],
-    'cf_redirect_url' =>      ($_POST['cf_redirect_url']!='http://') ? $_POST['cf_redirect_url'] : null,
-    'cf_theme' =>             $_POST['cf_theme'],
+    'cf_redirect_url' =>      $_POST['cf_redirect_url'],
     );
   $conf['ContactForm_before'] = $_POST['cf_before'];
   $conf['ContactForm_after'] = $_POST['cf_after'];
-  
+
   conf_update_param('ContactForm', serialize($conf['ContactForm']));
   conf_update_param('ContactForm_before', $conf['ContactForm_before']);
   conf_update_param('ContactForm_after', $conf['ContactForm_after']);
-  
-  $conf['ContactForm']['cf_ready'] = $was_ready;
-  
-  array_push($page['infos'], l10n('Information data registered in database'));
+
+  $page['infos'][] = l10n('Information data registered in database');
 }
 
@@ -40,4 +52,2 @@
 
 $template->set_filename('contact_form', realpath(CONTACT_FORM_PATH . 'admin/template/config.tpl'));
-
-?>
Index: /extensions/ContactForm/admin/emails.php
===================================================================
--- /extensions/ContactForm/admin/emails.php	(revision 25871)
+++ /extensions/ContactForm/admin/emails.php	(revision 25872)
@@ -9,24 +9,25 @@
   {
     if (isset($entry['delete'])) continue;
-    
-    if ( empty($entry['email']) or !check_email_validity($entry['email']) )
+
+    if ( empty($entry['email']) or !email_check_format($entry['email']) )
     {
-      array_push($page['errors'], l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)'));
+      $page['errors'][] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)');
     }
     else
     {
+      if (empty($entry['name'])) $entry['name'] = $entry['email'];
       if ($entry['group_name'] == -1) $entry['group_name'] = null;
-      
-      array_push($emails, array(
+
+      $emails[] = array(
         'name' => $entry['name'],
         'email' => $entry['email'],
         'group_name' => $entry['group_name'],
         'active' => boolean_to_string(isset($entry['active'])),
-        ));
+        );
     }
   }
-  
+
   pwg_query('TRUNCATE TABLE `'. CONTACT_FORM_TABLE. '`;');
-  
+
   mass_inserts(
     CONTACT_FORM_TABLE,
@@ -34,8 +35,8 @@
     $emails
     );
-    
-  $conf['ContactForm']['cf_ready'] = count($emails);
-  
-  array_push($page['infos'], l10n('Information data registered in database'));
+
+  $conf['ContactForm_ready'] = count($emails);
+
+  $page['infos'][] = l10n('Information data registered in database');
 }
 
@@ -55,8 +56,8 @@
 {
   $data['active'] = get_boolean($data['active']);
-  array_push($emails, $data);
+  $emails[] = $data;
   if (!empty($data['group_name']))
   {
-    array_push($groups, $data['group_name']);
+    $groups[] = $data['group_name'];
   }
 }
@@ -68,4 +69,2 @@
 
 $template->set_filename('contact_form', realpath(CONTACT_FORM_PATH . 'admin/template/emails.tpl'));
-
-?>
Index: /extensions/ContactForm/admin/template/config.tpl
===================================================================
--- /extensions/ContactForm/admin/template/config.tpl	(revision 25871)
+++ /extensions/ContactForm/admin/template/config.tpl	(revision 25872)
@@ -1,13 +1,3 @@
-{combine_css path=$CONTACT_FORM_PATH|@cat:"admin/template/style.css"}
-{include file='include/colorbox.inc.tpl'}
-
-{footer_script}{literal}
-jQuery("a.preview-box").colorbox();
-
-jQuery("input[name='cf_theme']").change(function() {
-  jQuery("input[name='cf_theme']").parents(".themeBox").removeClass("themeDefault");
-  jQuery(this).parents(".themeBox").addClass("themeDefault");
-});
-{/literal}{/footer_script}
+{combine_css path=$CONTACT_FORM_PATH|cat:"admin/template/style.css"}
 
 <div class="titrePage">
@@ -17,10 +7,10 @@
 <form method="post" action="{$CONTACT_FORM_ADMIN}-config" class="properties">
   <fieldset>
-    <legend>{'General configuration'|@translate}</legend>
+    <legend>{'General configuration'|translate}</legend>
     <ul>
       <li>
         <label>
           <input type="checkbox" name="cf_menu_link" value="1" {if $cf_menu_link}checked="checked"{/if}>
-          {'Add link in menu'|@translate}
+          {'Add link in menu'|translate}
         </label>
       </li>
@@ -28,5 +18,5 @@
         <label>
           <input type="checkbox" name="cf_allow_guest" value="1" {if $cf_allow_guest}checked="checked"{/if}>
-          {'Allow guests to see the form'|@translate}
+          {'Allow guests to see the form'|translate}
         </label>
       </li>
@@ -34,5 +24,5 @@
         <label>
           <input type="checkbox" name="cf_mandatory_mail" value="1" {if $cf_mandatory_mail}checked="checked"{/if}>
-          {'E-mail address is mandatory'|@translate}
+          {'E-mail address is mandatory'|translate}
         </label>
       </li>
@@ -40,5 +30,5 @@
         <label>
           <input type="checkbox" name="cf_mandatory_name" value="1" {if $cf_mandatory_name}checked="checked"{/if}>
-          {'Name is mandatory'|@translate}
+          {'Name is mandatory'|translate}
         </label>
       </li>
@@ -46,15 +36,15 @@
         <label>
           <input type="text" name="cf_redirect_url" value="{if $cf_redirect_url}{$cf_redirect_url}{else}http://{/if}" size="50">
-          {'Redirect after sending email (optional)'|@translate}
+          {'Redirect after sending email (optional)'|translate}
         </label>
       </li>
     </ul>
   </fieldset>
-  
+
   <fieldset>
-    <legend>{'E-mail configuration'|@translate}</legend>
+    <legend>{'E-mail configuration'|translate}</legend>
     <ul>
       <li>
-        {'E-mail format :'|@translate}
+        {'E-mail format :'|translate}
         <label>
           <input type="radio" name="cf_mail_type" value="text/html" {if $cf_mail_type == 'text/html'}checked="checked"{/if}>
@@ -63,5 +53,5 @@
         <label>
           <input type="radio" name="cf_mail_type" value="text/plain" {if $cf_mail_type == 'text/plain'}checked="checked"{/if}>
-          {'Plain text'|@translate}
+          {'Plain text'|translate}
         </label>
       </li>
@@ -69,5 +59,5 @@
         <label>
           <input type="text" name="cf_default_subject" value="{$cf_default_subject}" size="50">
-          {'Default e-mail subject'|@translate} ({'can be translated with LocalFiles Editor plugin'|@translate})
+          {'Default e-mail subject'|translate} ({'can be translated with LocalFiles Editor plugin'|translate})
         </label>
       </li>
@@ -75,45 +65,20 @@
         <label>
           <input type="text" name="cf_subject_prefix" value="{$cf_subject_prefix}" size="50">
-          {'Prefix of the sent e-mail subject'|@translate} ({'you can use "%gallery_title%"'|@translate})
+          {'Prefix of the sent e-mail subject'|translate} ({'you can use "%gallery_title%"'|translate})
         </label>
       </li>
     </ul>
   </fieldset>
-  
+
   <fieldset>
-    <legend>{'Theme'|@translate}</legend>
-    
-    <div class="themeBoxes">
-      <div class="themeBox {if $cf_theme=='clear'}themeDefault{/if}">
-        <div class="themeName"><label>
-          <input type="radio" name="cf_theme" value="clear" {if $cf_theme=='clear'}checked{/if}>
-          Clear
-        </label></div>
-        <div class="themeShot">
-          <a href="{$CONTACT_FORM_PATH}admin/template/prev-clear.jpg" class="preview-box"><img src="{$CONTACT_FORM_PATH}admin/template/prev-clear.jpg" width="150"/></a>
-        </div>
-      </div>
-      <div class="themeBox {if $cf_theme=='dark'}themeDefault{/if}">
-        <div class="themeName"><label>
-          <input type="radio" name="cf_theme" value="dark" {if $cf_theme=='dark'}checked{/if}>
-          Dark
-        </label></div>
-        <div class="themeShot">
-          <a href="{$CONTACT_FORM_PATH}admin/template/prev-dark.jpg" class="preview-box"><img src="{$CONTACT_FORM_PATH}admin/template/prev-dark.jpg" width="150"/></a>
-        </div>
-      </div>
-    </div>
-  </fieldset>
-  
-  <fieldset>
-    <legend>{'Text before the contact form'|@translate}</legend>
+    <legend>{'Text before the contact form'|translate}</legend>
     <textarea rows="4" cols="80" class="description" name="cf_before">{$cf_before}</textarea>
   </fieldset>
 
   <fieldset>
-    <legend>{'Text after the contact form'|@translate}</legend>
+    <legend>{'Text after the contact form'|translate}</legend>
     <textarea rows="4" cols="80" class="description" name="cf_after">{$cf_after}</textarea>
   </fieldset>
 
-  <p style="text-align:left;"><input type="submit" name="save_config" value="{'Submit'|@translate}" class="submit"></p>
+  <p style="text-align:left;"><input type="submit" name="save_config" value="{'Submit'|translate}" class="submit"></p>
 </form>
Index: /extensions/ContactForm/admin/template/emails.tpl
===================================================================
--- /extensions/ContactForm/admin/template/emails.tpl	(revision 25871)
+++ /extensions/ContactForm/admin/template/emails.tpl	(revision 25872)
@@ -1,4 +1,3 @@
-{combine_css path=$CONTACT_FORM_PATH|@cat:"admin/template/style.css"}
-
+{combine_css path=$CONTACT_FORM_PATH|cat:"admin/template/style.css"}
 
 <div class="titrePage">
@@ -6,13 +5,12 @@
 </div>
 
-
 <form method="post" action="{$CONTACT_FORM_ADMIN}-emails" class="properties">
   <table class="table2" id="emails">
     <tr class="throw">
-      <th>{'Name'|@translate}</th>
-      <th>{'Email address'|@translate}</th>
-      <th>{'Category'|@translate}</th>
-      <th>{'Active'|@translate}</th>
-      <th>{'Delete'|@translate}</th>
+      <th>{'Name'|translate}</th>
+      <th>{'Email address'|translate}</th>
+      <th>{'Category'|translate}</th>
+      <th>{'Active'|translate}</th>
+      <th>{'Delete'|translate}</th>
     </tr>
   {counter start=0 assign=i}
@@ -42,11 +40,11 @@
     <tr class="{if $i is odd}row1{else}row2{/if}" id="addEntryContainer">
       <td colspan="2" style="text-align:center;">
-        <a id="addEntry">{'+ Add an email'|@translate}</a>
+        <a id="addEntry">{'+ Add an email'|translate}</a>
       </td>
       <td>
-        <a id="addGroup">{'+ Add a category'|@translate}</a>
+        <a id="addGroup">{'+ Add a category'|translate}</a>
       </td>
       <td colspan="2"  style="text-align:center;">
-        <input type="submit" name="save_emails" value="{'Submit'|@translate}" class="submit">
+        <input type="submit" name="save_emails" value="{'Submit'|translate}" class="submit">
       </td>
     </tr>
@@ -56,8 +54,7 @@
 
 <div class="infos tip">
-<b>{'Tip'|@translate}:</b>
-{'Each category is displayed as a distinct "service" on the contact form (example: "Technical", "Commercial", "General question"). Using categories is not mandatory.'|@translate}
+<b>{'Tip'|translate}:</b>
+{'Each category is displayed as a distinct "service" on the contact form (example: "Technical", "Commercial", "General question"). Using categories is not mandatory.'|translate}
 </div>
-
 
 
@@ -68,12 +65,21 @@
 {/foreach}
 
-{literal}
-var doBlink = function(obj,start,finish) { jQuery(obj).fadeOut(300).fadeIn(300); if(start!=finish) { start=start+1; doBlink(obj,start,finish); } };
-jQuery.fn.blink = function(start,finish) { return this.each(function() { doBlink(this,start,finish) }); };
+var doBlink = function(obj,start,finish) {
+  jQuery(obj).fadeOut(300).fadeIn(300);
+  if(start!=finish) {
+    start=start+1; doBlink(obj,start,finish);
+  }
+};
+jQuery.fn.blink = function(start,finish) {
+  return this.each(function() {
+    doBlink(this,start,finish);
+  });
+};
 
 jQuery(document).on('change', '.delete', function() {
   if ($(this).is(':checked')) {
     $(this).parents('tr').addClass('delete');
-  } else {
+  }
+  else {
     $(this).parents('tr').removeClass('delete');
   }
@@ -83,5 +89,5 @@
   entry++;
   i = entry;
-  
+
   content =
     '<tr class="row'+ (i%2+1) +'">'+
@@ -108,5 +114,5 @@
     '</tr>'
   $('#emails').append(content);
-    
+
   $('#addEntryContainer')
     .removeClass('row1 row2')
@@ -116,5 +122,5 @@
 
 jQuery('#addGroup').click(function() {
-  name = prompt("{/literal}{'Name'|@translate}{literal}:");
+  name = prompt("{'Name'|translate}:");
   if (name != null && name != "") {
     name = name.replace(new RegExp('"','g'),"'");
@@ -124,3 +130,3 @@
   }
 });
-{/literal}{/footer_script}
+{/footer_script}
Index: /extensions/ContactForm/admin/template/style.css
===================================================================
--- /extensions/ContactForm/admin/template/style.css	(revision 25871)
+++ /extensions/ContactForm/admin/template/style.css	(revision 25872)
@@ -26,7 +26,2 @@
   border-radius:5px;
 }
-
-.themeBox {
-  height:auto;
-  padding-bottom:5px;
-}
Index: /extensions/ContactForm/include/contact_form.inc.php
===================================================================
--- /extensions/ContactForm/include/contact_form.inc.php	(revision 25871)
+++ /extensions/ContactForm/include/contact_form.inc.php	(revision 25872)
@@ -4,5 +4,5 @@
 global $template, $user, $conf, $page, $pwg_loaded_plugins;
 
-if ( (!is_classic_user() and !$conf['ContactForm']['cf_allow_guest']) or !$conf['ContactForm']['cf_ready'] )
+if ( (!is_classic_user() and !$conf['ContactForm']['cf_allow_guest']) or !$conf['ContactForm_ready'] )
 {
   redirect(get_absolute_root_url());
@@ -22,5 +22,5 @@
     'send_copy' => isset($_POST['send_copy']),
    );
-  
+
   $comment_action = send_contact_form($contact, @$_POST['key']);
 
@@ -105,5 +105,4 @@
   ));
 
-$template->set_filename('index', realpath(CONTACT_FORM_PATH . 'template/contact_form.tpl'));
-
-?>
+$template->set_filename('contactform', realpath(CONTACT_FORM_PATH . 'template/contact_form.tpl'));
+$template->assign_var_from_handle('CONTENT', 'contactform');
Index: /extensions/ContactForm/include/functions.inc.php
===================================================================
--- /extensions/ContactForm/include/functions.inc.php	(revision 25871)
+++ /extensions/ContactForm/include/functions.inc.php	(revision 25872)
@@ -8,67 +8,98 @@
 {
   global $tokens, $page, $conf;
-  
+
   if ($tokens[0] == 'contact')
   {
-    add_event_handler('loc_begin_page_header', 'contact_form_header');
-    
     $page['section'] = 'contact';
+    $page['title'] = l10n('Contact');
+    $page['body_id'] = 'theContactPage';
+    $page['is_external'] = true;
     $page['is_homepage'] = false;
-    
-    $page['title'] = l10n('Contact');
-    $page['section_title'] = $page['section_title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].'<a href="'.CONTACT_FORM_PUBLIC.'">'.l10n('Contact').'</a>';  
-  }
-}
-function contact_form_header()
+
+    $page['section_title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].'<a href="'.CONTACT_FORM_PUBLIC.'">'.l10n('Contact').'</a>';
+  }
+}
+
+/**
+ * contact page
+ */
+function contact_form_page()
 {
   global $page;
-  $page['body_id'] = 'theContactPage';
-}
-
-/**
- * contact page 
- */
-function contact_form_page()
-{
-  global $page;
 
   if (isset($page['section']) and $page['section'] == 'contact')
   {
-    include(CONTACT_FORM_PATH . '/include/contact_form.inc.php');
-  }
-}
-
-/** 
- * public menu link 
+    include(CONTACT_FORM_PATH . 'include/contact_form.inc.php');
+  }
+}
+
+/**
+ * public menu link
  */
 function contact_form_applymenu($menu_ref_arr)
 {
   global $conf;
-  
-  if ( !$conf['ContactForm']['cf_menu_link'] ) return;
-  if ( !is_classic_user() and !$conf['ContactForm']['cf_allow_guest'] ) return;
-  if ( !$conf['ContactForm']['cf_ready'] ) return;
+
+  if (!$conf['ContactForm']['cf_menu_link']) return;
+  if (!is_classic_user() and !$conf['ContactForm']['cf_allow_guest']) return;
+  if (!$conf['ContactForm_ready']) return;
 
   $menu = &$menu_ref_arr[0];
   if (($block = $menu->get_block('mbMenu')) != null)
   {
-    array_push($block->data, array(
+    $block->data[] = array(
       'URL' => CONTACT_FORM_PUBLIC,
       'NAME' => l10n('Contact'),
-    ));
-  }
-}
-
-/**
- * change contact on link on footer
+      );
+  }
+}
+
+/**
+ * change contact link in footer
  */
 function contact_form_footer_link($content, &$smarty)
 {
   $search = '<a href="mailto:{$CONTACT_MAIL}?subject={\'A comment on your site\'|@translate|@escape:url}">';
-  $replace = '<a href="'.CONTACT_FORM_PUBLIC.'">';
+  $replace = '<a href="{$CONTACT_FORM_PUBLIC}">';
   return str_replace($search, $replace, $content);
 }
 
 /**
+ * change contact link in mail footer
+ */
+function contact_form_mail_template($cache_key, $content_type)
+{
+  global $conf_mail;
+
+  $template = &$conf_mail[$cache_key]['theme'];
+  $template->assign('CONTACT_FORM_PUBLIC', CONTACT_FORM_PUBLIC);
+
+  if ($content_type == 'text/html')
+  {
+    $template->set_prefilter('mail_footer', 'contact_form_mail_template_html');
+  }
+  else
+  {
+    $template->set_prefilter('mail_footer', 'contact_form_mail_template_plain');
+  }
+}
+function contact_form_mail_template_html($content)
+{
+  return str_replace(
+    'mailto:{$CONTACT_MAIL}?subject={\'A comment on your site\'|translate|escape:url}',
+    '{$CONTACT_FORM_PUBLIC}',
+    $content
+    );
+}
+function contact_form_mail_template_plain($content)
+{
+  return str_replace(
+    '{$CONTACT_MAIL}',
+    '{$CONTACT_FORM_PUBLIC}',
+    $content
+    );
+}
+
+/**
  * init emails list
  */
@@ -76,5 +107,5 @@
 {
   global $conf;
-  
+
   $query = '
 SELECT
@@ -89,15 +120,15 @@
 ;';
   $result = pwg_query($query);
-  
+
   $emails = array();
   while ($row = pwg_db_fetch_assoc($result))
   {
-    array_push($emails, array(
+    $emails[] = array(
       'name' => $row['username'],
       'email' => $row['email'],
       'active' => 'true',
-      ));
-  }
-  
+      );
+  }
+
   mass_inserts(
     CONTACT_FORM_TABLE,
@@ -105,5 +136,5 @@
     $emails
     );
-  
+
   $conf['ContactForm']['cf_must_initialize'] = false;
   conf_update_param('ContactForm', serialize($conf['ContactForm']));
@@ -116,11 +147,6 @@
 function send_contact_form(&$comm, $key)
 {
-  global $conf, $page, $template, $conf_mail;
-  
-  if (!isset($conf_mail))
-  {
-    $conf_mail = get_mail_configuration();
-  }
-  
+  global $conf, $page, $template;
+
   $query = '
 SELECT DISTINCT group_name
@@ -129,5 +155,5 @@
 ;';
   $groups = array_from_query($query, 'group_name');
-  
+
   $comm = array_merge($comm,
     array(
@@ -138,5 +164,5 @@
 
   $comment_action='validate';
-  
+
   // check key
   if (!verify_ephemeral_key(@$key))
@@ -146,19 +172,19 @@
 
   // check author
-  if ( $conf['ContactForm']['cf_mandatory_name'] and empty($comm['author']) )
-  {
-    array_push($page['errors'], l10n('Please enter a name'));
-    $comment_action='reject';
-  }
-  
+  if ($conf['ContactForm']['cf_mandatory_name'] and empty($comm['author']))
+  {
+    $page['errors'][] = l10n('Please enter a name');
+    $comment_action='reject';
+  }
+
   // check email
-  if ( $conf['ContactForm']['cf_mandatory_mail'] and empty($comm['email']) )
-  {
-    array_push($page['errors'], l10n('Please enter an e-mail'));
-    $comment_action='reject';
-  }
-  else if ( !empty($comm['email']) and !check_email_validity($comm['email']) )
-  {
-    array_push($page['errors'], l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)'));
+  if ($conf['ContactForm']['cf_mandatory_mail'] and empty($comm['email']))
+  {
+    $page['errors'][] = l10n('Please enter an e-mail');
+    $comment_action='reject';
+  }
+  else if (!empty($comm['email']) and !email_check_format($comm['email']))
+  {
+    $page['errors'][] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)');
     $comment_action='reject';
   }
@@ -167,47 +193,47 @@
   if (empty($comm['subject']))
   {
-    array_push($page['errors'], l10n('Please enter a subject'));
+    $page['errors'][] = l10n('Please enter a subject');
     $comment_action='reject';
   }
   else if (strlen($comm['subject']) > 100)
   {
-    array_push($page['errors'], sprintf(l10n('%s must not be more than %d characters long'), l10n('Subject'), 100));
-    $comment_action='reject';
-  }
-  
+    $page['errors'][] = sprintf(l10n('%s must not be more than %d characters long'), l10n('Subject'), 100);
+    $comment_action='reject';
+  }
+
   // check group
-  if ( count($groups) > 1 and $comm['group'] == -1 )
+  if (count($groups) > 1 and $comm['group'] == -1)
   {
     $comm['group'] = true;
-    array_push($page['errors'], l10n('Please choose a category'));
-    $comment_action='reject';
-  }
-  
+    $page['errors'][] = l10n('Please choose a category');
+    $comment_action='reject';
+  }
+
   // check content
   if (empty($comm['content']))
   {
-    array_push($page['errors'], l10n('Please enter a message'));
+    $page['errors'][] = l10n('Please enter a message');
     $comment_action='reject';
   }
   else if (strlen($comm['subject']) > 2000)
   {
-    array_push($page['errors'], sprintf(l10n('%s must not be more than %d characters long'), l10n('Message'), 2000));
-    $comment_action='reject';
-  }
-  
+    $page['errors'][] = sprintf(l10n('%s must not be more than %d characters long'), l10n('Message'), 2000);
+    $comment_action='reject';
+  }
+
   include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php');
   include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
-  
+
   add_event_handler('contact_form_check', 'user_comment_check',
     EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
-  
+
   // perform more spam check
   $comment_action = trigger_event('contact_form_check', $comment_action, $comm);
-  
+
   // get admin emails
   $emails = get_contact_emails($comm['group']);
   if (!count($emails))
   {
-    array_push($page['errors'], l10n('Error while sending e-mail'));
+    $page['errors'][] = l10n('Error while sending e-mail');
     $comment_action='reject';
   }
@@ -215,98 +241,51 @@
   if ($comment_action == 'validate')
   {
-    // format subject
     $prefix = str_replace('%gallery_title%', $conf['gallery_title'], $conf['ContactForm']['cf_subject_prefix']);
-    $subject = '['.$prefix.'] '.$comm['subject'];
-    $subject = trim(preg_replace('#[\n\r]+#s', '', $subject));
-    $subject = encode_mime_header($subject);
-    
-    // format content
-    $comm['content'] = trigger_event('render_contact_content', $comm['content']);
-    if ($conf['ContactForm']['cf_mail_type'] == 'text/html')
+
+    $from = $Cc = null;
+    if (!empty($comm['email']))
     {
-      $comm['content'] = nl2br($comm['content']);
+      $from = array(
+        'name' => $comm['author'],
+        'email' => $comm['email'],
+        );
+      if ($comm['send_copy'])
+      {
+        $Cc = $from;
+      }
     }
-    
-    // format expeditor
-    if (empty($comm['email']))
-    {
-      $args['from'] = $conf_mail['formated_email_webmaster'];
-    }
-    else
-    {
-      $args['from'] = format_email($comm['author'], $comm['email']);
-    }
-    
-    // hearders
-    $headers = 'From: '.$args['from']."\n";  
-    $headers.= 'MIME-Version: 1.0'."\n";
-    $headers.= 'X-Mailer: Piwigo Mailer'."\n";
-    $headers.= 'Content-Transfer-Encoding: 8bit'."\n";
-    $headers.= 'Content-Type: '.$conf['ContactForm']['cf_mail_type'].'; charset="'.get_pwg_charset().'";'."\n";
-    
-    set_make_full_url();
+
     switch_lang_to(get_default_language());
     load_language('plugin.lang', CONTACT_FORM_PATH);
-    
-    // template
-    if ($conf['ContactForm']['cf_mail_type'] == 'text/html')
-    {
-      $mail_css = file_get_contents(dirname(__FILE__).'/../template/mail/style-'.$conf['ContactForm']['cf_theme'].'.css');
-      $template->set_filename('contact_mail', dirname(__FILE__).'/../template/mail/content_html.tpl');
-    }
-    else
-    {
-      $mail_css = null;
-      $template->set_filename('contact_mail', dirname(__FILE__).'/../template/mail/content_plain.tpl');
-    }
-    
-    $comm['show_ip'] = isset($conf['contact_form_show_ip']) ? $conf['contact_form_show_ip'] : false;
-    
-    $template->assign(array(
-      'cf_prefix' => $prefix,
-      'contact' => $comm,
-      'GALLERY_URL' => get_gallery_home_url(),
-      'PHPWG_URL' => PHPWG_URL,
-      'CONTACT_MAIL_CSS' => $mail_css,
-      ));
-    
-    // mail content
-    $content = $template->parse('contact_mail', true);
-    $content = wordwrap($content, 70, "\n", true);
-    
-    // send mail
-    $result =
-      trigger_event('send_mail',
-        false, /* Result */
-        trigger_event('send_mail_to', implode(',', $emails)),
-        trigger_event('send_mail_subject', $subject),
-        trigger_event('send_mail_content', $content),
-        trigger_event('send_mail_headers', $headers),
-        $args
+
+    $result = pwg_mail(
+      $emails,
+      array(
+        'subject' => '['.$prefix.'] '.$comm['subject'],
+        'mail_title' => $prefix,
+        'mail_subtitle' => $comm['subject'],
+        'content_format' => 'text/html',
+        'from' => $from,
+        'Cc' => $Cc,
+        ),
+      array(
+        'filename' => 'mail',
+        'dirname' => realpath(CONTACT_FORM_PATH . 'template'),
+        'assign' => array(
+          'CONTACT' => $comm,
+          ),
+        )
       );
-      
-    if ( $comm['send_copy'] and !empty($comm['email']) )
-    {
-      trigger_event('send_mail',
-        false, /* Result */
-        trigger_event('send_mail_to', $args['from']),
-        trigger_event('send_mail_subject', $subject),
-        trigger_event('send_mail_content', $content),
-        trigger_event('send_mail_headers', $headers),
-        $args
-      );
-    }
-    
-    unset_make_full_url();
+
     switch_lang_back();
     load_language('plugin.lang', CONTACT_FORM_PATH);
-    
+
     if ($result == false)
     {
-      array_push($page['errors'], l10n('Error while sending e-mail'));
+      $page['errors'][] = l10n('Error while sending e-mail');
       $comment_action='reject';
     }
   }
-  
+
   return $comment_action;
 }
@@ -322,7 +301,7 @@
 {
   global $conf;
-  
+
   include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
-  
+
   $where = '1=1';
   if ($group!==true)
@@ -337,47 +316,15 @@
     }
   }
-  
+
   $query = '
-SELECT *
+SELECT name, email
   FROM '. CONTACT_FORM_TABLE .'
-  WHERE 
+  WHERE
     '.$where.'
     AND active = "true"
   ORDER BY name ASC
 ';
-  $result = pwg_query($query);
-  
-  $emails = array();
-  while ($data = pwg_db_fetch_assoc($result))
-  {
-    array_push($emails, format_email($data['name'], $data['email']));
-  }
-  
+  $emails = array_from_query($query);
+
   return $emails;
 }
-
-
-/**
- * check if email is valid 
- */
-function check_email_validity($mail_address)
-{
-  if (function_exists('email_check_format'))
-  {
-    return email_check_format($mail_address); // Piwigo 2.5
-  }
-  else if (version_compare(PHP_VERSION, '5.2.0') >= 0)
-  {
-    return filter_var($mail_address, FILTER_VALIDATE_EMAIL)!==false;
-  }
-  else
-  {
-    $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
-    $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
-    $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
-
-    return (bool)preg_match($regex, $mail_address);
-  }
-}
-
-?>
Index: tensions/ContactForm/include/install.inc.php
===================================================================
--- /extensions/ContactForm/include/install.inc.php	(revision 25871)
+++ 	(revision )
@@ -1,117 +1,0 @@
-<?php
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-function contact_form_install()
-{
-  global $conf, $prefixeTable;
-  
-  // email table
-  $query = '
-CREATE TABLE IF NOT EXISTS `'. $prefixeTable .'contact_form` (
-  `id` smallint(5) NOT NULL AUTO_INCREMENT,
-  `name` varchar(128) NOT NULL,
-  `email` varchar(128) NOT NULL,
-  `active` enum("true","false") NOT NULL DEFAULT "true",
-  `group_name` varchar(128) DEFAULT NULL,
-  PRIMARY KEY (`id`),
-  UNIQUE KEY `UNIQUE` (`email`,`group_name`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;';
-  pwg_query($query);
-
-  // configuration
-  if (empty($conf['ContactForm']))
-  {
-    $conf['ContactForm'] = serialize(array(
-      'cf_must_initialize' => true,
-      'cf_menu_link' => true,
-      'cf_subject_prefix' => '%gallery_title%',
-      'cf_default_subject' => 'A comment on your site',
-      'cf_allow_guest' => true,
-      'cf_mandatory_mail' => true,
-      'cf_mandatory_name' => true,
-      'cf_mail_type' => 'text/html',
-      'cf_redirect_url' => null,
-      'cf_theme' => 'dark',
-      ));
-    
-    $conf['ContactForm_before'] = null;
-    $conf['ContactForm_after'] = null;
-    
-    conf_update_param('ContactForm', $conf['ContactForm']);
-    conf_update_param('ContactForm_before', $conf['ContactForm_before']);
-    conf_update_param('ContactForm_after', $conf['ContactForm_after']);
-  }
-  else
-  {
-    $new_conf = is_string($conf['ContactForm']) ? unserialize($conf['ContactForm']) : $conf['ContactForm'];
-    
-    // migration 2.4 -> 2.5
-    if (!isset($new_conf['cf_must_initialize']))
-    {
-      // new params
-      $new_conf['cf_default_subject'] = 'A comment on your site';
-      $new_conf['cf_mail_type'] = 'text/html';
-      $new_conf['cf_redirect_url'] = null;
-      
-      // move emails to database
-      $emails = array();
-      foreach ($new_conf['cf_admin_mails'] as $email => $data)
-      {
-        array_push($emails, array(
-          'email' => $email,
-          'name' => $data['NAME'],
-          'active' => boolean_to_string($data['ACTIVE']),
-          ));
-      }
-      
-      $new_conf['cf_must_initialize'] = empty($emails);
-      
-      mass_inserts(
-        $prefixeTable .'contact_form',
-        array('name','email','active'),
-        $emails
-        );
-      
-      // old params
-      unset(
-        $new_conf['comment'], $new_conf['cf_redirect_delay'], 
-        $new_conf['cf_separator'], $new_conf['cf_separator_length'], 
-        $new_conf['cf_admin_mails']
-        );
-      
-      // save config
-      $conf['ContactForm_before'] = stripslashes(@$conf['persoformtop']);
-      $conf['ContactForm_after'] = stripslashes(@$conf['persoformbottom']);
-      
-      conf_update_param('ContactForm_before', $conf['ContactForm_before']);
-      conf_update_param('ContactForm_after', $conf['ContactForm_after']);
-      
-      pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param IN("persoformtop", "persoformbottom");');
-    }
-    
-    // new param 2.5.c
-    if (!isset($new_conf['cf_theme']))
-    {
-      $new_conf['cf_theme'] = 'dark';
-    }
-    
-    // save config
-    $conf['ContactForm'] = serialize($new_conf);
-    conf_update_param('ContactForm', $conf['ContactForm']);
-  }
-  
-  // just in case something went wrong in a previous version
-  if (empty($conf['ContactForm_before']))
-  {
-    $conf['ContactForm_before'] = null;
-    conf_update_param('ContactForm_before', $conf['ContactForm_before']);
-  }
-  
-  if (empty($conf['ContactForm_after']))
-  {
-    $conf['ContactForm_after'] = null;
-    conf_update_param('ContactForm_after', $conf['ContactForm_after']);
-  }
-}
-
-?>
Index: /extensions/ContactForm/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/en_UK/plugin.lang.php	(revision 25871)
+++ /extensions/ContactForm/language/en_UK/plugin.lang.php	(revision 25872)
@@ -59,4 +59,6 @@
 $lang['Send'] = 'Send';
 $lang['Send copy to my email'] = 'Send copy to my email';
+$lang['Invalid redirect URL'] = 'Invalid redirect URL';
+$lang['Name'] = 'Name';
 
 ?>
Index: /extensions/ContactForm/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/fr_FR/plugin.lang.php	(revision 25871)
+++ /extensions/ContactForm/language/fr_FR/plugin.lang.php	(revision 25872)
@@ -60,4 +60,6 @@
 $lang['Send'] = 'Envoyer';
 $lang['Send copy to my email'] = 'Envoyer une copie à mon email';
+$lang['Invalid redirect URL'] = 'URL de redirection invalide';
+$lang['Name'] = 'Nom';
 
 ?>
Index: /extensions/ContactForm/main.inc.php
===================================================================
--- /extensions/ContactForm/main.inc.php	(revision 25871)
+++ /extensions/ContactForm/main.inc.php	(revision 25872)
@@ -31,6 +31,8 @@
   add_event_handler('loc_end_section_init', 'contact_form_section_init');
   add_event_handler('loc_end_index', 'contact_form_page');
-  add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
 }
+
+add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
+add_event_handler('before_parse_mail_template', 'contact_form_mail_template', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
 
 include(CONTACT_FORM_PATH . 'include/functions.inc.php');
@@ -43,45 +45,26 @@
 {
   global $conf, $template, $pwg_loaded_plugins;
-  
-  if (
-    CONTACT_FORM_VERSION == 'auto' or
-    $pwg_loaded_plugins[CONTACT_FORM_ID]['version'] == 'auto' or
-    version_compare($pwg_loaded_plugins[CONTACT_FORM_ID]['version'], CONTACT_FORM_VERSION, '<')
-  )
-  {
-    include_once(CONTACT_FORM_PATH . 'include/install.inc.php');
-    contact_form_install();
-    
-    if ( $pwg_loaded_plugins[CONTACT_FORM_ID]['version'] != 'auto' and CONTACT_FORM_VERSION != 'auto' )
-    {
-      $query = '
-UPDATE '. PLUGINS_TABLE .'
-SET version = "'. CONTACT_FORM_VERSION .'"
-WHERE id = "'. CONTACT_FORM_ID .'"';
-      pwg_query($query);
-      
-      $pwg_loaded_plugins[CONTACT_FORM_ID]['version'] = CONTACT_FORM_VERSION;
-      
-      if (defined('IN_ADMIN'))
-      {
-        $_SESSION['page_infos'][] = 'ContactForm updated to version '. CONTACT_FORM_VERSION;
-      }
-    }
-  }
-  
+
+  include_once(CONTACT_FORM_PATH . 'maintain.inc.php');
+  $maintain = new ContactForm_maintain(CONTACT_FORM_ID);
+  $maintain->autoUpdate(CONTACT_FORM_VERSION, 'install');
+
   $conf['ContactForm'] = unserialize($conf['ContactForm']);
   load_language('plugin.lang', CONTACT_FORM_PATH);
   load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true));
-  
+
   if ($conf['ContactForm']['cf_must_initialize'])
   {
     contact_form_initialize_emails();
   }
-  
-  $conf['ContactForm']['cf_ready'] = count(get_contact_emails());
-  
-  if ($conf['ContactForm']['cf_ready'] && (!is_a_guest() || $conf['ContactForm']['cf_allow_guest']))
+
+  $conf['ContactForm_ready'] = count(get_contact_emails());
+
+  if ($conf['ContactForm_ready'] && (!is_a_guest() || $conf['ContactForm']['cf_allow_guest']))
   {
-    $template->assign('CONTACT_MAIL', true);
+    $template->assign(array(
+      'CONTACT_MAIL' => true,
+      'CONTACT_FORM_PUBLIC' => CONTACT_FORM_PUBLIC,
+      ));
     $template->set_prefilter('tail', 'contact_form_footer_link');
   }
@@ -89,14 +72,12 @@
 
 /**
- * admin plugins menu link 
+ * admin plugins menu link
  */
-function contact_form_admin_menu($menu) 
+function contact_form_admin_menu($menu)
 {
-  array_push($menu, array(
+  $menu[] = array(
     'URL' => CONTACT_FORM_ADMIN,
     'NAME' => 'Contact Form',
-  ));
+  );
   return $menu;
 }
-
-?>
Index: /extensions/ContactForm/maintain.inc.php
===================================================================
--- /extensions/ContactForm/maintain.inc.php	(revision 25871)
+++ /extensions/ContactForm/maintain.inc.php	(revision 25872)
@@ -2,30 +2,134 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-defined('CONTACT_FORM_ID') or define('CONTACT_FORM_ID', basename(dirname(__FILE__)));
-include_once(PHPWG_PLUGINS_PATH . CONTACT_FORM_ID . '/include/install.inc.php');
+class ContactForm_maintain extends PluginMaintain
+{
+  private $installed = false;
 
-function plugin_install() 
-{
-  contact_form_install();
-  define('contact_form_installed', true);
-}
+  function install($plugin_version, &$errors=array())
+  {
+    global $conf, $prefixeTable;
 
-function plugin_activate()
-{
-  if (!defined('contact_form_installed'))
+    // email table
+  $query = '
+CREATE TABLE IF NOT EXISTS `'. $prefixeTable .'contact_form` (
+  `id` smallint(5) NOT NULL AUTO_INCREMENT,
+  `name` varchar(128) NOT NULL,
+  `email` varchar(128) NOT NULL,
+  `active` enum("true","false") NOT NULL DEFAULT "true",
+  `group_name` varchar(128) DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `UNIQUE` (`email`,`group_name`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;';
+    pwg_query($query);
+
+    // configuration
+    if (empty($conf['ContactForm']))
+    {
+      $conf['ContactForm'] = serialize(array(
+        'cf_must_initialize' => true,
+        'cf_menu_link' => true,
+        'cf_subject_prefix' => '%gallery_title%',
+        'cf_default_subject' => 'A comment on your site',
+        'cf_allow_guest' => true,
+        'cf_mandatory_mail' => true,
+        'cf_mandatory_name' => true,
+        'cf_mail_type' => 'text/html',
+        'cf_redirect_url' => null,
+        ));
+
+      $conf['ContactForm_before'] = null;
+      $conf['ContactForm_after'] = null;
+
+      conf_update_param('ContactForm', $conf['ContactForm']);
+      conf_update_param('ContactForm_before', $conf['ContactForm_before']);
+      conf_update_param('ContactForm_after', $conf['ContactForm_after']);
+    }
+    else
+    {
+      $new_conf = is_string($conf['ContactForm']) ? unserialize($conf['ContactForm']) : $conf['ContactForm'];
+
+      // migration 2.4 -> 2.5
+      if (!isset($new_conf['cf_must_initialize']))
+      {
+        // new params
+        $new_conf['cf_default_subject'] = 'A comment on your site';
+        $new_conf['cf_mail_type'] = 'text/html';
+        $new_conf['cf_redirect_url'] = null;
+
+        // move emails to database
+        $emails = array();
+        foreach ($new_conf['cf_admin_mails'] as $email => $data)
+        {
+          $emails[] = array(
+            'email' => $email,
+            'name' => $data['NAME'],
+            'active' => boolean_to_string($data['ACTIVE']),
+            );
+        }
+
+        $new_conf['cf_must_initialize'] = empty($emails);
+
+        mass_inserts(
+          $prefixeTable .'contact_form',
+          array('name','email','active'),
+          $emails
+          );
+
+        // old params
+        unset(
+          $new_conf['comment'], $new_conf['cf_redirect_delay'],
+          $new_conf['cf_separator'], $new_conf['cf_separator_length'],
+          $new_conf['cf_admin_mails']
+          );
+
+        // save config
+        $conf['ContactForm_before'] = stripslashes(@$conf['persoformtop']);
+        $conf['ContactForm_after'] = stripslashes(@$conf['persoformbottom']);
+
+        conf_update_param('ContactForm_before', $conf['ContactForm_before']);
+        conf_update_param('ContactForm_after', $conf['ContactForm_after']);
+
+        conf_delete_param(array('persoformtop','persoformbottom'));
+      }
+
+      // save config
+      $conf['ContactForm'] = serialize($new_conf);
+      conf_update_param('ContactForm', $conf['ContactForm']);
+    }
+
+    // just in case something went wrong in a previous version
+    if (empty($conf['ContactForm_before']))
+    {
+      $conf['ContactForm_before'] = null;
+      conf_update_param('ContactForm_before', $conf['ContactForm_before']);
+    }
+
+    if (empty($conf['ContactForm_after']))
+    {
+      $conf['ContactForm_after'] = null;
+      conf_update_param('ContactForm_after', $conf['ContactForm_after']);
+    }
+  }
+
+  function activate($plugin_version, &$errors=array())
   {
-    contact_form_install();
+    if (!$this->installed)
+    {
+      $this->install($plugin_version, $errors);
+    }
+  }
+
+  function deactivate()
+  {
+  }
+
+
+  function uninstall()
+  {
+    global $prefixeTable;
+
+    pwg_query('DROP TABLE IF EXISTS `'. $prefixeTable .'contact_form`;');
+
+    conf_delete_param(array('ContactForm','ContactForm_before','ContactForm_after'));
   }
 }
-
-function plugin_uninstall() 
-{
-  global $prefixeTable, $conf;
-  
-  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param LIKE "ContactForm%";');
-  pwg_query('DROP TABLE IF EXISTS `'. $prefixeTable .'contact_form`;');
-  
-  unset($conf['ContactForm'], $conf['ContactForm_before'], $conf['ContactForm_after']);
-}
-
-?>
Index: /extensions/ContactForm/template/contact_form.tpl
===================================================================
--- /extensions/ContactForm/template/contact_form.tpl	(revision 25871)
+++ /extensions/ContactForm/template/contact_form.tpl	(revision 25872)
@@ -1,51 +1,35 @@
-{combine_css path=$CONTACT_FORM_PATH|@cat:"template/style.css"}
-{combine_script id="livevalidation" load="footer" path=$CONTACT_FORM_PATH|@cat:"template/livevalidation.min.js"}
+{combine_css path=$CONTACT_FORM_PATH|cat:"template/style.css"}
+{combine_script id="livevalidation" load="footer" path=$CONTACT_FORM_PATH|cat:"template/livevalidation.min.js"}
 
 {footer_script require='livevalidation'}
 {if $contact.mandatory_name and !$contact.is_logged}
 var author = new LiveValidation('author', {ldelim} onlyOnSubmit: true });
-author.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a name'|@translate}" });
+author.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a name'|translate}" });
 {/if}
 
 {if $contact.mandatory_mail and (!$contact.is_logged or empty($contact.email))}
 var email = new LiveValidation('email', {ldelim} onlyOnSubmit: true });
-email.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter an e-mail'|@translate}" });
-email.add(Validate.Email, {ldelim} failureMessage: "{'mail address must be like xxx@yyy.eee (example : jack@altern.org)'|@translate}" });
+email.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter an e-mail'|translate}" });
+email.add(Validate.Email, {ldelim} failureMessage: "{'mail address must be like xxx@yyy.eee (example : jack@altern.org)'|translate}" });
 {/if}
 
 {if $GROUPS}
 var group = new LiveValidation('group', {ldelim} onlyOnSubmit: true })
-group.add(Validate.Exclusion, {ldelim} within: ['-1'], failureMessage: "{'Please choose a category'|@translate}" });
+group.add(Validate.Exclusion, {ldelim} within: ['-1'], failureMessage: "{'Please choose a category'|translate}" });
 {/if}
 
 var subject = new LiveValidation('subject', {ldelim} onlyOnSubmit: true });
-subject.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a subject'|@translate}" });
+subject.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a subject'|translate}" });
 subject.add(Validate.Length, {ldelim} maximum: 100,
-  tooLongMessage: "{'%s must not be more than %d characters long'|@translate|@sprintf:'':100}" 
+  tooLongMessage: "{'%s must not be more than %d characters long'|translate:'':100}"
   });
 
 var content = new LiveValidation('cf_content', {ldelim} onlyOnSubmit: true });
-content.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a message'|@translate}" });
+content.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a message'|translate}" });
 content.add(Validate.Length, {ldelim} maximum: 2000,
-  tooLongMessage: "{'%s must not be more %d characters long'|@translate|@sprintf:'':2000}",
+  tooLongMessage: "{'%s must not be more than %d characters long'|translate:'':2000}",
   });
 {/footer_script}
 
-
-{* <!-- Menubar & titrePage --> *}
-{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
-  {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/stripped.tpl'}
-  {assign var="clear" value="true"}
-{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
-  {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/simple.tpl'}
-  {assign var="clear" value="true"}
-{else}
-  {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/default.tpl'}
-{/if}
-
-
-{if isset($errors) or not empty($infos)}
-{include file='infos_errors.tpl'}
-{/if}
 
 {if $ContactForm_before}
@@ -57,5 +41,5 @@
     <table>
       <tr>
-        <td class="title"><label for="author">{'Your name'|@translate}</label></td>
+        <td class="title"><label for="author">{'Your name'|translate}</label></td>
         <td>
         {if $contact.is_logged}
@@ -68,5 +52,5 @@
       </tr>
       <tr>
-        <td class="title"><label for="email">{'Your e-mail'|@translate}</label></td>
+        <td class="title"><label for="email">{'Your e-mail'|translate}</label></td>
         <td>
         {if $contact.is_logged and !empty($contact.email)}
@@ -80,5 +64,5 @@
       {if $GROUPS}
       <tr>
-        <td class="title"><label for="group">{'Category'|@translate}</label></td>
+        <td class="title"><label for="group">{'Category'|translate}</label></td>
         <td>
           <select name="group" id="group">
@@ -90,9 +74,9 @@
       {/if}
       <tr>
-        <td class="title"><label for="subject">{'Subject'|@translate}</label></td>
+        <td class="title"><label for="subject">{'Subject'|translate}</label></td>
         <td><input type="text" name="subject" id="subject" style="width:400px;" value="{$contact.subject}"></td>
       </tr>
       <tr>
-        <td class="title"><label for="cf_content">{'Message'|@translate}</label></td>
+        <td class="title"><label for="cf_content">{'Message'|translate}</label></td>
         <td><textarea name="content" id="cf_content" rows="10" style="width:400px;">{$contact.content}</textarea></td>
       </tr>
@@ -100,10 +84,10 @@
         <td class="title">&nbsp;</td>
         <td>
-          <input class="submit" type="submit" name="send_mail" value="{'Send'|@translate}">
-          <label><input type="checkbox" name="send_copy"> {'Send copy to my email'|@translate}</label>
+          <input class="submit" type="submit" name="send_mail" value="{'Send'|translate}">
+          <label><input type="checkbox" name="send_copy"> {'Send copy to my email'|translate}</label>
         </td>
       </tr>
     </table>
-    
+
     <input type="hidden" name="key" value="{$KEY}" />
   </form>
@@ -113,6 +97,2 @@
 <div class="contact desc">{$ContactForm_after}</div>
 {/if}
-
-{if $clear}<div style="clear: both;"></div>
-</div>{/if}
-</div>{* <!-- content --> *}
Index: /extensions/ContactForm/template/livevalidation.min.js
===================================================================
--- /extensions/ContactForm/template/livevalidation.min.js	(revision 25871)
+++ /extensions/ContactForm/template/livevalidation.min.js	(revision 25872)
Index: /extensions/ContactForm/template/style.css
===================================================================
--- /extensions/ContactForm/template/style.css	(revision 25871)
+++ /extensions/ContactForm/template/style.css	(revision 25872)
@@ -37,8 +37,8 @@
   color:#cc0000;
 }
-.LV_invalid_field, 
-input.LV_invalid_field:hover, 
+.LV_invalid_field,
+input.LV_invalid_field:hover,
 input.LV_invalid_field:active,
-textarea.LV_invalid_field:hover, 
+textarea.LV_invalid_field:hover,
 textarea.LV_invalid_field:active {
   border: 1px solid #cc0000;
Index: /extensions/ContactForm/template/text/html/mail.tpl
===================================================================
--- /extensions/ContactForm/template/text/html/mail.tpl	(revision 25872)
+++ /extensions/ContactForm/template/text/html/mail.tpl	(revision 25872)
@@ -0,0 +1,11 @@
+<style type="text/css">{strip}
+
+{/strip}</style>
+
+<p>
+  <b>{'Name'|translate}:</b> {$CONTACT.author}<br>
+  <b>{'Email address'|translate}:</b> {$CONTACT.email}
+  {if $CONTACT.show_ip}<br>{'IP: %s'|translate:$CONTACT.ip}{/if}
+</p>
+
+<blockquote>{$CONTACT.content}</blockquote>
Index: /extensions/ContactForm/template/text/plain/mail.tpl
===================================================================
--- /extensions/ContactForm/template/text/plain/mail.tpl	(revision 25872)
+++ /extensions/ContactForm/template/text/plain/mail.tpl	(revision 25872)
@@ -0,0 +1,6 @@
+{'Name'|translate}: {$CONTACT.author}
+{'Email address'|translate}: {$CONTACT.email}
+{if $CONTACT.show_ip}{'IP: %s'|translate:$CONTACT.ip}{/if}
+
+--------------------
+{$CONTACT.content}
