Index: /extensions/ContactForm/admin/cf_language.tab.php
===================================================================
--- /extensions/ContactForm/admin/cf_language.tab.php	(revision 3745)
+++ /extensions/ContactForm/admin/cf_language.tab.php	(revision 3746)
@@ -1,4 +1,4 @@
 <?php
-/* $Id: cf_language.tab.php,v 1.1 2009/08/17 07:24:11 Criss Exp $ */
+/* $Id: cf_language.tab.php,v 1.2 2009/08/17 14:53:42 Criss Exp $ */
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 check_status(ACCESS_ADMINISTRATOR);
@@ -9,17 +9,10 @@
 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_languages->mass_update($_POST['cf_item']);
   }
-  CF_Debug::add_debug( $cf_languages, 'POST');
+
   // Save config
   $cf_config->save_config();
@@ -38,11 +31,17 @@
 $config_keys=array();
 $config_values=array();
+
 foreach($cf_languages->get_keys() as $key) {
   $current = array();
+  $current[CF_LANG_DEFAULT] = array(
+        'LANG'  => CF_LANG_DEFAULT,
+        'NAME'  => l10n('cf_default_lang'),
+        'VALUE' => $cf_languages->get_value(CF_LANG_DEFAULT, $key, false),
+      );
   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),
+        'VALUE' => $cf_languages->get_value($lang_key, $key, false),
       );
   }
@@ -50,5 +49,4 @@
   $config_values[$key] = $current;
 }
-
 $template->assign('CF_CONFIG_KEYS_SELECTED', $cf_item_selected);
 $template->assign('CF_CONFIG_KEYS', $config_keys);
Index: /extensions/ContactForm/admin/template/cf_language.tab.tpl
===================================================================
--- /extensions/ContactForm/admin/template/cf_language.tab.tpl	(revision 3745)
+++ /extensions/ContactForm/admin/template/cf_language.tab.tpl	(revision 3746)
@@ -1,3 +1,3 @@
-{* $Id: cf_language.tab.tpl,v 1.1 2009/08/17 07:24:12 Criss Exp $ *}
+{* $Id: cf_language.tab.tpl,v 1.2 2009/08/17 14:53:42 Criss Exp $ *}
 {literal}
 <script type="text/javascript">
@@ -19,15 +19,16 @@
 <table>
   <tr>
-    <td style="vertical-align: top;">
+    <td style="vertical-align: top; text-align: center;">
       <div class="cf-label">{'cf_select_item'|@translate}</div>
-      <select size="1" name="cf_select" id="cf_select" onclick="cf_update_display();">
+      <select size="1" name="cf_select" id="cf_select"
+        onclick="cf_update_display();" onchange="cf_update_display();">
       {html_options options=$CF_CONFIG_KEYS selected=$CF_CONFIG_KEYS_SELECTED}
       </select>
     </td>
