Ignore:
Timestamp:
Jul 1, 2014, 11:09:38 AM (10 years ago)
Author:
mistic100
Message:

block menu link sooner, add identifier for menu link

File:
1 edited

Legend:

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

    r28839 r28882  
    3131  global $page;
    3232
    33   if (isset($page['section']) and $page['section'] == 'contact')
     33  if (isset($page['section']) && $page['section'] == 'contact')
    3434  {
    3535    include(CONTACT_FORM_PATH . 'include/contact_form.inc.php');
     
    4444  global $conf;
    4545
    46   if (!$conf['ContactForm']['cf_menu_link']) return;
    47   if (!is_classic_user() and !$conf['ContactForm']['cf_allow_guest']) return;
    48   if (!$conf['ContactForm_ready']) return;
     46  if (!$conf['ContactForm_ready'] || (
     47    !is_classic_user() && !$conf['ContactForm']['cf_allow_guest']
     48  ))
     49  {
     50    return;
     51  }
    4952
    5053  $menu = &$menu_ref_arr[0];
    5154  if (($block = $menu->get_block('mbMenu')) != null)
    5255  {
    53     $block->data[] = array(
     56    $block->data['contact'] = array(
    5457      'URL' => CONTACT_FORM_PUBLIC,
    5558      'NAME' => l10n('Contact'),
     
    6366function contact_form_footer_link($content, &$smarty)
    6467{
    65   $search = '<a href="mailto:{$CONTACT_MAIL}?subject={\'A comment on your site\'|@translate|@escape:url}">';
     68  $search = '#<a href="mailto:{\\$CONTACT_MAIL}\\?subject={\'A comment on your site\'\\|@?translate\\|@?escape:url}">#';
    6669  $replace = '<a href="{$CONTACT_FORM_PUBLIC}">';
    67   return str_replace($search, $replace, $content);
     70  return preg_replace($search, $replace, $content);
    6871}
    6972
Note: See TracChangeset for help on using the changeset viewer.