Index: /extensions/ContactForm/admin/cf_config.tab.php
===================================================================
--- /extensions/ContactForm/admin/cf_config.tab.php	(revision 7196)
+++ /extensions/ContactForm/admin/cf_config.tab.php	(revision 7197)
@@ -42,25 +42,4 @@
   }
   $cf_config->set_value(CF_CFG_MAIL_MANDATORY, $new_value);
-
-  // Define link
-  $new_value = false;
-  if (isset($_POST['cf_define_link'])) {
-    if ('1' == $_POST['cf_define_link']) {
-      $new_value = true;
-    }
-  }
-  $cf_config->set_value(CF_CFG_DEFINE_LINK, $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) {
-      CF_Log::add_error(l10n('cf_link_error'));
-    } else {
-      $cf_config->set_value(CF_CFG_CONTACT_LINK, $new_value);
-    }
-  }
   
   // Prefix
@@ -120,7 +99,4 @@
     'SEPARATOR_LENGTH'  => $cf_config->get_value(CF_CFG_SEPARATOR_LEN),
     'REDIRECT_DELAY'    => $cf_config->get_value(CF_CFG_REDIRECT_DELAY),
-    'DEFINE_LINK'       => $cf_config->get_value(CF_CFG_DEFINE_LINK)?
-                              CF_CHECKED:'',
-    'LINK'              => $cf_config->get_value(CF_CFG_CONTACT_LINK),
   );
 
Index: /extensions/ContactForm/admin/themes/cf_config.tab.tpl
===================================================================
--- /extensions/ContactForm/admin/themes/cf_config.tab.tpl	(revision 7196)
+++ /extensions/ContactForm/admin/themes/cf_config.tab.tpl	(revision 7197)
@@ -32,21 +32,4 @@
         <input type="checkbox" name="cf_mandatory_mail" value="1" {$CF_CONFIG.NEED_MAIL} />
         {'cf_mandatory_mail'|@translate}
-      </label>
-    </li>
-  </ul>
-</fieldset>
-<fieldset>
-  <legend>{'cf_label_link'|@translate}</legend>
-  <ul>
-    <li>
-      <label>
-        <input type="checkbox" name="cf_define_link" value="1" {$CF_CONFIG.DEFINE_LINK} />
-        {'cf_define_link'|@translate}
-      </label>
-    </li>
-    <li>
-      <label>
-        <input type="text" name="cf_link" value="{$CF_CONFIG.LINK}" />
-        {'cf_link'|@translate}
       </label>
     </li>
Index: /extensions/ContactForm/classes/cf_plugin.class.php
===================================================================
--- /extensions/ContactForm/classes/cf_plugin.class.php	(revision 7196)
+++ /extensions/ContactForm/classes/cf_plugin.class.php	(revision 7197)
@@ -44,8 +44,12 @@
   }
   function loc_begin_page_header() {
-    if (!$this->config->get_value(CF_CFG_DEFINE_LINK)) {
+    global $template;
+    
+    $template->set_prefilter('tail', 'contactForm_prefilter');
+
+    if (!$this->check_allowed()) {
       return;
     }
-    global $template;
+    
     $cf_values = array(
         'TEXT'  => $this->config->get_lang_value('contact_form_link'),
@@ -53,6 +57,6 @@
       );
     $template->assign('CF_FOOTER_VALUES', $cf_values);
-    $template->assign($this->config->get_value(CF_CFG_CONTACT_LINK),
-                      $this->get_html_contact_form_link());
+
+    $template->assign('ContactFormLink', $this->get_html_contact_form_link());
   }
   
Index: /extensions/ContactForm/include/cf_common.inc.php
===================================================================
--- /extensions/ContactForm/include/cf_common.inc.php	(revision 7196)
+++ /extensions/ContactForm/include/cf_common.inc.php	(revision 7197)
@@ -37,5 +37,4 @@
 define('CF_DEFAULT_PREFIX',     'Piwigo ContactForm');
 define('CF_REDIRECT_DELAY',     5);
-define('CF_DEFAULT_LINKNAME',   'ContactFormLink');
 define('CF_LANG_DEFAULT',       'default');
 // Config keys
@@ -56,6 +55,4 @@
 define('CF_CFG_NAME_MANDATORY', 'cf_mandatory_name');
 define('CF_CFG_REDIRECT_DELAY', 'cf_redirect_delay');
-define('CF_CFG_DEFINE_LINK',    'cf_define_link');
-define('CF_CFG_CONTACT_LINK',   'cf_link');
 define('CF_CFG_ADMIN_MAILS',    'cf_admin_mails');
 
@@ -86,6 +83,4 @@
 $cf_config_default[CF_CFG_NAME_MANDATORY] = true;
 $cf_config_default[CF_CFG_REDIRECT_DELAY] = CF_REDIRECT_DELAY;
-$cf_config_default[CF_CFG_DEFINE_LINK] = true;
-$cf_config_default[CF_CFG_CONTACT_LINK] = CF_DEFAULT_LINKNAME;
 $cf_config_default[CF_CFG_ADMIN_MAILS] = cf_get_admins_contacts();
 $cf_config_default[CF_CFG_ADMIN_MAILS] = array();
Index: /extensions/ContactForm/include/cf_functions.inc.php
===================================================================
--- /extensions/ContactForm/include/cf_functions.inc.php	(revision 7196)
+++ /extensions/ContactForm/include/cf_functions.inc.php	(revision 7197)
@@ -140,4 +140,11 @@
   }
 }
