Ignore:
Timestamp:
Sep 1, 2009, 3:31:24 PM (15 years ago)
Author:
Criss
Message:

bug 0001147

Replace redirect page by a message on the index one

Location:
extensions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions

    • Property svn:ignore set to
      .buildpath
      .project
  • extensions/ContactForm/classes/cf_plugin.class.php

    r3749 r3809  
    4040  }
    4141 
     42  function loc_begin_index() {
     43    $this->display_message();
     44  }
    4245  function loc_begin_page_header() {
    4346    if (!$this->config->get_value(CF_CFG_DEFINE_LINK)) {
     
    224227        'cf_messages' => realpath(cf_get_template('cf_messages.tpl')),
    225228      ));
     229     
    226230    $template->block_html_head( '',
    227231              '<link rel="stylesheet" type="text/css" '.
     
    242246    $redirect_msg = $template->parse('cf_redirect', true);
    243247    $redirect_delay = $this->config->get_value(CF_CFG_REDIRECT_DELAY);
    244     redirect_html($redirect_url, $redirect_msg, $redirect_delay);
     248//    redirect($redirect_url, $redirect_msg, $redirect_delay);
     249    redirect($redirect_url);
     250  }
     251 
     252  protected function display_message() {
     253    $infos = pwg_get_session_var('cf_infos');
     254    pwg_unset_session_var('cf_infos');
     255    if ( null == $infos or
     256        (empty($infos['infos']) and
     257         empty($infos['errors']))
     258        ) {
     259      return;
     260    }
     261    global $template;
     262    $template->set_filenames(array(
     263        'cf_index'    => realpath(cf_get_template('cf_messages_index.tpl')),
     264        'cf_title'    => realpath(cf_get_template('cf_title.tpl')),
     265        'cf_button'   => realpath(cf_get_template('cf_button.tpl')),
     266        'cf_messages' => realpath(cf_get_template('cf_messages.tpl')),
     267      ));
     268     
     269    $template->block_html_head( '',
     270              '<link rel="stylesheet" type="text/css" '.
     271              'href="' . CF_INCLUDE . 'contactform.css' . '">',
     272              $smarty, $repeat);
     273    $cf = array(
     274        'TITLE'     => 'contact_form_title',
     275      );
     276    if (!empty($infos['errors'])) {
     277      $template->assign('errors', $infos['errors']);
     278    }
     279    if (!empty($infos['infos'])) {
     280      $template->assign('infos', $infos['infos']);
     281    }
     282    $template->assign('CF', $cf);
     283    $template->assign_var_from_handle('CF_TITLE', 'cf_title');
     284    $template->assign_var_from_handle('CF_MESSAGES', 'cf_messages');
     285    $template->assign_var_from_handle('CF_BUTTON', 'cf_button');
     286   
     287    $begin = 'PLUGIN_INDEX_CONTENT_BEFORE';
     288    $old_begin = $template->get_template_vars($begin);
     289    $template->assign_var_from_handle($begin, 'cf_index');
     290    $template->concat($begin, $old_begin);
    245291  }
    246292 
     
    253299        $this->display_form($infos);
    254300      } else {
    255         $this->redirect(make_index_url(),$infos);
     301        pwg_set_session_var('cf_infos', array(
     302            'infos'  => $infos['infos'],
     303            'errors' => $infos['errors'],
     304          ));
     305        redirect(make_index_url());
     306        //$this->redirect(make_index_url(),$infos);
    256307      }
    257308    } else {
     
    294345    add_event_handler('send_mail_content',             
    295346                      array(&$this, 'send_mail_content'));
    296     $return = @pwg_mail(
    297       $webmaster_mail,
    298       $mail_args
    299     );
     347
     348    $return = true;
     349//    $return = @pwg_mail(
     350//      $webmaster_mail,
     351//      $mail_args
     352//    );
     353
    300354    cf_switch_back_to_user_lang();
    301355    if (!$return) {
Note: See TracChangeset for help on using the changeset viewer.