Index: /extensions/ContactForm/admin/cf_config.tab.php
===================================================================
--- /extensions/ContactForm/admin/cf_config.tab.php	(revision 3743)
+++ /extensions/ContactForm/admin/cf_config.tab.php	(revision 3743)
@@ -0,0 +1,107 @@
+<?php
+/* $Id: cf_config.tab.php,v 1.1 2009/08/17 07:24:11 Criss Exp $ */
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+check_status(ACCESS_ADMINISTRATOR);
+
+
+if (isset($_POST['submit'])) {
+  global $page;
+  // Allow guest
+  $new_value = false;
+  if (isset($_POST['cf_guest_allowed'])) {
+      if ('1' == $_POST['cf_guest_allowed']) {
+          $new_value = true;
+      }
+  }
+  $cf_config->set_value(CF_CFG_ALLOW_GUEST, $new_value);
+
+  // Mandatory name
+  $new_value = false;
+  if (isset($_POST['cf_mandatory_name'])) {
+      if ('1' == $_POST['cf_mandatory_name']) {
+          $new_value = true;
+      }
+  }
+  $cf_config->set_value(CF_CFG_NAME_MANDATORY, $new_value);
+  
+  // Mandatory mail
+  $new_value = false;
+  if (isset($_POST['cf_mandatory_mail'])) {
+      if ('1' == $_POST['cf_mandatory_mail']) {
+          $new_value = true;
+      }
+  }
+  $cf_config->set_value(CF_CFG_MAIL_MANDATORY, $new_value);
+
+  // Link
+  $new_value = '';
+  if (isset($_POST['cf_link'])) {
+    $new_value = trim(stripslashes($_POST['cf_link']));
+    $str_valid = preg_match_all('/\w{1}\w*/i', $new_value, $match);
+    if (1 != $str_valid) {
+      array_push($page['errors'], l10n('cf_link_error'));
+    } else {
+      $cf_config->set_value(CF_CFG_CONTACT_LINK, $new_value);
+    }
+  }
+  
+  // Prefix
+  $new_value = '';
+  if (isset($_POST['cf_mail_prefix'])) {
+    $new_value = trim(stripslashes($_POST['cf_mail_prefix']));
+    $cf_config->set_value(CF_CFG_SUBJECT_PREFIX, $new_value);
+  }
+
+  // Separator
+  $new_value = '';
+  if (isset($_POST['cf_separator'])) {
+    $new_value = trim(stripslashes($_POST['cf_separator']));
+    $cf_config->set_value(CF_CFG_SEPARATOR, $new_value);
+  }
+  if (isset($_POST['cf_separator_length'])) {
+    $new_value = trim(stripslashes($_POST['cf_separator_length']));
+    if (ctype_digit($new_value)) {
+      $cf_config->set_value(CF_CFG_SEPARATOR_LEN, $new_value);
+    } else {
+      array_push($page['errors'], l10n('cf_length_not_integer'));
+    }
+  }
+  
+  // Redirect delay
+  if (isset($_POST['cf_redirect_delay'])) {
+    $new_value = trim(stripslashes($_POST['cf_redirect_delay']));
+    if (ctype_digit($new_value)) {
+      $cf_config->set_value(CF_CFG_REDIRECT_DELAY, $new_value);
+    } else {
+      array_push($page['errors'], l10n('cf_delay_not_integer'));
+    }
+  }
+  
+  // Save config
+  $cf_config->save_config();
+  $saved = $cf_config->save_config();
+  if ($saved) {
+      array_push($page['infos'], l10n('cf_config_saved'));
+  } else {
+      array_push($page['errors'], l10n('cf_config_saved_with_errors'));
+  }
+  
+}
+
+$config_values = array(
+    'GUEST'             => $cf_config->get_value(CF_CFG_ALLOW_GUEST)?
+                              CF_CHECKED:'',
+    'NEED_NAME'         => $cf_config->get_value(CF_CFG_NAME_MANDATORY)?
+                              CF_CHECKED:'',
+    'NEED_MAIL'         => $cf_config->get_value(CF_CFG_MAIL_MANDATORY)?
+                              CF_CHECKED:'',
+    'PREFIX'            => $cf_config->get_value(CF_CFG_SUBJECT_PREFIX),
+    'SEPARATOR'         => $cf_config->get_value(CF_CFG_SEPARATOR),
+    'SEPARATOR_LENGTH'  => $cf_config->get_value(CF_CFG_SEPARATOR_LEN),
+    'REDIRECT_DELAY'    => $cf_config->get_value(CF_CFG_REDIRECT_DELAY),
+    'LINK'              => $cf_config->get_value(CF_CFG_CONTACT_LINK),
+  );
+
+$template->assign('CF_CONFIG', $config_values);  
+
+?>
Index: /extensions/ContactForm/admin/cf_language.tab.php
===================================================================
--- /extensions/ContactForm/admin/cf_language.tab.php	(revision 3743)
+++ /extensions/ContactForm/admin/cf_language.tab.php	(revision 3743)
@@ -0,0 +1,57 @@
+<?php
+/* $Id: cf_language.tab.php,v 1.1 2009/08/17 07:24:11 Criss Exp $ */
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+check_status(ACCESS_ADMINISTRATOR);
+
+$all_languages = get_languages();
+$cf_languages = $cf_config->get_config_lang();
+$cf_item_selected='';
+if (isset($_POST['submit'])) {
+  global $page;
+  
+  if (isset($_POST['cf_item']) and is_array($_POST['cf_item'])) {
+    CF_Debug::add_debug($_POST['cf_item'], 'POST');
+    foreach($_POST['cf_item'] as $key => $values) {
+      if (is_array($values)) {
+        CF_Debug::add_debug($values, 'POST');
+        foreach($values as $language => $content) {
+          $cf_languages->set_value($language, $key, $content);
+        }
+      }
+    }
+  }
+  CF_Debug::add_debug( $cf_languages, 'POST');
+  // Save config
+  $cf_config->save_config();
+  $saved = $cf_config->save_config();
+  if ($saved) {
+      array_push($page['infos'], l10n('cf_config_saved'));
+  } else {
+      array_push($page['errors'], l10n('cf_config_saved_with_errors'));
+  }
+  
+  if (isset($_POST['cf_select'])) {
+    $cf_item_selected = $_POST['cf_select']; 
+  }
+}
+
+$config_keys=array();
+$config_values=array();
+foreach($cf_languages->get_keys() as $key) {
+  $current = array();
+  foreach($all_languages as $lang_key => $lang_name) {
+    $current[$lang_key] = array(
+        'LANG'  => $lang_key,
+        'NAME'  => $lang_name,
+        'VALUE' => $cf_languages->get_value($lang_key, $key),
+      );
+  }
+  $config_keys[$key] = l10n($key . '_label');
+  $config_values[$key] = $current;
+}
+
+$template->assign('CF_CONFIG_KEYS_SELECTED', $cf_item_selected);
+$template->assign('CF_CONFIG_KEYS', $config_keys);
+$template->assign('CF_CONFIG_VALUES', $config_values);
+
+?>
Index: /extensions/ContactForm/admin/index.php
===================================================================
--- /extensions/ContactForm/admin/index.php	(revision 3743)
+++ /extensions/ContactForm/admin/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 15:45:14 Criss Exp $
+// | last update   : $Date: 2009/08/13 15:45:14 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/admin/template/cf_config.tab.tpl
===================================================================
--- /extensions/ContactForm/admin/template/cf_config.tab.tpl	(revision 3743)
+++ /extensions/ContactForm/admin/template/cf_config.tab.tpl	(revision 3743)
@@ -0,0 +1,68 @@
+{* $Id: cf_config.tab.tpl,v 1.1 2009/08/17 07:24:11 Criss Exp $ *}
+<div class="titrePage">
+    <h2>{$CF.TITLE} [{$CF.VERSION}]<br>{'cf_config'|@translate}</h2>
+</div>
+<h3>{'cf_config_desc'|@translate}</h3>
+<form method="post" action="{$CF.F_ACTION}" id="update" enctype="multipart/form-data">
+<fieldset>
+  <legend>{'cf_label_config'|@translate}</legend>
+  <ul>
+    <li>
+      <label>
+        <input type="checkbox" name="cf_guest_allowed" value="1" {$CF_CONFIG.GUEST} />
+        {'cf_guest_allowed'|@translate}
+      </label>
+    </li>
+    <li>
+      <label>
+        <input type="checkbox" name="cf_mandatory_name" value="1" {$CF_CONFIG.NEED_NAME} />
+        {'cf_mandatory_name'|@translate}
+      </label>
+    </li>
+    <li>
+      <label>
+        <input type="checkbox" name="cf_mandatory_mail" value="1" {$CF_CONFIG.NEED_MAIL} />
+        {'cf_mandatory_mail'|@translate}
+      </label>
+    </li>
+    <li>
+      <label>
+        <input type="text" name="cf_link" value="{$CF_CONFIG.LINK}" />
+        {'cf_link'|@translate}
+      </label>
+    </li>
+  </ul>
+</fieldset>
+<fieldset>
+  <legend>{'cf_label_mail'|@translate}</legend>
+  <ul>
+    <li>
+      <label>
+        <input type="text" name="cf_mail_prefix" value="{$CF_CONFIG.PREFIX}" maxlength="50" size="50"/>
+        {'cf_mail_prefix'|@translate}
+      </label>
+    </li>
+    <li>
+      <label>
+        <input type="text" name="cf_separator" value="{$CF_CONFIG.SEPARATOR}" maxlength="2" size="2"/>
+        {'cf_separator'|@translate}
+      </label>
+    </li>
+    <li>
+      <label>
+        <input type="text" name="cf_separator_length" value="{$CF_CONFIG.SEPARATOR_LENGTH}" maxlength="2" size="2"/>
+        {'cf_separator_length'|@translate}
+      </label>
+    </li>
+    <li>
+      <label>
+        <input type="text" name="cf_redirect_delay" value="{$CF_CONFIG.REDIRECT_DELAY}" maxlength="2" size="2"/>
+        {'cf_redirect_delay'|@translate}
+      </label>
+    </li>
+  </ul>
+</fieldset>
+
+{* ----------- CONFIGURATION ----------- *}
+<p><input class="submit" type="submit" value="{'cf_validate'|@translate}" name="submit"></p>
+</form>
Index: /extensions/ContactForm/admin/template/cf_language.tab.tpl
===================================================================
--- /extensions/ContactForm/admin/template/cf_language.tab.tpl	(revision 3743)
+++ /extensions/ContactForm/admin/template/cf_language.tab.tpl	(revision 3743)
@@ -0,0 +1,55 @@
+{* $Id: cf_language.tab.tpl,v 1.1 2009/08/17 07:24:12 Criss Exp $ *}
+{literal}
+<script type="text/javascript">
+function cf_update_display() {
+  var select_item = document.getElementById('cf_select');
+  for (var i=0 ; i<select_item.length ; i++) {
+    var div_item = document.getElementById('cf_div_' + select_item[i].value);
+    var visible = select_item[i].selected;
+    cf_set_visible(div_item, visible);
+  }
+}
+</script>
+{/literal}<div class="titrePage">
+    <h2>{$CF.TITLE} [{$CF.VERSION}]<br>{'cf_language'|@translate}</h2>
+</div>
+<h3>{'cf_language_desc'|@translate}</h3>
+
+<form method="post" action="{$CF.F_ACTION}" id="update" enctype="multipart/form-data">
+<table>
+  <tr>
+    <td style="vertical-align: top;">
+      <div class="cf-label">{'cf_select_item'|@translate}</div>
+      <select size="1" name="cf_select" id="cf_select" onclick="cf_update_display();">
+      {html_options options=$CF_CONFIG_KEYS selected=$CF_CONFIG_KEYS_SELECTED}
+      </select>
+    </td>
+    <td>&nbsp;</td>
+    <td>
+      {foreach from=$CF_CONFIG_VALUES item=config_value key=config_key name=config_keys}
+      <div id="cf_div_{$config_key}" class="cf-lang">
+        <label class="cf-lang">{$CF_CONFIG_KEYS.$config_key}</label>
+        <table>
+        {foreach from=$config_value item=language_values key=language_key}
+          <tr>
+              <td align="right">{$language_values.NAME}</td>
+              <td>&nbsp;</td>
+              <td>
+                <input type="text" name="cf_item[{$config_key}][{$language_key}]" value="{$language_values.VALUE}"/>
+              </td>
+          </tr>
+        {/foreach}
+        </table>
+      </div>
+      {/foreach}
+    </td>
+  </tr>
+</table>
+{* ----------- LANGUAGES ----------- *}
+<p><input class="submit" type="submit" value="{'cf_validate'|@translate}" name="submit"></p>
+</form>
+{literal}
+<script type="text/javascript">
+cf_update_display();
+</script>
+{/literal}
Index: /extensions/ContactForm/admin/template/index.php
===================================================================
--- /extensions/ContactForm/admin/template/index.php	(revision 3743)
+++ /extensions/ContactForm/admin/template/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 15:45:15 Criss Exp $
+// | last update   : $Date: 2009/08/13 15:45:15 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/classes/cf_config.class.php
===================================================================
--- /extensions/ContactForm/classes/cf_config.class.php	(revision 3743)
+++ /extensions/ContactForm/classes/cf_config.class.php	(revision 3743)
@@ -0,0 +1,173 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+/**
+ * CF_Config class
+ */
+class CF_Config {
+  static $default_config = array();
+  
+  protected $config_values;
+  protected $db_key = null;
+  protected $db_comment = null;
+  protected $config_lang;
+  
+  /* ************************ */
+  /* ** Constructor        ** */
+  /* ************************ */
+
+  function CF_Config() {
+  }
+  
+  /* ************************ */
+  /* ** Accessors          ** */
+  /* ************************ */
+  
+  function get_value($key) {
+      if (isset($this->config_values[$key])) {
+          return $this->config_values[$key];
+      }
+      return null;
+  }
+
+  function set_value($key, $value) {
+      $this->config_values[$key] = $value;
+  }
+
+  function get_version() {
+    if (isset($this->config_values[CF_CFG_VERSION])) {
+      return $this->config_values[CF_CFG_VERSION];
+    }
+    return CF_VERSION;
+  }
+
+  function set_db_key($key) {
+    $this->db_key = $key;
+  }
+  
+  function get_config_lang() {
+    return $this->config_lang;
+  }
+  
+  function get_lang_value($item, $language=null) {
+    if (null == $language) {
+      global $user;
+      $language = $user['language'];
+    }
+    $value = $this->config_lang->get_value($language, $item);
+    if (empty($value)) {
+      cf_switch_to_default_lang();
+      $value = l10n($item);
+      cf_switch_back_to_user_lang();
+    }
+    return $value;
+  }
+  
+  /* ************************ */
+  /* ** Loading methods    ** */
+  /* ************************ */
+  
+  function load_config() {
+    $this->config_lang = null;
+    if (null != $this->db_key) {
+      $query = '
+          SELECT value
+          FROM '.CONFIG_TABLE.'
+          WHERE param = \''. $this->db_key .'\'
+          ;';
+      $result = pwg_query($query);
+      if($result) {
+        $row = mysql_fetch_row($result);
+        if(is_string($row[0])) {
+          $this->config_values = unserialize($row[0]);
+          if (isset($this->config_values['config_lang'])) {
+            $this->config_lang = $this->config_values['config_lang'];
+            $this->config_values['config_lang'] = null;
+          }
+        }
+      }
+    }
+//    CF_Debug::add_debug($this->config_lang, 'CF_Config::load_config');
+    $this->load_default_config();
+  }
+  
+  protected function load_default_config() {
+    if (null == $this->config_lang) {
+      $this->config_lang = new CF_Config_Lang();
+      $this->config_values['config_lang'] = null;
+      CF_Debug::add_debug($this->config_lang,'CF_Config::load_default_config');
+    }
+    $this->config_lang->set_default_values();
+    $this->config_lang->update_keys();
+    foreach (CF_Config::$default_config as $key => $value) {
+      if (!isset($this->config_values[$key])) {
+        $this->config_values[$key] = $value;
+      }
+    }
+  }
+  
+  /* ************************ */
+  /* ** Saving  methods    ** */
+  /* ************************ */
+
+  function save_config() {
+    if (null == $this->db_key) {
+      return false;
+    }
+    $this->config_values['config_lang'] = $this->config_lang;
+    if (!isset($this->config_values[CF_CFG_COMMENT])) {
+      $this->set_value(CF_CFG_COMMENT, CF_CFG_DB_COMMENT);
+    }
+    $db_comment = sprintf($this->config_values[CF_CFG_COMMENT],
+                          $this->db_key,
+                          $this->get_version());
+    $query = '
+        REPLACE INTO '.CONFIG_TABLE.'
+        VALUES(
+          \''. $this->db_key .'\',
+          \''.serialize($this->config_values).'\',
+          \''. $db_comment . '\')
+        ;';
+    $result = pwg_query($query);
+    if($result) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+  
+  /* ************************ */
+  /* ** Maintain  methods  ** */
+  /* ************************ */
+  
+  static function install($plugin_id) {
+    $config = new CF_Config();
+    $config->set_db_key($plugin_id);
+    $config->load_config();
+    $default_config = CF_Config::$default_config;
+    if (isset($default_config[CF_CFG_VERSION])) {
+      // Override version
+      $config->set_value(CF_CFG_VERSION, $default_config[CF_CFG_VERSION]);
+    }
+    if (isset($default_config[CF_CFG_COMMENT])) {
+      // Override comment
+      $config->set_value(CF_CFG_COMMENT, $default_config[CF_CFG_COMMENT]);
+    }
+    $result = $config->save_config();
+    return $result;
+  }
+
+  static function uninstall($plugin_id) {
+    $query = '
+        DELETE FROM '.CONFIG_TABLE.'
+        WHERE param = \'' . $plugin_id . '\'
+        ;';
+    $result = pwg_query($query);
+    if($result) {
+      return true;
+    } else {
+      return false;
+    }
+  }  
+}
+?>
Index: /extensions/ContactForm/classes/cf_config_lang.class.php
===================================================================
--- /extensions/ContactForm/classes/cf_config_lang.class.php	(revision 3743)
+++ /extensions/ContactForm/classes/cf_config_lang.class.php	(revision 3743)
@@ -0,0 +1,123 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+class CF_Config_Lang {
+  static $default_keys = array();
+  static private $available_languages = null;
+  protected $defined_languages = array();
+  protected $added_languages = array();
+  protected $keys = array();
+  
+  static private function update_available_languages() {
+    CF_Config_Lang::$available_languages = array();
+    foreach(get_dirs(CF_LANGUAGE) as $language) {
+      array_push(CF_Config_Lang::$available_languages, $language);
+    }
+    return CF_Config_Lang::$available_languages;
+  }
+  static function get_available_languages() {
+    if (empty(CF_Config_Lang::$available_languages)) {
+      CF_Config_Lang::update_available_languages();
+    }
+    return CF_Config_Lang::$available_languages;
+  }
+  /* ************************ */
+  /* ** Constructor        ** */
+  /* ************************ */
+
+  function CF_Config_Lang() {
+    $this->init();
+  }
+
+  /* ************************ */
+  /* ** Accessors          ** */
+  /* ************************ */
+
+  function update_keys() {
+    $this->keys = array();
+    foreach($this->get_merged_values() as $language => $keys) {
+      foreach($keys as $key => $value) {
+        $this->add_key($key);
+      }
+    }
+  }
+  
+  function set_default_values() {
+    foreach(CF_Config_Lang::$default_keys as $default_key => $default_values) {
+      foreach($default_values as $language => $value) {
+        if (empty($this->defined_languages[$language][$default_key])) {
+          $this->defined_languages[$language][$default_key] = $value;
+        }
+      }
+      $this->add_key($default_key);
+    }
+  }
+  
+  function get_keys() {
+    return $this->keys;
+  }
+  
+  function add_key($key) {
+    if (in_array($key, $this->keys)) {
+      // already exists
+      return;
+    }
+    $this->keys[]=$key;
+    // Add key to all languages
+    foreach($this->automatic_values as $language => $keys) {
+      if (!isset($this->defined_languages[$language][$key])) {
+        $this->defined_languages[$language][$key] = '';
+      }
+    }
+    foreach($this->added_languages as $language => $keys) {
+      if (!isset($this->added_languages[$language][$key])) {
+        $this->added_languages[$language][$key] = '';
+      }
+    }
+  }
+  
+  function get_value($language=null, $key=null) {
+    $values = $this->get_merged_values();
+    if (null == $language) {
+      return $values;
+    }
+    if (!isset($values[$language])) {
+      return null;
+    }
+    if (null == $key) {
+      return $values[$language];
+    }
+    if (!isset($values[$language][$key]) or empty($values[$language][$key])) {
+      return null;
+    }
+    return $values[$language][$key];
+  }
+  
+  function set_value($language, $key, $value) {
+    if (isset($this->defined_languages[$language])) {
+      $this->defined_languages[$language][$key] = $value;
+    } else {
+      if (!isset($this->added_languages[$language])) {
+        $this->added_languages[$language] = array();
+      }
+      $this->added_languages[$language][$key] = $value;
+    }
+    $this->add_key($key);
+  }
+  
+  /* ************************ */
+  /* ** Private functions  ** */
+  /* ************************ */
+
+  protected function get_merged_values() {
+    return array_merge_recursive($this->defined_languages, $this->added_languages);
+  }
+  
+  protected function init() {
+    $this->automatic_values = array();
+    foreach(CF_Config_Lang::get_available_languages() as $language) {
+      $this->defined_languages[$language] = array();
+    }
+  }
+}
+?>
Index: /extensions/ContactForm/classes/cf_debug.class.php
===================================================================
--- /extensions/ContactForm/classes/cf_debug.class.php	(revision 3743)
+++ /extensions/ContactForm/classes/cf_debug.class.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+class CF_Debug {
+  static $debug=array();
+  
+  static function show_debug() {
+    if (!defined('CF_DEBUG_ACTIVE') or !CF_DEBUG_ACTIVE) {
+      return;
+    }
+    echo '<pre>';
+    foreach(CF_Debug::$debug as $label => $values) {
+      echo '{== BEGIN ' . $label . ' ==}<br>';
+      foreach($values as $debug_value) {
+        echo $debug_value . '<br>';
+      }
+      echo '{== END   ' . $label . ' ==}<br>';
+    }
+    echo '</pre><br>';
+  }
+  static function add_debug($variable, $label=null) {
+    $value = print_r($variable, true);
+    if (null == $label) {
+      $label = 'CF_Debug';
+    }
+    if (!isset(CF_Debug::$debug[$label])) {
+      CF_Debug::$debug[$label] = array();
+    }
+    array_push(CF_Debug::$debug[$label], $value);
+  }
+  
+}
+?>
Index: /extensions/ContactForm/classes/cf_plugin.class.php
===================================================================
--- /extensions/ContactForm/classes/cf_plugin.class.php	(revision 3743)
+++ /extensions/ContactForm/classes/cf_plugin.class.php	(revision 3743)
@@ -0,0 +1,433 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+/**
+ * CF_Plugin class
+ */
+class CF_Plugin {
+  protected $plugin_id;
+  protected $plugin_title;
+  protected $config;
+  protected $debug=array();
+  
+  /* ************************ */
+  /* ** Constructor        ** */
+  /* ************************ */
+
+  function CF_Plugin($plugin_id, $title=CF_TITLE) {
+    $this->plugin_id = $plugin_id;
+    $this->plugin_title = $title;
+    $this->config = new CF_Config();
+    $this->config->set_db_key(CF_CFG_DB_KEY);
+    $this->config->load_config();
+    $this->config->set_value(CF_CFG_COMMENT, CF_CFG_DB_COMMENT);
+  }
+  
+  /* ************************ */
+  /* ** Trigger management ** */
+  /* ************************ */
+  
+  function get_admin_plugin_menu_links($menu) {
+    array_push(
+        $menu,
+        array(
+            'NAME' => $this->get_title(),
+            'URL'  => $this->get_plugin_admin_url()
+        )
+    );
+    return $menu;
+  }
+  
+  function loc_begin_page_header() {
+    global $template;
+    $cf_values = array(
+        'TEXT'  => $this->config->get_lang_value('contact_form_footer'),
+        'URL'   => make_index_url(array('section' => CF_URL_PARAMETER)),
+      );
+    $template->assign('CF_FOOTER_VALUES', $cf_values);
+    $template->assign($this->config->get_value(CF_CFG_CONTACT_LINK),
+                      $this->get_html_contact_form_link());
+  }
+  
+  function blockmanager_apply($aMenuRefArray) {
+    if (!$this->check_allowed()) {
+      return;
+    }
+    $menu = &$aMenuRefArray[0];
+    $block_mbMenu = $menu->get_block('mbMenu');
+    if (null == $block_mbMenu) {
+      return;
+    }
+    // Include language advices
+    load_language('plugin.lang', CF_PATH);
+    
+    if (!isset($block_mbMenu->data[CF_MENUBAR_KEY])) {
+      $contact_form_menu = array(
+          'TITLE' => $this->config->get_lang_value('contact_form_title'),
+          'NAME'  => $this->config->get_lang_value('contact_form'),
+          'URL'   => make_index_url(array('section' => CF_URL_PARAMETER)),
+        );
+      $block_mbMenu->data[CF_MENUBAR_KEY] = $contact_form_menu;
+    }
+    
+  }
+  
+  function loc_end_index() {
+    if ('index' != script_basename()) {
+      return;
+    }
+    if (!$this->check_allowed()) {
+      return;
+    }
+    global $tokens;
+    $form_requested = false;
+    foreach($tokens as $token) {
+      if ($token == CF_URL_PARAMETER) {
+        $form_requested = true;
+      }
+    }
+    if ($form_requested) {
+      if (isset($_POST['cf_key'])) {
+        $this->valid_form();
+      } else {
+        $this->display_form($this->create_infos_array());
+      }
+    }
+  }
+
+  function send_mail_content($mail_content) {
+    remove_event_handler('send_mail_content',             
+                          array(&$this, 'send_mail_content'));
+    global $user,$conf_mail,$conf;
+    if (!isset($conf_mail)) {
+      $conf_mail = get_mail_configuration();
+    }
+    $keyargs_content_admin_info = array(
+      get_l10n_args('Connected user: %s', $user['username']),
+      get_l10n_args('IP: %s', $_SERVER['REMOTE_ADDR']),
+      get_l10n_args('Browser: %s', $_SERVER['HTTP_USER_AGENT'])
+    );
+    $newline = "\n";
+    $separator  = $newline;
+    $separator .= str_repeat($this->config->get_value(CF_CFG_SEPARATOR),
+                             $this->config->get_value(CF_CFG_SEPARATOR_LEN));
+    $separator .= $newline;
+    if ('text/html' == $conf_mail['default_email_format']) {
+      $newline = "<br/>";
+      $separator .= '<hr style="width: ';
+      $separator .= $this->config->get_value(CF_CFG_SEPARATOR_LEN);
+      $separator .= 'em; text-align: left;" />';
+    }
+    $footer  = $newline;
+    $footer .= $separator;
+    $footer .= l10n_args($keyargs_content_admin_info, $newline);
+    $footer .= $separator;
+    
+    $mail_content = str_replace(CF_SEPARATOR_PATTERN, $footer, $mail_content);
+    return $mail_content;
+  }
+  
+  function loc_end_page_tail() {
+    CF_Debug::show_debug();
+  }
+  
+  /* ************************ */
+  /* ** Accessors          ** */
+  /* ************************ */
+
+  function get_config() {
+    return $this->config;
+  }
+
+  function get_version() {
+    return $this->config->get_version();
+  }
+  
+  function get_title() {
+    return $this->plugin_title;
+  }
+  
+  /* ************************ */
+  /* ** Private functions  ** */
+  /* ************************ */
+  
+  protected function get_html_contact_form_link() {
+    global $template;
+    $cf_link = array(
+        'TEXT'  => $this->config->get_lang_value('contact_form_link'),
+        'URL'   => make_index_url(array('section' => CF_URL_PARAMETER)),
+      );
+    $template->set_filenames(array(
+        'contact_form_link' => realpath(cf_get_template('cf_link.tpl')),
+      ));
+    $template->assign('CF_LINK', $cf_link);
+    
+    $link = $template->parse('contact_form_link', true);
+    return $link;
+  }
+  
+  protected function display_form($infos) {
+    global $template,$user;
+
+    $template->set_filenames(array(
+        'index'       => realpath(cf_get_template('cf_index.tpl')),
+        'cf_title'    => realpath(cf_get_template('cf_title.tpl')),
+        'cf_form'     => realpath(cf_get_template('cf_form.tpl')),
+        'cf_messages' => realpath(cf_get_template('cf_messages.tpl')),
+      ));
+    $template->block_html_head( '',
+              '<link rel="stylesheet" type="text/css" '.
+              'href="' . CF_INCLUDE . 'contactform.css' . '">',
+              $smarty, $repeat);
+    $template->block_html_head( '',
+              '<script type="text/javascript" '.
+              'src="' . CF_INCLUDE . 'contactform.js' . '">'.
+              '</script>',
+              $smarty, $repeat);
+    $cf = array(
+        'TITLE'     => 'contact_form_title',
+        'NEED_NAME' => $this->config->get_value(CF_CFG_NAME_MANDATORY),
+        'NEED_MAIL' => $this->config->get_value(CF_CFG_MAIL_MANDATORY),
+        'F_ACTION'  => make_index_url(array('section' => CF_URL_PARAMETER)),
+        'LOGGED'    => !is_a_guest(),
+        'ID'        => $infos['cf_id'],
+        'EMAIL'     => $infos['cf_from_mail'],
+        'NAME'      => $infos['cf_from_name'],
+        'SUBJECT'   => $infos['cf_subject'],
+        'MESSAGE'   => $infos['cf_message'],
+        'KEY'       => get_comment_post_key($infos['cf_id']),
+      );
+    if (!empty($infos['errors'])) {
+      $template->assign('errors', $infos['errors']);
+    }
+    if (!empty($infos['infos'])) {
+      $template->assign('infos', $infos['infos']);
+    }
+    $template->assign('CF', $cf);
+    $template->assign_var_from_handle('CF_TITLE', 'cf_title');
+    $template->assign_var_from_handle('CF_MESSAGES', 'cf_messages');
+    $template->assign_var_from_handle('CF_FORM', 'cf_form');
+  }
+
+  protected function redirect($redirect_url, $infos) {
+    global $template;
+    $template->set_filenames(array(
+        'cf_redirect' => realpath(cf_get_template('cf_redirect.tpl')),
+        'cf_title'    => realpath(cf_get_template('cf_title.tpl')),
+        'cf_messages' => realpath(cf_get_template('cf_messages.tpl')),
+      ));
+    $template->block_html_head( '',
+              '<link rel="stylesheet" type="text/css" '.
+              'href="' . CF_INCLUDE . 'contactform.css' . '">',
+              $smarty, $repeat);
+    $cf = array(
+        'TITLE'     => 'contact_redirect_title',
+        'CSS'       => '<link rel="stylesheet" type="text/css" '.
+                       'href="' . CF_INCLUDE . 'contactform.css' . '">'
+      );
+              
+    if (!empty($infos['infos'])) {
+      $template->assign('infos', $infos['infos']);
+    }
+    $template->assign('CF', $cf);
+    $template->assign_var_from_handle('CF_TITLE', 'cf_title');
+    $template->assign_var_from_handle('CF_MESSAGES', 'cf_messages');
+    $redirect_msg = $template->parse('cf_redirect', true);
+    $redirect_delay = $this->config->get_value(CF_CFG_REDIRECT_DELAY);
+    redirect_html($redirect_url, $redirect_msg, $redirect_delay);
+  }
+  
+  protected function valid_form() {
+    if ($this->check_form_params($infos)) {
+      global $template;
+      if (!$this->send_message($infos)) {
+        // Include language advices
+        load_language('plugin.lang', CF_PATH);
+        $this->display_form($infos);
+      } else {
+        $this->redirect(make_index_url(),$infos);
+      }
+    } else {
+      $this->display_form($infos);
+    }
+  }
+  
+  protected function send_message(&$infos) {
+    //redirect(make_index_url());
+//    include(PHPWG_ROOT_PATH . 'include/functions_mail.inc.php');
+    $webmaster_mail = get_webmaster_mail_address();
+    if (null == $webmaster_mail) {
+      $webmaster_mail = '';
+    }
+    $admin_mails = cf_get_admins_emails($webmaster_mail);
+    if (('' == $webmaster_mail) and (0 == count($admin_mails))) {
+      // No admin mail...
+      return true;
+    }
+    
+    global $conf,$user;
+    cf_switch_to_default_lang();
+    
+    $from = format_email($infos['cf_from_name'], $infos['cf_from_mail']);
+    $subject_prefix = $this->config->get_value(CF_CFG_SUBJECT_PREFIX);
+    if (empty($subject_prefix)) {
+      $subject_prefix  = '['.CF_DEFAULT_PREFIX.'] ';
+    }
+    $subject  = '['.$subject_prefix.'] ';
+    $subject .= $infos['cf_subject'];
+    $content  = "\n\n".$infos['cf_message']."\n";
+    $content .= CF_SEPARATOR_PATTERN;
+    $mail_args = array(
+        'from' => $from,
+        'Bcc' => $admin_mails,
+        'subject' => $subject,
+        'content' => $content,
+        'content_format' => 'text/plain',
+      );
+    add_event_handler('send_mail_content',             
+                      array(&$this, 'send_mail_content'));
+    $return = @pwg_mail(
+      $webmaster_mail,
+      $mail_args
+    );
+    cf_switch_back_to_user_lang();
+    if (!$return) {
+      array_push( $infos['errors'], l10n('cf_error_sending_mail'));
+    } else {
+      array_push( $infos['infos'], l10n('cf_sending_mail_successful'));
+    }
+    return $return;
+  }
+  
+  protected function check_form_params(&$infos) {
+    // Include language advices
+    load_language('plugin.lang', CF_PATH);
+    
+    $infos = $this->create_infos_array(false);
+    $params_ok = true;
+    $return = '';
+    $value = '';
+    // Key
+    if ($this->check_key()) {
+      $infos['cf_id'] = trim( stripslashes($_POST['cf_id']));
+    } else {
+      $infos['cf_id'] = rand();
+      $params_ok = false;
+      array_push( $infos['errors'], l10n('cf_form_error'));
+    }
+    // From name
+    if (isset($_POST['cf_from_name'])) {
+      $value = trim( stripslashes($_POST['cf_from_name']) );
+      if (strlen($value) > 0) {
+        $infos['cf_from_name'] = $value;
+      } else {
+        array_push( $infos['errors'], l10n('cf_from_name_error'));
+        $params_ok = false;
+      }
+    } else {
+      array_push( $infos['errors'], l10n('cf_from_name_error'));
+      $params_ok = false;
+    }
+    // From mail
+    if (isset($_POST['cf_from_mail'])) {
+      $value = trim( stripslashes($_POST['cf_from_mail']) );
+      $return = cf_validate_mail_format($value);
+      if (null == $return) {
+        $infos['cf_from_mail'] = $value;
+      } else {
+        $params_ok = false;
+        array_push( $infos['errors'], $return);
+      }
+    } else {
+      array_push( $infos['errors'], l10n('cf_mail_format_error'));
+      $params_ok = false;
+    }
+    // Subject
+    if (isset($_POST['cf_subject'])) {
+      $value = trim( stripslashes($_POST['cf_subject']) );
+      if (strlen($value) > 0) {
+        $infos['cf_subject'] = $value;
+      } else {
+        array_push( $infos['errors'], l10n('cf_subject_error'));
+        $params_ok = false;
+      }
+    } else {
+      array_push( $infos['errors'], l10n('cf_subject_error'));
+      $params_ok = false;
+    }
+    // Message
+    if (isset($_POST['cf_message'])) {
+      $value = trim( stripslashes($_POST['cf_message']) );
+      if (strlen($value) > 0) {
+        $infos['cf_message'] = $value;
+      } else {
+        array_push( $infos['errors'], l10n('cf_message_error'));
+        $params_ok = false;
+      }
+    } else {
+      array_push( $infos['errors'], l10n('cf_message_error'));
+      $params_ok = false;
+    }
+    return $params_ok;
+  }
+  
+  protected function check_key() {
+    global $conf;
+    $key='';
+    $id=0;
+    if (isset($_POST['cf_key'])) {
+      $key = trim( stripslashes($_POST['cf_key']));
+    }
+    if (isset($_POST['cf_id'])) {
+      $id = trim( stripslashes($_POST['cf_id']));
+    }
+    
+    $key = explode( ':', $key );
+    if ( count($key)!=2
+          or $key[0]>time()-2 // page must have been retrieved more than 2 sec ago
+          or $key[0]<time()-3600 // 60 minutes expiration
+          or hash_hmac(
+                'md5', $key[0].':'.$id, $conf['secret_key']
+              ) != $key[1]
+        )
+    {
+      return false;
+    }
+    return true;
+  }
+  
+  protected function create_infos_array($fill=true) {
+    $infos = array(
+        'cf_id'         => '',
+        'cf_from_name'  => '',
+        'cf_from_mail'  => '',
+        'cf_subject'    => '',
+        'cf_message'    => '',
+        'errors'        => array(),
+        'infos'         => array(),
+      );
+    if ($fill) {
+      global $user;
+      // Include language advices
+      load_language('plugin.lang', CF_PATH);
+      
+      $infos['cf_id'] = rand();
+      $infos['cf_from_name'] = is_a_guest()?'':$user['username'];
+      $infos['cf_from_mail'] = $user['email'];
+      $infos['cf_subject'] = l10n('title_send_mail');
+    }
+    return $infos;
+  }
+
+  protected function check_allowed() {
+    if (is_a_guest() and !$this->config->get_value(CF_CFG_ALLOW_GUEST)) {
+      // Not allowed
+      return false;
+    }
+    return true;
+  }
+  protected function get_plugin_admin_url() {
+    return get_admin_plugin_menu_link(CF_PATH . 'config.php');
+  }
+}
+?>
Index: /extensions/ContactForm/classes/index.php
===================================================================
--- /extensions/ContactForm/classes/index.php	(revision 3743)
+++ /extensions/ContactForm/classes/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 12:39:52 Criss Exp $
+// | last update   : $Date: 2009/08/13 12:39:52 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/config.php
===================================================================
--- /extensions/ContactForm/config.php	(revision 3743)
+++ /extensions/ContactForm/config.php	(revision 3743)
@@ -0,0 +1,69 @@
+<?php
+/* $Id: config.php,v 1.1 2009/08/17 07:35:35 Criss Exp $ */
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+check_status(ACCESS_ADMINISTRATOR);
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+
+$config_tabs[]='config';
+$config_tabs[]='language';
+
+global $template, $page;
+// Include language advices
+load_language('plugin.lang', CF_PATH);
+
+$cf_plugin = get_plugin_data($plugin_id);
+$cf_config = $cf_plugin->get_config();
+
+// Tabs management
+if (!isset($_GET['tab'])) {
+    $page['tab'] = $config_tabs[0];
+} else {
+    $page['tab'] = $_GET['tab'];
+}
+
+if (!in_array($page['tab'], $config_tabs)) {
+    $page['tab'] = $config_tabs[0];
+}
+$base_admin_url = get_admin_plugin_menu_link(__FILE__);
+
+$tabsheet = new tabsheet();
+
+foreach ($config_tabs as $current_tab) {
+    $tab_name = 'cf_tab_'.$current_tab;
+    $tabsheet->add($current_tab,
+                   l10n($tab_name),
+                   $base_admin_url.'&amp;tab='.$current_tab);
+}
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+// Define template file
+$template->block_html_head( '',
+          '<link rel="stylesheet" type="text/css" '.
+          'href="' . CF_INCLUDE . 'contactform.css' . '">',
+          $smarty, $repeat);
+$template->block_html_head( '',
+          '<script type="text/javascript" '.
+          'src="' . CF_INCLUDE . 'contactform.js' . '">'.
+          '</script>',
+          $smarty, $repeat);
+$template->set_filenames(array(
+    'plugin_admin_content' => realpath(cf_get_template('cf_'.
+                                                       $page['tab'].
+                                                       '.tab.tpl',
+                                                       CF_AMDIN_TPL))
+  ));
+
+$cf = array(
+    'TITLE'     => $cf_plugin->get_title(),
+    'VERSION'   => $cf_plugin->get_version(),
+    'F_ACTION'  => '',
+  );
+$template->assign('CF', $cf);
+
+// Include specific tab
+include_once (CF_ADMIN . 'cf_' . $page['tab'] . '.tab.php');
+
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+?>
Index: /extensions/ContactForm/include/cf_common.inc.php
===================================================================
--- /extensions/ContactForm/include/cf_common.inc.php	(revision 3743)
+++ /extensions/ContactForm/include/cf_common.inc.php	(revision 3743)
@@ -0,0 +1,102 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+/* ************************** */
+/* ** Constants            ** */
+/* ************************** */
+
+// Version
+define('CF_VERSION',            '1.0.0');
+define('CF_TITLE',              'Contact Form');
+
+// Directories
+define('CF_INCLUDE_DIR',        'include/');
+define('CF_CLASSES_DIR',        'classes/');
+define('CF_IMAGES_DIR',         'images/');
+define('CF_TEMPLATE_DIR',       'template/');
+define('CF_ADMIN_DIR',          'admin/');
+define('CF_LANGUAGE_DIR',       'language/');
+// Path
+define('CF_CLASSES',            CF_PATH.CF_CLASSES_DIR);
+define('CF_INCLUDE',            CF_PATH.CF_INCLUDE_DIR);
+define('CF_TEMPLATE',           CF_PATH.CF_TEMPLATE_DIR);
+define('CF_LANGUAGE',           CF_PATH.CF_LANGUAGE_DIR);
+define('CF_ADMIN',              CF_PATH.CF_ADMIN_DIR);
+define('CF_AMDIN_TPL',          CF_PATH.CF_ADMIN_DIR.CF_TEMPLATE_DIR);
+// Files
+define('CF_OBSOLETE',           'obsolete.list');
+// Constants
+define('CF_DEBUG_ACTIVE',       false);
+define('CF_MENUBAR_KEY',        'contact_form');
+define('CF_URL_PARAMETER',      'contact');
+define('CF_SEPARATOR_PATTERN',  '||SEPARATOR HERE||');
+define('CF_CHECKED',            'checked="checked"');
+define('CF_SEPARATOR',          '=');
+define('CF_SEPARATOR_LENGTH',   20);
+define('CF_DEFAULT_PREFIX',     'Piwigo ContactForm');
+define('CF_REDIRECT_DELAY',     5);
+define('CF_DEFAULT_LINKNAME',   'ContactFormLink');
+// Config keys
+if (isset($plugin)) {
+  define('CF_CFG_DB_KEY',       $plugin['id']);
+}
+define('CF_CFG_DB_FACTORY',     'Factory settings for plugin %s [%s]');
+define('CF_CFG_DB_COMMENT',     'Configuration of plugin %s [%s]');
+define('CF_CFG_COMMENT',        'comment');
+define('CF_CFG_VERSION',        'version');
+
+define('CF_CFG_SUBJECT_PREFIX', 'cf_subject_prefix');
+define('CF_CFG_SEPARATOR_LEN',  'cf_separator_length');
+define('CF_CFG_SEPARATOR',      'cf_separator');
+define('CF_CFG_ALLOW_GUEST',    'cf_allow_guest');
+define('CF_CFG_MAIL_MANDATORY', 'cf_mandatory_mail');
+define('CF_CFG_NAME_MANDATORY', 'cf_mandatory_name');
+define('CF_CFG_REDIRECT_DELAY', 'cf_redirect_delay');
+define('CF_CFG_CONTACT_LINK',   'cf_link');
+
+/* ************************** */
+/* ** Includes             ** */
+/* ************************** */
+
+// Include plugin functions
+@include_once(CF_INCLUDE.'cf_functions.inc.php');
+
+// Load class files
+cf_require_class("CF_Debug");
+cf_require_class("CF_Config_Lang");
+cf_require_class("CF_Config");
+cf_require_class("CF_Plugin");
+
+/* ************************** */
+/* ** Variable definitions ** */
+/* ************************** */
+global $conf;
+$cf_config_default = array();
+$cf_config_default[CF_CFG_SUBJECT_PREFIX] = CF_DEFAULT_PREFIX;
+$cf_config_default[CF_CFG_SEPARATOR_LEN] = CF_SEPARATOR_LENGTH;
+$cf_config_default[CF_CFG_SEPARATOR] = CF_SEPARATOR;
+$cf_config_default[CF_CFG_ALLOW_GUEST] = true;
+$cf_config_default[CF_CFG_MAIL_MANDATORY] = true;
+$cf_config_default[CF_CFG_NAME_MANDATORY] = true;
+$cf_config_default[CF_CFG_REDIRECT_DELAY] = CF_REDIRECT_DELAY;
+$cf_config_default[CF_CFG_CONTACT_LINK] = CF_DEFAULT_LINKNAME;
+CF_Config::$default_config = $cf_config_default;
+
+$cf_config_lang_keys = array();
+$cf_config_lang_keys['contact_form_title'] = array(
+    'fr_FR' => 'Formulaire de contact',
+    'en_UK' => 'Contact form',
+    'it_IT' => '',
+);
+$cf_config_lang_keys['contact_form'] = array(
+    'fr_FR' => 'Contacter',
+    'en_UK' => 'Contact',
+    'it_IT' => '',
+);
+$cf_config_lang_keys['contact_form_link'] = array(
+    'fr_FR' => 'Contacter le webmestre',
+    'en_UK' => 'Contact webmaster',
+    'it_IT' => 'Contattare il webmaster',
+);
+CF_Config_Lang::$default_keys = $cf_config_lang_keys;
+?>
Index: /extensions/ContactForm/include/cf_functions.inc.php
===================================================================
--- /extensions/ContactForm/include/cf_functions.inc.php	(revision 3743)
+++ /extensions/ContactForm/include/cf_functions.inc.php	(revision 3743)
@@ -0,0 +1,126 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+/**
+ * Include class file
+ * @param $aClassName
+ */
+function cf_require_class($aClassName) {
+  require_once CF_CLASSES .strtolower($aClassName) . '.class.php';
+}
+
+include_once(PHPWG_ROOT_PATH . 'include/functions_mail.inc.php');
+
+function cf_switch_to_default_lang() {
+  global $switch_lang,$user;
+  if (!isset($switch_lang['stack']) or
+      !in_array($user['language'], $switch_lang['stack'])) {
+    $switch_lang['stack'][] = $user['language'];
+  }
+  switch_lang_to(get_default_language());
+  // Include language advices
+  load_language('plugin.lang', CF_PATH);
+}
+function cf_switch_back_to_user_lang() {
+  switch_lang_back();
+}
+function cf_validate_mail_format($email) {
+  $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
+  $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
+  $regex  = '/^' . $atom . '+' . '(\.' . $atom . '+)*';
+  $regex .= '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
+  if ( !preg_match( $regex, $email ) ) {
+    return l10n('cf_mail_format_error');
+  }
+  return null;
+}
+
+function cf_get_admins_emails($webmaster_email) {
+  global $conf, $user;
+  $admins = array();
+
+  $query = '
+select
+  U.'.$conf['user_fields']['username'].' as username,
+  U.'.$conf['user_fields']['email'].' as mail_address
+from
+  '.USERS_TABLE.' as U,
+  '.USER_INFOS_TABLE.' as I
+where
+  I.user_id =  U.'.$conf['user_fields']['id'].' and
+  I.status in (\'webmaster\',  \'admin\') and
+  I.adviser = \'false\' and
+  '.$conf['user_fields']['email'].' is not null and
+  I.user_id <> '.$user['id'].'
+order by
+  username
+';
+
+  $datas = pwg_query($query);
+  if (!empty($datas)) {
+    while ($admin = mysql_fetch_array($datas)) {
+      if (!empty($admin['mail_address']) and
+          (0!=strcasecmp($admin['mail_address'], $webmaster_email))) {
+        array_push( $admins,
+                    format_email($admin['username'], $admin['mail_address'])
+                  );
+      }
+    }
+  }
+  return $admins;
+}
+
+/* Return template for user template/theme*/
+function cf_get_template($file, $dir=CF_TEMPLATE) {
+  global $user, $template;
+
+  $theme_file = $dir.$user['template'].'/'.$user['theme'].'/'.$file;
+  $template_file = $dir.$user['template'].'/'.$file;
+
+  if (file_exists($theme_file))
+  {
+    return $theme_file;
+  }
+  elseif (file_exists($template_file))
+  {
+    return $template_file;
+  }
+  else
+  {
+    return $dir.$file;
+  }
+}
+  
+function cf_clean_obsolete_files($obsolete_file_list) {
+  if (!file_exists(CF_PATH.$obsolete_file_list)) {
+    return TRUE;
+  }
+  $obsolete = file(CF_PATH.$obsolete_file_list);
+  array_push($obsolete, $obsolete_file_list);
+  return cf_clean_obsolete_list($obsolete);
+}
+
+function cf_clean_obsolete_list($file_list = array(), &$errors = array()) {
+  // Include language advices
+  load_language('plugin.lang', CF_PATH);
+  
+  if (!function_exists('unlink')) {
+      // No unlink available...
+      array_push($errors, l10n('cf_no_unlink'));
+      return FALSE;
+  }
+  $success = TRUE;
+  foreach ($file_list as $file) {
+    $file = CF_PATH . $file;
+    if (file_exists($file)) {
+      // Remove obsolete file
+      $success &= unlink($file);
+    }
+  }
+  if (!$success) {
+      array_push($errors, l10n('cf_unlink_errors'));
+  }
+  return $success;
+}
+
+?>
Index: /extensions/ContactForm/include/contactform.css
===================================================================
--- /extensions/ContactForm/include/contactform.css	(revision 3743)
+++ /extensions/ContactForm/include/contactform.css	(revision 3743)
@@ -0,0 +1,27 @@
+div.contact-form {
+	padding-top: 10px;
+	padding-bottom: 10px;
+}
+td.contact-form-left {
+	padding-right: 5px;
+	text-align: right;
+	vertical-align: top;
+}
+td.contact-form-right {
+  padding-left: 5px;
+  text-align: left;
+}
+#cf-redirect {
+	margin-left: 10em;
+	margin-right: 10em;
+  padding: 5px;
+}
+.cf-label {
+	font-size: larger;
+	text-align: center;
+	margin-bottom: 5px;
+}
+.cf-lang {
+  display: none;
+  visibility: hidden;
+}
Index: /extensions/ContactForm/include/contactform.js
===================================================================
--- /extensions/ContactForm/include/contactform.js	(revision 3743)
+++ /extensions/ContactForm/include/contactform.js	(revision 3743)
@@ -0,0 +1,80 @@
+function cf_check_content(item, is_mail) {
+  if (null == item) {
+    return false;
+  }
+  var value = item.value;
+  if (null == value || 0 == value.length || '' == value) {
+    return false;
+  }
+  if (is_mail) {
+    return cf_check_mail_content(value);
+  }
+  return true;
+}
+
+function cf_check_mail_content(value) {
+  var atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';     // before  arobase
+  var domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
+  var regex; 
+  regex  = '^' + atom + '+' + '(\.' + atom + '+)*';
+  regex += '@' + '(' + domain + '{1,63}\.)+' + domain + '{2,63}$';
+  var reg = new RegExp(regex, 'i');
+  if(reg.test(value)) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+function cf_set_visible(element, visible) {
+  var new_state, new_display;
+  if (visible) {
+    new_state = "visible";
+    new_display = "block";
+  } else {
+    new_state = "hidden";
+    new_display = "none";
+  }
+  element.style.visibility = new_state;
+  element.style.display = new_display;
+}
+
+function hideShowDiv(select_item) {
+
+  for (var i=0 ; i<select_item.length ; i++) {
+    var div_item = document.getElementById(select_item[i].value);
+    var visible = select_item[i].selected;
+    cf_set_visible(div_item, visible);
+  }
+  return;
+  if (lCheckBoxSelected.checked) {
+    lShowCB = false;
+    lShowDiv = true;
+  }
+  var i=0;
+  for (i=0 ; i<lCategories.length ; i++) {
+    if (lCategories[i].id != current_category &&
+      lCategories[i].id.match(gCategoryPrefix)) {
+      
+      setVisible(lCategories[i], lShowCB);
+    }
+  }
+  for (i=0 ; i<lInputs.length ; i++) {
+    if (lInputs[i].type == 'checkbox' && lInputs[i].name == gCBName) {
+      lCB.push(lInputs[i]);
+    }
+  }
+  for (i=0 ; i<lCB.length ; i++) {
+    if (lCB[i].id != lIdSelected) {
+      setVisible(document.getElementById(gListPrefix + lCB[i].value), lShowCB);
+      lCB[i].checked = false;
+    }
+  }
+  if (!lShowDiv) {
+    setVisible(gFormDetailsDiv, lShowDiv);
+    setVisible(gProductDetailsDiv, lShowDiv);
+    clearDiv();
+  } else {
+    getParameters(productId);
+  }
+}
Index: /extensions/ContactForm/include/index.php
===================================================================
--- /extensions/ContactForm/include/index.php	(revision 3743)
+++ /extensions/ContactForm/include/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 12:39:51 Criss Exp $
+// | last update   : $Date: 2009/08/13 12:39:51 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/index.php
===================================================================
--- /extensions/ContactForm/index.php	(revision 3743)
+++ /extensions/ContactForm/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 12:39:52 Criss Exp $
+// | last update   : $Date: 2009/08/13 12:39:52 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/language/en_UK/description.txt
===================================================================
--- /extensions/ContactForm/language/en_UK/description.txt	(revision 3743)
+++ /extensions/ContactForm/language/en_UK/description.txt	(revision 3743)
@@ -0,0 +1,1 @@
+Add a "Contact" item in the Menu block to offer a contact form to users
Index: /extensions/ContactForm/language/en_UK/index.php
===================================================================
--- /extensions/ContactForm/language/en_UK/index.php	(revision 3743)
+++ /extensions/ContactForm/language/en_UK/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 12:39:52 Criss Exp $
+// | last update   : $Date: 2009/08/13 12:39:52 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/en_UK/plugin.lang.php	(revision 3743)
+++ /extensions/ContactForm/language/en_UK/plugin.lang.php	(revision 3743)
@@ -0,0 +1,66 @@
+<?php
+/* $Id: plugin.lang.php,v 1.5 2009/08/17 07:30:09 Criss Exp $ */
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+global $lang;
+
+// ==================================================================
+// Default values if not configured
+$lang['contact_form_title'] = 'Contact form';
+$lang['contact_form'] = 'Contact';
+$lang['contact_form_link'] = 'Contact webmaster';
+
+// ==================================================================
+// Redirect page
+$lang['contact_redirect_title'] = 'Send message status';
+
+// ==================================================================
+// Menubar block
+$lang['cf_from_name'] = 'Your name';
+$lang['cf_from_mail'] = 'Your e-mail';
+$lang['cf_subject'] = 'Subject';
+$lang['cf_message'] = 'Message';
+$lang['cf_submit'] = 'Send';
+
+// ==================================================================
+// Messages
+$lang['cf_from_name_error'] = 'Please enter a name';
+$lang['cf_mail_format_error'] = $lang['reg_err_mail_address'];
+$lang['cf_subject_error'] = 'Please enter a subject';
+$lang['cf_message_error'] = 'Please enter a message';
+$lang['cf_error_sending_mail'] = 'Error while sending e-mail';
+$lang['cf_sending_mail_successful'] = 'E-mail sent successfully';
+$lang['cf_form_error'] = 'Invalid data';
+$lang['cf_inconsistent_version'] = '%s: inconsistent version numbers';
+$lang['cf_no_unlink'] = 'Function \'unlink\' not available...';
+$lang['cf_unlink_errors'] = 'Error occured during file deletion';
+$lang['cf_config_saved'] = 'Configuration successfully saved';
+$lang['cf_config_saved_with_errors'] = 'Configuration saved with errors';
+$lang['cf_length_not_integer'] = 'Size must be an integer';
+$lang['cf_delay_not_integer'] = 'Delay must be an integer';
+$lang['cf_link_error'] = 'Variable can\'t contain spaces';
+
+// ==================================================================
+// Admin page
+$lang['cf_validate'] = 'Submit';
+// Configuration tab
+$lang['cf_tab_config'] = 'Configuration';
+$lang['cf_config'] = 'Configuration';
+$lang['cf_config_desc'] = 'Plugin main configuration';
+$lang['cf_label_config'] = 'General configuration';
+$lang['cf_label_mail'] = 'E-mail configuration';
+$lang['cf_guest_allowed'] = 'Allow guests to see the form';
+$lang['cf_mail_prefix'] = 'Prefix of the sent e-mail subject';
+$lang['cf_separator'] = 'Character(s) used to define a separation bar in the e-mail in text format';
+$lang['cf_separator_length'] = 'Size of the bar';
+$lang['cf_mandatory_name'] = 'Name is mandatory';
+$lang['cf_mandatory_mail'] = 'E-mail address is mandatory';
+$lang['cf_redirect_delay'] = 'Pause delay of redirection';
+$lang['cf_link'] = 'Name of the template variable containing the HTML link to the contact form';
+// Language tab
+$lang['cf_tab_language'] = 'Localization';
+$lang['cf_language_desc'] = 'Messages translation';
+$lang['cf_select_item'] = 'Select item to translate';
+$lang['contact_form_title_label'] = 'Title used in menubar';
+$lang['contact_form_label'] = 'Name used in menubar';
+$lang['contact_form_link_label'] = 'Text used for contact link in the page footer';
+?>
Index: /extensions/ContactForm/language/fr_FR/description.txt
===================================================================
--- /extensions/ContactForm/language/fr_FR/description.txt	(revision 3743)
+++ /extensions/ContactForm/language/fr_FR/description.txt	(revision 3743)
@@ -0,0 +1,1 @@
+Ajoute un élément "Contacter" dans le bloc Menu afin d'offrir un formulaire de contact aux utilisateurs
Index: /extensions/ContactForm/language/fr_FR/index.php
===================================================================
--- /extensions/ContactForm/language/fr_FR/index.php	(revision 3743)
+++ /extensions/ContactForm/language/fr_FR/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 12:39:51 Criss Exp $
+// | last update   : $Date: 2009/08/13 12:39:51 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/fr_FR/plugin.lang.php	(revision 3743)
+++ /extensions/ContactForm/language/fr_FR/plugin.lang.php	(revision 3743)
@@ -0,0 +1,67 @@
+<?php
+/* $Id: plugin.lang.php,v 1.5 2009/08/17 07:30:09 Criss Exp $ */
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+global $lang;
+
+// ==================================================================
+// Default values if not configured
+$lang['contact_form_title'] = 'Formulaire de contact';
+$lang['contact_form'] = 'Contacter';
+$lang['contact_form_link'] = 'Contacter le webmestre';
+
+// ==================================================================
+// Redirect page
+$lang['contact_redirect_title'] = 'Statut de l\'envoi du message';
+
+// ==================================================================
+// Menubar block
+$lang['cf_from_name'] = 'Votre nom';
+$lang['cf_from_mail'] = 'Votre e-mail';
+$lang['cf_subject'] = 'Sujet';
+$lang['cf_message'] = 'Message';
+$lang['cf_submit'] = 'Envoyer';
+
+// ==================================================================
+// Messages
+$lang['cf_from_name_error'] = 'Veuillez entrer un nom';
+$lang['cf_mail_format_error'] = $lang['reg_err_mail_address'];
+$lang['cf_subject_error'] = 'Veuillez entrer un sujet';
+$lang['cf_message_error'] = 'Veuillez entrer un message';
+$lang['cf_error_sending_mail'] = 'Erreur lors de l\'envoi de l\'e-mail';
+$lang['cf_sending_mail_successful'] = 'E-mail envoyé avec succès';
+$lang['cf_form_error'] = 'Données incorrectes';
+$lang['cf_inconsistent_version'] = '%s : numéros de version incohérentes';
+$lang['cf_no_unlink'] = 'La fonction \'unlink\' n\'est pas disponible';
+$lang['cf_unlink_errors'] = 'Des erreurs ont eu lieu lors de la suppression de fichiers';
+$lang['cf_config_saved'] = 'Configuration sauvée avec succès';
+$lang['cf_config_saved_with_errors'] = 'Configuration sauvée mais avec des erreurs';
+$lang['cf_length_not_integer'] = 'La taille doit être un entier';
+$lang['cf_delay_not_integer'] = 'Le délai doit être un entier';
+$lang['cf_link_error'] = 'La variable ne peut pas contenir d\'espaces';
+
+// ==================================================================
+// Admin page
+$lang['cf_validate'] = 'Valider';
+// Configuration tab
+$lang['cf_tab_config'] = 'Configuration';
+$lang['cf_config'] = 'Configuration';
+$lang['cf_config_desc'] = 'Configuration principale du plugin';
+$lang['cf_label_config'] = 'Configuration générale';
+$lang['cf_label_mail'] = 'Configuration de l\'e-mail';
+$lang['cf_guest_allowed'] = 'Autoriser les invités à avoir le formulaire';
+$lang['cf_mail_prefix'] = 'Préfixe du sujet de l\'e-mail envoyé';
+$lang['cf_separator'] = 'Caractère(s) utilisé(s) pour définir une barre de séparation dans l\'e-mail au format texte';
+$lang['cf_separator_length'] = 'Taille de la barre de séparation';
+$lang['cf_mandatory_name'] = 'Présence du nom obligatoire';
+$lang['cf_mandatory_mail'] = 'Présence de l\'e-mail obligatoire';
+$lang['cf_redirect_delay'] = 'Délai de pause de la redirection';
+$lang['cf_link'] = 'Nom de la variable de template contenant le lien HTML vers le formulaire de contact';
+// Language tab
+$lang['cf_tab_language'] = 'Localisation';
+$lang['cf_language_desc'] = 'Traduction des messages';
+$lang['cf_select_item'] = 'Sélectionnez l\'élément à traduire';
+$lang['contact_form_title_label'] = 'Titre dans la barre de menus';
+$lang['contact_form_label'] = 'Nom affiché dans la barre de menus';
+$lang['contact_form_link_label'] = 'Texte utilisé pour le lien de contact en bas de page';
+
+?>
Index: /extensions/ContactForm/language/index.php
===================================================================
--- /extensions/ContactForm/language/index.php	(revision 3743)
+++ /extensions/ContactForm/language/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 12:39:52 Criss Exp $
+// | last update   : $Date: 2009/08/13 12:39:52 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/language/it_IT/index.php
===================================================================
--- /extensions/ContactForm/language/it_IT/index.php	(revision 3743)
+++ /extensions/ContactForm/language/it_IT/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 12:39:52 Criss Exp $
+// | last update   : $Date: 2009/08/13 12:39:52 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/it_IT/plugin.lang.php	(revision 3743)
+++ /extensions/ContactForm/language/it_IT/plugin.lang.php	(revision 3743)
@@ -0,0 +1,67 @@
+<?php
+/* $Id: plugin.lang.php,v 1.5 2009/08/17 07:30:10 Criss Exp $ */
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+global $lang;
+
+// ==================================================================
+// Default values if not configured
+// TODO $lang['contact_form_title'] = ''; 
+// TODO $lang['contact_form'] = '';
+$lang['contact_form_link'] = 'Contattare il webmaster';
+
+// ==================================================================
+// Redirect page
+// TODO $lang['contact_redirect_title'] = '';
+
+// ==================================================================
+// Menubar block
+// TODO $lang['cf_from_name'] = ''; 
+// TODO $lang['cf_from_mail'] = ''; 
+// TODO $lang['cf_subject'] = ''; 
+// TODO $lang['cf_message'] = ''; 
+// TODO $lang['cf_submit'] = ''; 
+
+// ==================================================================
+// Messages
+// TODO $lang['cf_from_name_error'] = ''; 
+$lang['cf_mail_format_error'] = $lang['reg_err_mail_address'];
+// TODO $lang['cf_subject_error'] = ''; 
+// TODO $lang['cf_message_error'] = ''; 
+// TODO $lang['cf_error_sending_mail'] = ''; 
+// TODO $lang['cf_sending_mail_successful'] = '';
+// TODO $lang['cf_form_error'] = ''; 
+$lang['cf_inconsistent_version'] = '%s : versioni incoerenti';
+$lang['cf_no_unlink'] = 'La funzione \'unlink\' non è disponibile';
+$lang['cf_unlink_errors'] = 'Errori durante la sopressione dei file';
+$lang['cf_config_saved'] = 'Configurazione salvata con successo';
+$lang['cf_config_saved_with_errors'] = 'Configurazione salvata con errori';
+// TODO $lang['cf_length_not_integer'] = '';
+// TODO $lang['cf_delay_not_integer'] = '';
+//TODO $lang['cf_link_error'] = '';
+
+// ==================================================================
+// Admin page
+$lang['cf_validate'] = 'Confermare';
+// Configuration tab
+$lang['cf_tab_config'] = 'Configurazione';
+$lang['cf_config'] = 'Configurazione';
+$lang['cf_config_desc'] = 'Configurazione principale del plugin';
+$lang['cf_label_config'] = 'Configurazione generale';
+// TODO $lang['cf_label_mail'] = '';
+// TODO $lang['cf_guest_allowed'] = '';
+// TODO $lang['cf_mail_prefix'] = '';
+// TODO $lang['cf_separator'] = '';
+// TODO $lang['cf_separator_length'] = '';
+// TODO $lang['cf_mandatory_name'] = '';
+// TODO $lang['cf_mandatory_mail'] = '';
+// TODO $lang['cf_redirect_delay'] = '';
+// TODO $lang['cf_link'] = '';
+// Language tab
+// TODO $lang['cf_tab_language'] = '';
+// TODO $lang['cf_language_desc'] = ' ';
+// TODO $lang['cf_select_item'] = ' ';
+// TODO $lang['contact_form_title_label'] = ' ';
+// TODO $lang['contact_form_label'] = ' ';
+// TODO $lang['contact_form_link_label'] = ' ';
+
+?>
Index: /extensions/ContactForm/main.inc.php
===================================================================
--- /extensions/ContactForm/main.inc.php	(revision 3743)
+++ /extensions/ContactForm/main.inc.php	(revision 3743)
@@ -0,0 +1,56 @@
+<?php
+/*
+ Plugin Name: Contact Form
+ Version: 1.0.0
+ Description: Add a "Contact" item in the Menu block to offer a contact form to users
+ Plugin URI: http://piwigo.org/ext/extension_view.php?eid=304
+ Author: Criss
+ Author URI: http://piwigo.org/
+*/
+
+/** History **
+
+  2009-08-17 1.0.0
+                    Put under SVN control
+
+  2009-08-17 0.1.f
+                    Add obsolete list
+
+  2009-08-17 0.1.e
+                    Add language configuration for items texts
+                    Add template variable
+
+  2009-08-14 0.1.d
+                    Add a redirection page when successfully sent message
+
+  2009-08-13 0.1.c
+                    Fix regexp bug in mail format check in javascript
+
+  2009-08-13 0.1.b
+                    Add admin management
+
+  2009-08-13 0.1.a
+                    Plugin creation
+
+*/
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+define('CF_PATH',     PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+define('CF_ROOT',     dirname(__FILE__).'/');
+include_once(CF_PATH . 'include/cf_common.inc.php');
+
+$cf_plugin = new CF_Plugin($plugin['id']);
+add_event_handler('loc_begin_page_tail',             
+                  array(&$cf_plugin, 'loc_begin_page_header'));
+add_event_handler('blockmanager_apply',             
+                  array(&$cf_plugin, 'blockmanager_apply'));
+add_event_handler('loc_end_index',             
+                  array(&$cf_plugin, 'loc_end_index'));
+add_event_handler('loc_end_page_tail',
+                  array(&$cf_plugin, 'loc_end_page_tail'));
+if(defined('IN_ADMIN')) {
+  add_event_handler('get_admin_plugin_menu_links',
+                    array(&$cf_plugin, 'get_admin_plugin_menu_links'));
+}
+set_plugin_data($plugin['id'], $cf_plugin);
+?>
Index: /extensions/ContactForm/maintain.inc.php
===================================================================
--- /extensions/ContactForm/maintain.inc.php	(revision 3743)
+++ /extensions/ContactForm/maintain.inc.php	(revision 3743)
@@ -0,0 +1,45 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!defined('IN_ADMIN') or !IN_ADMIN) die('Hacking attempt!');
+
+if (!defined('CF_PATH')) {
+  define('CF_PATH',     PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+}
+if (!defined('CF_ROOT')) {
+  define('CF_ROOT',     dirname(__FILE__).'/');
+}
+
+function plugin_install($plugin_id, $version, &$errors) {
+  include_once(CF_PATH . 'include/cf_common.inc.php');
+  // Include language advices
+  load_language('plugin.lang', CF_PATH);
+  if ($version != CF_VERSION) {
+    array_push($errors, sprintf(l10n('cf_inconsistent_version'), $plugin_id));
+    return;
+  }
+  update_config($plugin_id, CF_CFG_DB_FACTORY);
+}
+
+function plugin_activate($plugin_id, $version, &$errors) {
+  update_config($plugin_id);
+}
+
+function plugin_deactivate($plugin_id) {
+  // Nothing special
+}
+
+function plugin_uninstall($plugin_id) {
+  include_once(CF_PATH . 'include/cf_common.inc.php');
+  $uninstall = CF_Config::uninstall($plugin_id);
+}
+
+function update_config($plugin_id, $db_comment=null) {
+  include_once(CF_PATH . 'include/cf_common.inc.php');
+  $clean = cf_clean_obsolete_files(CF_OBSOLETE);
+  $cf_config_default[CF_CFG_VERSION] = CF_VERSION;
+  if (null != $db_comment) {
+    $cf_config_default[CF_CFG_COMMENT] = $db_comment;
+  }
+  $install = CF_Config::install($plugin_id);
+}
+?>
Index: /extensions/ContactForm/obsolete.list
===================================================================
--- /extensions/ContactForm/obsolete.list	(revision 3743)
+++ /extensions/ContactForm/obsolete.list	(revision 3743)
@@ -0,0 +1,1 @@
+admin/template/cf_config.tpl
Index: /extensions/ContactForm/template/cf_form.tpl
===================================================================
--- /extensions/ContactForm/template/cf_form.tpl	(revision 3743)
+++ /extensions/ContactForm/template/cf_form.tpl	(revision 3743)
@@ -0,0 +1,72 @@
+{literal}
+<script type="text/javascript">
+function cf_validate() {
+  var items = new Array('cf_from_name','cf_from_mail','cf_subject','cf_message');
+  var is_mail = new Array(false,true,false,false);
+  var is_needed = new Array(
+    {/literal}{if $CF.NEED_NAME}true{else}false{/if}{literal},
+    {/literal}{if $CF.NEED_MAIL}true{else}false{/if}{literal},
+    true,true);
+  var messages = new Array(
+    '{/literal}{'cf_from_name_error'|@translate|@escape:javascript}{literal}',
+    '{/literal}{'cf_mail_format_error'|@translate|@escape:javascript}{literal}',
+    '{/literal}{'cf_subject_error'|@translate|@escape:javascript}{literal}',
+    '{/literal}{'cf_message_error'|@translate|@escape:javascript}{literal}');
+  var i;
+  for (i in items) {
+    var item = document.getElementById(items[i]);
+    var is_ok = cf_check_content(item, is_mail[i]);
+    if (!is_ok && is_needed[i]) {
+      alert(messages[i]);
+      item.focus();
+      return false;
+    }
+  }
+  return true;
+}
+</script>
+{/literal}
+<div id="autre_content" class="contact-form">
+  <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();">
+  <fieldset>
+    <table>
+      <tr>
+        <td class="contact-form-left">{'cf_from_name'|@translate}</td>
+        <td class="contact-form-right">
+        {if $CF.LOGGED}
+          <input type="text" name="cf_from_name_label" id="cf_from_name" size="40" value="{$CF.NAME}" disabled="disabled">
+          <input type="hidden" name="cf_from_name" value="{$CF.NAME}" />
+        {else}
+          <input type="text" name="cf_from_name" id="cf_from_name" size="40" value="{$CF.NAME}">
+        {/if}
+        </td>
+      </tr>
+      <tr>
+        <td class="contact-form-left">{'cf_from_mail'|@translate}</td>
+        <td class="contact-form-right">
+        {if $CF.LOGGED and ''!=$CF.EMAIL}
+          <input type="text" name="cf_from_mail_label" id="cf_from_mail" size="40" value="{$CF.EMAIL}" disabled="disabled">
+          <input type="hidden" name="cf_from_mail" value="{$CF.EMAIL}" />
+        {else}
+          <input type="text" name="cf_from_mail" id="cf_from_mail" size="40" value="{$CF.EMAIL}"></td>
+        {/if}
+        </td>
+      </tr>
+      <tr>
+        <td class="contact-form-left">{'cf_subject'|@translate}</td>
+        <td class="contact-form-right"><input type="text" name="cf_subject" id="cf_subject" size="40" value="{$CF.SUBJECT}"></td>
+      </tr>
+      <tr>
+        <td class="contact-form-left">{'cf_message'|@translate}</td>
+        <td class="contact-form-right"><textarea name="cf_message" id="cf_message" rows="10" cols="40">{$CF.MESSAGE}</textarea></td>
+      </tr>
+      <tr>
+        <td class="contact-form-left">&nbsp;</td>
+        <td class="contact-form-right"><input class="submit" type="submit" value="{'cf_submit'|@translate}"></td>
+      </tr>
+    </table>
+    <input type="hidden" name="cf_key" value="{$CF.KEY}" />
+    <input type="hidden" name="cf_id" value="{$CF.ID}" />
+  </fieldset>
+  </form>
+</div>
Index: /extensions/ContactForm/template/cf_index.tpl
===================================================================
--- /extensions/ContactForm/template/cf_index.tpl	(revision 3743)
+++ /extensions/ContactForm/template/cf_index.tpl	(revision 3743)
@@ -0,0 +1,6 @@
+{$MENUBAR}
+<div id="content" class="content">
+<!-- Messages -->{$CF_MESSAGES}<!-- Messages -->
+<!-- Title -->{$CF_TITLE}<!-- Title -->
+<!-- Contact form -->{$CF_FORM}<!-- Contact form -->
+</div> <!-- content -->
Index: /extensions/ContactForm/template/cf_link.tpl
===================================================================
--- /extensions/ContactForm/template/cf_link.tpl	(revision 3743)
+++ /extensions/ContactForm/template/cf_link.tpl	(revision 3743)
@@ -0,0 +1,1 @@
+<a href="{$CF_LINK.URL}">{$CF_LINK.TEXT}</a>
Index: /extensions/ContactForm/template/cf_messages.tpl
===================================================================
--- /extensions/ContactForm/template/cf_messages.tpl	(revision 3743)
+++ /extensions/ContactForm/template/cf_messages.tpl	(revision 3743)
@@ -0,0 +1,19 @@
+{if isset($errors)}
+<div class="errors">
+  <ul>
+    {foreach from=$errors item=error}
+    <li>{$error}</li>
+    {/foreach}
+  </ul>
+</div>
+{/if}
+
+{if isset($infos)}
+<div class="infos">
+  <ul>
+    {foreach from=$infos item=info}
+    <li>{$info}</li>
+    {/foreach}
+  </ul>
+</div>
+{/if}
Index: /extensions/ContactForm/template/cf_redirect.tpl
===================================================================
--- /extensions/ContactForm/template/cf_redirect.tpl	(revision 3743)
+++ /extensions/ContactForm/template/cf_redirect.tpl	(revision 3743)
@@ -0,0 +1,7 @@
+{if isset($CF.CSS)}
+{$CF.CSS}
+{/if}
+<div id="cf-redirect" class="content">
+<!-- Title -->{$CF_TITLE}<!-- Title -->
+<!-- Messages -->{$CF_MESSAGES}<!-- Messages -->
+</div> <!-- content -->
Index: /extensions/ContactForm/template/cf_title.tpl
===================================================================
--- /extensions/ContactForm/template/cf_title.tpl	(revision 3743)
+++ /extensions/ContactForm/template/cf_title.tpl	(revision 3743)
@@ -0,0 +1,10 @@
+<div class="titrePage">
+  <ul class="categoryActions">
+    <li>
+      <a href="{$U_HOME}" title="{'return to homepage'|@translate}">
+        <img src="{$themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}"/>
+      </a>
+    </li>
+  </ul>
+  <h2>{$CF.TITLE|@translate}</h2>
+</div>
Index: /extensions/ContactForm/template/floOS/cf_index.tpl
===================================================================
--- /extensions/ContactForm/template/floOS/cf_index.tpl	(revision 3743)
+++ /extensions/ContactForm/template/floOS/cf_index.tpl	(revision 3743)
@@ -0,0 +1,25 @@
+{$MENUBAR}
+<div id="content" class="content">
+<!-- Messages -->{$CF_MESSAGES}<!-- Messages -->
+  <table id="table_content" border="0" cellspacing="0" cellpadding="0">
+    <tr>
+      <td id="section_up_left">&nbsp;</td>
+      <td id="section_up">
+      <!-- Title -->{$CF_TITLE}<!-- Title -->
+      </td>
+      <td id="section_up_right">&nbsp;</td>
+    </tr>
+    <tr>
+      <td id="section_left">&nbsp;</td>
+      <td id="section_in">
+      <!-- Contact form -->{$CF_FORM}<!-- Contact form -->
+      </td>
+      <td id="section_right">&nbsp;</td>
+    </tr>
+    <tr>
+      <td id="section_bottom_left">&nbsp;</td>
+      <td id="section_bottom" >&nbsp;</td>
+      <td id="section_bottom_right" >&nbsp;</td>
+    </tr>
+  </table>
+</div> <!-- content -->
Index: /extensions/ContactForm/template/floOS/index.php
===================================================================
--- /extensions/ContactForm/template/floOS/index.php	(revision 3743)
+++ /extensions/ContactForm/template/floOS/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 12:39:52 Criss Exp $
+// | last update   : $Date: 2009/08/13 12:39:52 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/template/floPure/cf_index.tpl
===================================================================
--- /extensions/ContactForm/template/floPure/cf_index.tpl	(revision 3743)
+++ /extensions/ContactForm/template/floPure/cf_index.tpl	(revision 3743)
@@ -0,0 +1,24 @@
+{$MENUBAR}
+<div id="content" class="content">
+<!-- Messages -->{$CF_MESSAGES}<!-- Messages -->
+  <table id="table_content" border="0" cellspacing="0" cellpadding="0">
+    <tr>
+      <td id="section_up_left">&nbsp;</td>
+      <td id="section_up">&nbsp;</td>
+      <td id="section_up_right">&nbsp;</td>
+    </tr>
+    <tr>
+      <td id="section_left">&nbsp;</td>
+      <td id="section_in">
+      <!-- Title -->{$CF_TITLE}<!-- Title -->
+      <!-- Contact form -->{$CF_FORM}<!-- Contact form -->
+      </td>
+      <td id="section_right">&nbsp;</td>
+    </tr>
+    <tr>
+      <td id="section_bottom_left">&nbsp;</td>
+      <td id="section_bottom" >&nbsp;</td>
+      <td id="section_bottom_right" >&nbsp;</td>
+    </tr>
+  </table>
+</div> <!-- content -->
Index: /extensions/ContactForm/template/floPure/index.php
===================================================================
--- /extensions/ContactForm/template/floPure/index.php	(revision 3743)
+++ /extensions/ContactForm/template/floPure/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 12:39:51 Criss Exp $
+// | last update   : $Date: 2009/08/13 12:39:51 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ContactForm/template/index.php
===================================================================
--- /extensions/ContactForm/template/index.php	(revision 3743)
+++ /extensions/ContactForm/template/index.php	(revision 3743)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php,v 1.1 2009/08/13 12:39:51 Criss Exp $
+// | last update   : $Date: 2009/08/13 12:39:51 $
+// | last modifier : $Author: Criss $
+// | revision      : $Revision: 1.1 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