+
+function contactForm_prefilter($content, &$smarty) {
+  $search = '#{if\s+isset\s*\(\s*\$CONTACT_MAIL\s*\)\s*}.*?{/if}#s';
+  $replacement = '{if isset($ContactFormLink)}{$ContactFormLink}{/if}';
+
+  return preg_replace($search, $replacement, $content);
+}
   
 function cf_clean_obsolete_files($obsolete_file_list) {
Index: /extensions/ContactForm/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/de_DE/plugin.lang.php	(revision 7196)
+++ /extensions/ContactForm/language/de_DE/plugin.lang.php	(revision 7197)
@@ -123,10 +123,4 @@
 $lang['cf_redirect_delay'] = 'Wartezeit bis zur Weiterleitung (s) ';
 
-$lang['cf_label_link'] = 'Linkverwaltung (ausser der des Menüs)';
-
-$lang['cf_define_link'] = 'Den Link bestimmen';
-
-$lang['cf_link'] = 'Name der Template-Variable mit dem HTML-Link zum Kontaktformular';
-
 // Emails tab
 
Index: /extensions/ContactForm/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/en_UK/plugin.lang.php	(revision 7196)
+++ /extensions/ContactForm/language/en_UK/plugin.lang.php	(revision 7197)
@@ -62,7 +62,4 @@
 $lang['cf_mandatory_mail'] = 'E-mail address is mandatory';
 $lang['cf_redirect_delay'] = 'Pause delay of redirection';
-$lang['cf_label_link'] = 'Link management (outside menubar)';
-$lang['cf_define_link'] = 'Define link';
-$lang['cf_link'] = 'Name of the template variable containing the HTML link to the contact form';
 // Emails tab
 $lang['cf_tab_emails'] = 'E-mails';
Index: /extensions/ContactForm/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/es_ES/plugin.lang.php	(revision 7196)
+++ /extensions/ContactForm/language/es_ES/plugin.lang.php	(revision 7197)
@@ -61,7 +61,4 @@
 $lang['cf_mandatory_mail'] = 'Presencia del e-mail obligatorio';
 $lang['cf_redirect_delay'] = 'Plazo de pausa del redirection';
-$lang['cf_label_link'] = 'Gestión del lazo (fuera de menú) hacia el formulario';
-$lang['cf_define_link'] = 'Definir el lazo';
-$lang['cf_link'] = 'Nombre de la variable de template que contiene el lazo HTML hacia el formulario de contacto';
 // Emails tab
 $lang['cf_tab_emails'] = 'E-mail';
Index: /extensions/ContactForm/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/fr_FR/plugin.lang.php	(revision 7196)
+++ /extensions/ContactForm/language/fr_FR/plugin.lang.php	(revision 7197)
@@ -62,7 +62,4 @@
 $lang['cf_mandatory_mail'] = 'Présence de l\'e-mail obligatoire';
 $lang['cf_redirect_delay'] = 'Délai de pause de la redirection';
-$lang['cf_label_link'] = 'Gestion du lien (hors menu) vers le formulaire';
-$lang['cf_define_link'] = 'Définir le lien';
-$lang['cf_link'] = 'Nom de la variable de template contenant le lien HTML vers le formulaire de contact';
 // Emails tab
 $lang['cf_tab_emails'] = 'E-mails';
Index: /extensions/ContactForm/language/hu_HU/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/hu_HU/plugin.lang.php	(revision 7196)
+++ /extensions/ContactForm/language/hu_HU/plugin.lang.php	(revision 7197)
@@ -62,7 +62,4 @@
 $lang['cf_mandatory_mail'] = 'E-mail cím kötelező';
 $lang['cf_redirect_delay'] = 'Átirányítás késleltetésének ideje';
-$lang['cf_label_link'] = 'Link kezelése (menüsávon kívül)';
-$lang['cf_define_link'] = 'Link meghatározása';
-$lang['cf_link'] = 'A mintasablon neve változó taralommal a HTML link a kapcsolati űrlaphoz';
 // Emails tab
 $lang['cf_tab_emails'] = 'E-mail címek';
Index: /extensions/ContactForm/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/it_IT/plugin.lang.php	(revision 7196)
+++ /extensions/ContactForm/language/it_IT/plugin.lang.php	(revision 7197)
@@ -61,7 +61,4 @@
 $lang['cf_mandatory_mail'] = 'E-mail obbligatoria';
 $lang['cf_redirect_delay'] = 'Limite d\'attesa ';
-$lang['cf_label_link'] = 'Gestione del link (escluso quello del menu) verso il formulario';
-$lang['cf_define_link'] = 'Definire il link';
-$lang['cf_link'] = 'Nome della variabile del template contenente il link HTML verso il formulario di contatto';
 // Emails tab
 $lang['cf_tab_emails'] = 'E-mails';
Index: /extensions/ContactForm/language/pl_PL/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/pl_PL/plugin.lang.php	(revision 7196)
+++ /extensions/ContactForm/language/pl_PL/plugin.lang.php	(revision 7197)
@@ -62,7 +62,4 @@
 $lang['cf_mandatory_mail'] = 'Adres e-mail address is wymagany';
 $lang['cf_redirect_delay'] = 'Wstrzymaj opóźnienie przekierowania';
-$lang['cf_label_link'] = 'Zarządzanie linkiem (poza menubar)';
-$lang['cf_define_link'] = 'Zdefiniuj link';
-$lang['cf_link'] = 'Nazwa zmiennej zawierającej link HTML do formularza kontaktu';
 // Emails tab
 $lang['cf_tab_emails'] = 'Adresy';
Index: /extensions/ContactForm/language/sk_SK/plugin.lang.php
===================================================================
--- /extensions/ContactForm/language/sk_SK/plugin.lang.php	(revision 7196)
+++ /extensions/ContactForm/language/sk_SK/plugin.lang.php	(revision 7197)
@@ -62,7 +62,4 @@
 $lang['cf_mandatory_mail'] = 'E-mailová adresa je povinná';
 $lang['cf_redirect_delay'] = 'Dĺžka pauzy pri presmerovaní';
-$lang['cf_label_link'] = 'Manažment linku (mimo menu)';
-$lang['cf_define_link'] = 'Definovanie linku';
-$lang['cf_link'] = 'Názov šablónových premenných obsahujúcich HTML linky na kontaktný formulár';
 // Emails tab
 $lang['cf_tab_emails'] = 'E-maily';
Index: /extensions/ContactForm/themes/cf_link.tpl
===================================================================
--- /extensions/ContactForm/themes/cf_link.tpl	(revision 7196)
+++ /extensions/ContactForm/themes/cf_link.tpl	(revision 7197)
@@ -1,1 +1,1 @@
-<a href="{$CF_LINK.URL}">{$CF_LINK.TEXT}</a>
+- <a href="{$CF_LINK.URL}">{$CF_LINK.TEXT}</a>