-    <td>&nbsp;</td>
-    <td>
+    <td style="width: 3px;">&nbsp;</td>
+    <td style="text-align: center; width: 280px">
       {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>
+        <div class="cf-label">{$CF_CONFIG_KEYS.$config_key}</div>
         <table>
         {foreach from=$config_value item=language_values key=language_key}
Index: /extensions/ContactForm/classes/cf_config_lang.class.php
===================================================================
--- /extensions/ContactForm/classes/cf_config_lang.class.php	(revision 3745)
+++ /extensions/ContactForm/classes/cf_config_lang.class.php	(revision 3746)
@@ -4,5 +4,5 @@
 class CF_Config_Lang {
   static $default_keys = array();
-  static private $available_languages = null;
+  static protected $available_languages = null;
   protected $defined_languages = array();
   protected $added_languages = array();
@@ -26,5 +26,5 @@
   /* ************************ */
 
-  function CF_Config_Lang() {
+  function __construct() {
     $this->init();
   }
@@ -77,5 +77,5 @@
   }
   
-  function get_value($language=null, $key=null) {
+  function get_value($language=null, $key=null, $return_default=true) {
     $values = $this->get_merged_values();
     if (null == $language) {
@@ -89,4 +89,7 @@
     }
     if (!isset($values[$language][$key]) or empty($values[$language][$key])) {
+      if ($return_default) {
+        return $values[CF_LANG_DEFAULT][$key];
+      }
       return null;
     }
@@ -104,4 +107,35 @@
     }
     $this->add_key($key);
+  }
+  
+  function get_extended_values($language=null) {
+    $values = $this->get_merged_values();
+    $return_values = array();
+    foreach($values as $language => $keys) {
+      foreach($keys as $key => $value) {
+        if (!isset($return_values[$key])) {
+          $return_values[$key] = '';
+        }
+        if (!empty($value)) {
+          if (strcmp($language, CF_LANG_DEFAULT) != 0) {
+            $language = substr($language, 0, 2);
+          }
+          $return_values[$key] .= '[lang=' . $language . ']';
+          $return_values[$key] .= $value;
+          $return_values[$key] .= '[/lang]';
+        }
+      }
+    }
+    return $return_values;
+  }
+  
+  function mass_update($new_values = array()) {
+    foreach($new_values as $key => $values) {
+      if (is_array($values)) {
+        foreach($values as $language => $content) {
+          $this->set_value($language, $key, $content);
+        }
+      }
+    }
   }
   
Index: /extensions/ContactForm/classes/cf_plugin.class.php
===================================================================
--- /extensions/ContactForm/classes/cf_plugin.class.php	(revision 3745)
+++ /extensions/ContactForm/classes/cf_plugin.class.php	(revision 3746)
@@ -42,5 +42,5 @@
     global $template;
     $cf_values = array(
-        'TEXT'  => $this->config->get_lang_value('contact_form_footer'),
+        'TEXT'  => $this->config->get_lang_value('contact_form_link'),
         'URL'   => make_index_url(array('section' => CF_URL_PARAMETER)),
       );
Index: /extensions/ContactForm/include/cf_common.inc.php
===================================================================
--- /extensions/ContactForm/include/cf_common.inc.php	(revision 3745)
+++ /extensions/ContactForm/include/cf_common.inc.php	(revision 3746)
@@ -7,5 +7,5 @@
 
 // Version
-define('CF_VERSION',            '1.0.0');
+define('CF_VERSION',            '1.0.1');
 define('CF_TITLE',              'Contact Form');
 
@@ -37,4 +37,5 @@
 define('CF_REDIRECT_DELAY',     5);
 define('CF_DEFAULT_LINKNAME',   'ContactFormLink');
+define('CF_LANG_DEFAULT',       'default');
 // Config keys
 if (isset($plugin)) {
@@ -85,4 +86,5 @@
 $cf_config_lang_keys = array();
 $cf_config_lang_keys['contact_form_title'] = array(
+    CF_LANG_DEFAULT => l10n('contact_form_title'),
     'fr_FR' => 'Formulaire de contact',
     'en_UK' => 'Contact form',
@@ -90,4 +92,5 @@
 );
 $cf_config_lang_keys['contact_form'] = array(
+    CF_LANG_DEFAULT => l10n('contact_form'),
     'fr_FR' => 'Contacter',
     'en_UK' => 'Contact',
@@ -95,4 +98,5 @@
 );
 $cf_config_lang_keys['contact_form_link'] = array(
+    CF_LANG_DEFAULT => l10n('contact_form_link'),
     'fr_FR' => 'Contacter le webmestre',
     'en_UK' => 'Contact webmaster',
Index: /extensions/ContactForm/include/cf_functions.inc.php
===================================================================
--- /extensions/ContactForm/include/cf_functions.inc.php	(revision 3745)
+++ /extensions/ContactForm/include/cf_functions.inc.php	(revision 3746)
@@ -1,4 +1,7 @@
 <?php
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Include language advices
+load_language('plugin.lang', CF_PATH);
 
 /**
Index: /extensions/ContactForm/include/contactform.css
===================================================================
--- /extensions/ContactForm/include/contactform.css	(revision 3745)
+++ /extensions/ContactForm/include/contactform.css	(revision 3746)
@@ -18,7 +18,9 @@
 }
 .cf-label {
+	margin-top: 0;
 	font-size: larger;
 	text-align: center;
-	margin-bottom: 5px;
+  min-height: 40px;
+  margin-bottom: 5px;
 }
 .cf-lang {
Index: /extensions/ContactForm/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/en_UK/plugin.lang.php	(revision 3745)
+++ /extensions/ContactForm/language/en_UK/plugin.lang.php	(revision 3746)
@@ -1,4 +1,4 @@
 <?php
-/* $Id: plugin.lang.php,v 1.5 2009/08/17 07:30:09 Criss Exp $ */
+/* $Id: plugin.lang.php,v 1.6 2009/08/17 14:53:42 Criss Exp $ */
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 global $lang;
@@ -61,4 +61,5 @@
 $lang['cf_language_desc'] = 'Messages translation';
 $lang['cf_select_item'] = 'Select item to translate';
+$lang['cf_default_lang'] = 'Default';
 $lang['contact_form_title_label'] = 'Title used in menubar';
 $lang['contact_form_label'] = 'Name used in menubar';
Index: /extensions/ContactForm/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/fr_FR/plugin.lang.php	(revision 3745)
+++ /extensions/ContactForm/language/fr_FR/plugin.lang.php	(revision 3746)
@@ -1,4 +1,4 @@
 <?php
-/* $Id: plugin.lang.php,v 1.5 2009/08/17 07:30:09 Criss Exp $ */
+/* $Id: plugin.lang.php,v 1.6 2009/08/17 14:53:42 Criss Exp $ */
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 global $lang;
@@ -61,4 +61,5 @@
 $lang['cf_language_desc'] = 'Traduction des messages';
 $lang['cf_select_item'] = 'Sélectionnez l\'élément à traduire';
+$lang['cf_default_lang'] = 'Par défaut';
 $lang['contact_form_title_label'] = 'Titre dans la barre de menus';
 $lang['contact_form_label'] = 'Nom affiché dans la barre de menus';
Index: /extensions/ContactForm/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/it_IT/plugin.lang.php	(revision 3745)
+++ /extensions/ContactForm/language/it_IT/plugin.lang.php	(revision 3746)
@@ -1,4 +1,4 @@
 <?php
-/* $Id: plugin.lang.php,v 1.5 2009/08/17 07:30:10 Criss Exp $ */
+/* $Id: plugin.lang.php,v 1.6 2009/08/17 14:53:42 Criss Exp $ */
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 global $lang;
@@ -61,4 +61,5 @@
 // TODO $lang['cf_language_desc'] = ' ';
 // TODO $lang['cf_select_item'] = ' ';
+$lang['cf_default_lang'] = 'Di default';
 // TODO $lang['contact_form_title_label'] = ' ';
 // TODO $lang['contact_form_label'] = ' ';
Index: /extensions/ContactForm/main.inc.php
===================================================================
--- /extensions/ContactForm/main.inc.php	(revision 3745)
+++ /extensions/ContactForm/main.inc.php	(revision 3746)
@@ -2,5 +2,5 @@
 /*
  Plugin Name: Contact Form
- Version: 1.0.0
+ Version: 1.0.1
  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
@@ -10,4 +10,7 @@
 
 /** History **
+
+  2009-08-17 1.0.1
+                    Add default value to language translation
 
   2009-08-17 1.0.0
