Ignore:
Timestamp:
Jul 8, 2014, 1:55:14 PM (10 years ago)
Author:
gbo
Message:

Only 1 setting in database

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/LLGBO2/maintain.class.php

    r29004 r29005  
    2929class Look_like_gbo2_maintain extends PluginMaintain
    3030{
    31         private $default_Main;
     31        private $default_main;
    3232        private $default_tooltip;
    3333        private $default_frame;
     
    4040include(PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/' .'defaultvalues.php');
    4141     // variable declared in include       
    42          $this->default_Main = $default_Main;
     42         $this->default_main = $default_main;
    4343         $this->default_tooltip = $default_tooltip;
    4444         $this->default_frame = $default_frame;
     
    5555                global $conf;
    5656// +-----------------------------------------------------------------------+   
    57                 if (empty($conf['LLGBO2settings']))
     57                if (empty($conf['LLGBO2_Settings']))
    5858                        {       if  (isset($conf['LLGBO'])) // compatibility 2.6 --> 2.7
    5959                                        { $Oldvalues = explode("," , $conf['LLGBO']);                   
     
    6262                                                                {$Oldvalues[$cle]  = (boolean)true ;}   else { $Oldvalues[$cle]  = (boolean)false;}
    6363                                                }
    64                                                 $this->default_Main['version']                          =  1;
    65                                                 $this->default_Main['frame']                            =  $Oldvalues[0];
    66                                                 $this->default_Main['tooltipdisp']                      =  $Oldvalues[1];
    67                                                 $this->default_Main['exifunderbt']                      =  $Oldvalues[2];
    68                                                 $this->default_Main['titleframe']                       =  $Oldvalues[5];
    69                                                 $this->default_Main['manageheader']             =  $Oldvalues[6];
    70                                                 $this->default_Main['alwaysdisplayexif']        =  $Oldvalues[10];
     64                                                $this->default_main['version']                          =  1;
     65                                                $this->default_main['frame']                            =  $Oldvalues[0];
     66                                                $this->default_main['tooltipdisp']                      =  $Oldvalues[1];
     67                                                $this->default_main['exifunderbt']                      =  $Oldvalues[2];
     68                                                $this->default_main['titleframe']                       =  $Oldvalues[5];
     69                                                $this->default_main['manageheader']             =  $Oldvalues[6];
     70                                                $this->default_main['alwaysdisplayexif']        =  $Oldvalues[10];
    7171                                                conf_delete_param('LLGBO');  // old values before 2.7
    7272                                        }
    73                                 conf_update_param('LLGBO2settings',serialize($this->default_Main), true);
    74                         }       
     73                       
     74               
    7575// +-----------------------------------------------------------------------+                           
    76                 if (empty($conf['LLGBO2tooltip']))
    77                         {       if  (isset($conf['LLGBOTOOLTIP'])) // compatibility 2.6 --> 2.7
     76                        if  (isset($conf['LLGBOTOOLTIP'])) // compatibility 2.6 --> 2.7
    7877                                        {        $Oldvalues = explode("," , $conf['LLGBOTOOLTIP']);
    7978
     
    8584                                                $this->default_tooltip['TT-textcolor']          = $Oldvalues[5];
    8685                                                       
    87                                                         conf_delete_param('LLGBOTOOLTIP');  // old values before 2.7
     86                                                conf_delete_param('LLGBOTOOLTIP');  // old values before 2.7
    8887                                        }
    89                                 conf_update_param('LLGBO2tooltip',serialize($this->default_tooltip), true);
    90                         }
     88                       
    9189// +-----------------------------------------------------------------------+                           
    92                 if (empty($conf['LLGBO2frame']))       
    93                         { if (isset($conf['LLGBOFRAME']))  // compatibility 2.6 --> 2.7
     90       
     91                        if (isset($conf['LLGBOFRAME']))  // compatibility 2.6 --> 2.7
    9492                                {        $Oldvalues = explode("," , $conf['LLGBOFRAME']);
    9593                                     $i=0;
     
    106104                                        conf_delete_param('LLGBOFRAME');  // old values before 2.7
    107105                                }
    108                                 conf_update_param('LLGBO2frame', serialize($this->default_frame), true);
    109                         }
     106               
    110107// +-----------------------------------------------------------------------+                                   
    111                 if (empty($conf['LLGBO2header']))       
    112                         { if (isset($conf['LLGBOHEADER']))  // compatibility 2.6 --> 2.7
     108       
     109                        if (isset($conf['LLGBOHEADER']))  // compatibility 2.6 --> 2.7
    113110                                {       $Oldvalues = explode("," , $conf['LLGBOHEADER']);
    114111                                        $i = 0;
     
    119116                                        conf_delete_param('LLGBOHEADER');  // old values before 2.7
    120117                                }
    121                                 conf_update_param('LLGBO2header',serialize($this->default_header), true);       
    122                         }
    123 
     118               
     119         $conf['LLGBO2'] =array_merge((array)$this->default_main, (array)$this->default_tooltip,(array) $this->default_frame,(array) $this->default_header);
     120                 print_r($this->default_main);
     121                 conf_update_param('LLGBO2_Settings', $conf['LLGBO2']);
     122                }
    124123        }
    125124
     
    134133// +-----------------------------------------------------------------------+
    135134        function uninstall() { 
    136                 conf_delete_param('LLGBO2settings');
    137                 conf_delete_param('LLGBO2tooltip');
    138                 conf_delete_param('LLGBO2frame');
    139                 conf_delete_param('LLGBO2header');
     135                conf_delete_param('LLGBO2_Settings');
     136       
    140137        }
    141138}
Note: See TracChangeset for help on using the changeset viewer.