Ignore:
Timestamp:
Oct 15, 2010, 4:20:39 PM (14 years ago)
Author:
plg
Message:

feature 1897 added: the core "Contact Webmaster" link in footer is replaced by
a link to the ContactForm page. It works with a smarty prefilter, so it should
work with all themes.

The configurable template variable name was removed. It is hard coded as
$ContactFormLink. I've seen no example using another variable name. It was
hard to understand for users in the administration panel and not very useful.
The corresponding language keys were removed from all languages.

bug 1916 fixed: apply the same rule for link display in footer as in menu. If
the administrator has allowed the ContactForm page for guests, let's display
it in the menu + footer.

Location:
extensions/ContactForm/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContactForm/include/cf_common.inc.php

    r7136 r7197  
    3737define('CF_DEFAULT_PREFIX',     'Piwigo ContactForm');
    3838define('CF_REDIRECT_DELAY',     5);
    39 define('CF_DEFAULT_LINKNAME',   'ContactFormLink');
    4039define('CF_LANG_DEFAULT',       'default');
    4140// Config keys
     
    5655define('CF_CFG_NAME_MANDATORY', 'cf_mandatory_name');
    5756define('CF_CFG_REDIRECT_DELAY', 'cf_redirect_delay');
    58 define('CF_CFG_DEFINE_LINK',    'cf_define_link');
    59 define('CF_CFG_CONTACT_LINK',   'cf_link');
    6057define('CF_CFG_ADMIN_MAILS',    'cf_admin_mails');
    6158
     
    8683$cf_config_default[CF_CFG_NAME_MANDATORY] = true;
    8784$cf_config_default[CF_CFG_REDIRECT_DELAY] = CF_REDIRECT_DELAY;
    88 $cf_config_default[CF_CFG_DEFINE_LINK] = true;
    89 $cf_config_default[CF_CFG_CONTACT_LINK] = CF_DEFAULT_LINKNAME;
    9085$cf_config_default[CF_CFG_ADMIN_MAILS] = cf_get_admins_contacts();
    9186$cf_config_default[CF_CFG_ADMIN_MAILS] = array();
  • extensions/ContactForm/include/cf_functions.inc.php

    r6547 r7197  
    140140  }
    141141}
     142
     143function contactForm_prefilter($content, &$smarty) {
     144  $search = '#{if\s+isset\s*\(\s*\$CONTACT_MAIL\s*\)\s*}.*?{/if}#s';
     145  $replacement = '{if isset($ContactFormLink)}{$ContactFormLink}{/if}';
     146
     147  return preg_replace($search, $replacement, $content);
     148}
    142149 
    143150function cf_clean_obsolete_files($obsolete_file_list) {
Note: See TracChangeset for help on using the changeset viewer.