Changeset 24348


Ignore:
Timestamp:
Sep 5, 2013, 12:13:45 PM (7 years ago)
Author:
mistic100
Message:

revert changes form previous commit + fix undefined index after restoration

Location:
extensions/ContactForm
Files:
3 edited

Legend:

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

    r24347 r24348  
    55if (isset($_POST['save_config']))
    66{
     7  $was_ready = $conf['ContactForm']['cf_ready'];
     8 
    79  $conf['ContactForm'] = array(
    8     'cf_ready' =>             $conf['ContactForm']['cf_ready'],
    910    'cf_must_initialize' =>   false,
    1011    'cf_menu_link' =>         isset($_POST['cf_menu_link']),
     
    2526  conf_update_param('ContactForm_after', $conf['ContactForm_after']);
    2627 
     28  $conf['ContactForm']['cf_ready'] = $was_ready;
     29 
    2730  array_push($page['infos'], l10n('Information data registered in database'));
    2831}
  • extensions/ContactForm/include/install.inc.php

    r24347 r24348  
    2222  if (empty($conf['ContactForm']))
    2323  {
    24     $contact_form_default_config = serialize(array(
    25       'cf_ready' => false,
     24    $conf['ContactForm'] = serialize(array(
    2625      'cf_must_initialize' => true,
    2726      'cf_menu_link' => true,
     
    3635      ));
    3736   
    38     conf_update_param('ContactForm', $contact_form_default_config);
    39     conf_update_param('ContactForm_before', null);
    40     conf_update_param('ContactForm_after', null);
    41    
    42     $conf['ContactForm'] = $contact_form_default_config;
    4337    $conf['ContactForm_before'] = null;
    4438    $conf['ContactForm_after'] = null;
     39   
     40    conf_update_param('ContactForm', $conf['ContactForm']);
     41    conf_update_param('ContactForm_before', $conf['ContactForm_before']);
     42    conf_update_param('ContactForm_after', $conf['ContactForm_after']);
    4543  }
    4644  else
     
    9896    }
    9997   
    100     if (!isset($new_conf['cf_ready']))
    101     {
    102       $new_conf['cf_ready'] = false;
    103     }
    104    
    10598    // save config
    10699    $conf['ContactForm'] = serialize($new_conf);
  • extensions/ContactForm/maintain.inc.php

    r18649 r24348  
    2121function plugin_uninstall()
    2222{
    23   global $prefixeTable;
     23  global $prefixeTable, $conf;
    2424 
    25   pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param LIKE "ContactForm%" LIMIT 3;');
     25  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param LIKE "ContactForm%";');
    2626  pwg_query('DROP TABLE IF EXISTS `'. $prefixeTable .'contact_form`;');
     27 
     28  unset($conf['ContactForm'], $conf['ContactForm_before'], $conf['ContactForm_after']);
    2729}
    2830
Note: See TracChangeset for help on using the changeset viewer.