Changeset 3809


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

bug 0001147

Replace redirect page by a message on the index one

Location:
extensions
Files:
4 added
10 edited

Legend:

Unmodified
Added
Removed
  • extensions

    • Property svn:ignore set to
      .buildpath
      .project
  • extensions/ContactForm/CHANGELOG

    r3771 r3809  
     12009-08-21 1.0.6
     2                  Replace redirect page by a message on the index one
     3
    142009-08-21 1.0.5
    25                  Add history tab
  • 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) {
  • extensions/ContactForm/include/cf_common.inc.php

    r3771 r3809  
    77
    88// Version
    9 define('CF_VERSION',            '1.0.5');
     9define('CF_VERSION',            '1.0.6');
    1010define('CF_TITLE',              'cf_plugin_name');
    1111
  • extensions/ContactForm/include/cf_functions.inc.php

    r3772 r3809  
    159159      case 0:
    160160        // History item
    161         $change = trim($new_line);
    162         if (!empty($change) and
    163             isset($history[$index]) and is_array($history[$index])) {
    164           array_push($history[$index]['CHANGES'], $change);
     161        if (isset($history[$index]) and is_array($history[$index])) {
     162          array_push($history[$index]['CHANGES'], trim($new_line));
    165163        }
    166164        break;
  • extensions/ContactForm/include/contactform.css

    r3771 r3809  
    3939        font-weight: bold;
    4040}
     41div.cf-button {
     42        margin-left: 5px;
     43}
  • extensions/ContactForm/language/en_UK/plugin.lang.php

    r3771 r3809  
    11<?php
    2 /* $Id: plugin.lang.php,v 1.9 2009/08/21 09:24:18 Criss Exp $ */
     2/* $Id: plugin.lang.php,v 1.10 2009/09/01 13:25:03 Criss Exp $ */
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44global $lang;
     
    4242$lang['cf_delay_not_integer'] = 'Delay must be an integer';
    4343$lang['cf_link_error'] = 'Variable can\'t contain spaces';
     44$lang['cf_hide'] = 'Hide';
    4445
    4546// ==================================================================
  • extensions/ContactForm/language/fr_FR/plugin.lang.php

    r3771 r3809  
    11<?php
    2 /* $Id: plugin.lang.php,v 1.9 2009/08/21 09:24:18 Criss Exp $ */
     2/* $Id: plugin.lang.php,v 1.10 2009/09/01 13:25:03 Criss Exp $ */
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44global $lang;
     
    4242$lang['cf_delay_not_integer'] = 'Le délai doit être un entier';
    4343$lang['cf_link_error'] = 'La variable ne peut pas contenir d\'espaces';
     44$lang['cf_hide'] = 'Masquer';
    4445
    4546// ==================================================================
  • extensions/ContactForm/language/it_IT/plugin.lang.php

    r3789 r3809  
    11<?php
    2 /* $Id: plugin.lang.php,v 1.9 2009/08/21 09:24:18 Criss Exp $ */
     2/* $Id: plugin.lang.php,v 1.10 2009/09/01 13:25:03 Criss Exp $ */
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44global $lang;
     
    3333$lang['cf_error_sending_mail'] = 'Errore durante l\'invio dell\'E-mail';
    3434$lang['cf_sending_mail_successful'] = 'Invio dell\'E-mail riuscito';
    35 TODO $lang['cf_form_error'] = 'Dati errati';
     35$lang['cf_form_error'] = 'Dati errati';
    3636$lang['cf_inconsistent_version'] = '%s : versioni incoerenti';
    3737$lang['cf_no_unlink'] = 'La funzione \'unlink\' non è disponibile';
     
    4242$lang['cf_delay_not_integer'] = 'Il limite deve essere un numero intero';
    4343$lang['cf_link_error'] = 'La variabile non può contenere degli spazi';
     44// TODO $lang['cf_hide'] = '';
    4445
    4546// ==================================================================
     
    5152$lang['cf_config_desc'] = 'Configurazione principale del plugin';
    5253$lang['cf_label_config'] = 'Configurazione generale';
    53 TODO $lang['cf_label_mail'] = 'Configurazione dell\'E-mail';
     54$lang['cf_label_mail'] = 'Configurazione dell\'E-mail';
    5455$lang['cf_menu_link'] = 'Aggiungere un link nel menu';
    5556$lang['cf_guest_allowed'] = 'Autorizzare gli ospiti ad accedere al formulario';
  • extensions/ContactForm/main.inc.php

    r3771 r3809  
    22/*
    33 Plugin Name: Contact Form
    4  Version: 1.0.5
     4 Version: 1.0.6
    55 Description: Add a "Contact" item in the Menu block to offer a contact form to users
    66 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=304
     
    1616
    1717$cf_plugin = new CF_Plugin($plugin['id']);
     18add_event_handler('loc_begin_index',             
     19                  array(&$cf_plugin, 'loc_begin_index'));
    1820add_event_handler('loc_begin_page_tail',             
    1921                  array(&$cf_plugin, 'loc_begin_page_header'));
Note: See TracChangeset for help on using the changeset viewer.