Ignore:
Timestamp:
Sep 28, 2012, 1:58:02 PM (12 years ago)
Author:
mistic100
Message:
  • add redirect url option
  • remove test code
  • fix fatal error at first installation
Location:
extensions/ContactForm
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContactForm/admin/config.php

    r17945 r18331  
    1414    'cf_mandatory_name' =>    isset($_POST['cf_mandatory_name']),
    1515    'cf_mail_type' =>         $_POST['cf_mail_type'],
     16    'cf_redirect_url' =>      $_POST['cf_redirect_url'],
    1617    );
    1718  $conf['ContactForm_before'] = $_POST['cf_before'];
  • extensions/ContactForm/admin/emails.php

    r17945 r18331  
    55if (isset($_POST['save_emails']))
    66{
    7   var_dump($_POST);
    87  $emails = array();
    98  foreach ($_POST['emails'] as $entry)
  • extensions/ContactForm/admin/template/config.tpl

    r17945 r18331  
    3131          <input type="checkbox" name="cf_mandatory_name" value="1" {if $cf_mandatory_name}checked="checked"{/if}>
    3232          {'Name is mandatory'|@translate}
     33        </label>
     34      </li>
     35      <li>
     36        <label>
     37          <input type="text" name="cf_redirect_url" value="{$cf_redirect_url}" size="30">
     38          {'Redirect after sending email (optional)'|@translate}
    3339        </label>
    3440      </li>
  • extensions/ContactForm/include/contact_form.inc.php

    r18315 r18331  
    2727  {
    2828    case 'validate':
    29       array_push($page['infos'], l10n('E-mail sent successfully'));
    30       unset($contact);
     29      $_SESSION['page_infos'][] = l10n('E-mail sent successfully');
     30      if (!empty($conf['ContactForm']['cf_redirect_url']))
     31      {
     32        redirect($conf['ContactForm']['cf_redirect_url']);
     33      }
     34      else
     35      {
     36        redirect(CONTACT_FORM_PUBLIC);
     37      }
    3138      break;
    3239    case 'moderate':
     
    3441      break;
    3542    default:
    36       trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
     43      trigger_error('Invalid action '.$comment_action, E_USER_WARNING);
    3744  }
    3845}
  • extensions/ContactForm/include/functions.inc.php

    r17945 r18331  
    9393    CONTACT_FORM_TABLE,
    9494    array('name','email','active'),
    95     $email
     95    $emails
    9696    );
    9797 
  • extensions/ContactForm/include/install.inc.php

    r17945 r18331  
    3232      'cf_redirect_delay' => 5,
    3333      'cf_mail_type' => 'text/html',
     34      'cf_redirect_url' => null,
    3435      ));
    3536   
     
    5354      $new_conf['cf_default_subject'] = 'A comment on your site';
    5455      $new_conf['cf_mail_type'] = 'text/html';
     56      $new_conf['cf_redirect_url'] = null;
    5557     
    5658      // move emails to database
  • extensions/ContactForm/language/en_UK/plugin.lang.php

    r17945 r18331  
    5454$lang['%s must not be more than %d characters long'] = '%s must not be more than %d characters long';
    5555$lang['Error while sending e-mail'] = 'Error while sending e-mail';
     56$lang['Redirect after sending email (optional)'] = 'Redirect after sending email (optional)';
    5657
    5758?>
  • extensions/ContactForm/language/fr_FR/plugin.lang.php

    r17945 r18331  
    5555$lang['%s must not be more than %d characters long'] = '%s ne doit pas faire plus de %d caractères';
    5656$lang['Error while sending e-mail'] = 'Erreur lors de l\'envoi de l\'e-mail';
     57$lang['Redirect after sending email (optional)'] = 'Rediriger après l\'envoi du mail (optionel)';
    5758
    5859?>
Note: See TracChangeset for help on using the changeset viewer.