default_main = $default_main; $this->default_tooltip = $default_tooltip; $this->default_frame = $default_frame; $this->default_header = $default_header; } // +-----------------------------------------------------------------------+ // +----------------- default values ---------------------------+ // +-----------------------------------------------------------------------+ // +-----------------------------------------------------------------------+ // +--------------- Install all settings --------------------------------+ // +-----------------------------------------------------------------------+ function install($plugin_version, &$errors=array()) { global $conf; // +-----------------------------------------------------------------------+ if (empty($conf['LLGBO2_Settings'])) { if (isset($conf['LLGBO'])) // compatibility 2.6 --> 2.7 { $Oldvalues = explode("," , $conf['LLGBO']); foreach($Oldvalues as $cle => $valeur) { if ($Oldvalues[$cle] == 'true' ) {$Oldvalues[$cle] = (boolean)true ;} else { $Oldvalues[$cle] = (boolean)false;} } $this->default_main['version'] = 1; $this->default_main['frame'] = $Oldvalues[0]; $this->default_main['tooltipdisp'] = $Oldvalues[1]; $this->default_main['exifunderbt'] = $Oldvalues[2]; $this->default_main['titleframe'] = $Oldvalues[5]; $this->default_main['manageheader'] = $Oldvalues[6]; $this->default_main['alwaysdisplayexif'] = $Oldvalues[10]; conf_delete_param('LLGBO'); // old values before 2.7 } // +-----------------------------------------------------------------------+ if (isset($conf['LLGBOTOOLTIP'])) // compatibility 2.6 --> 2.7 { $Oldvalues = explode("," , $conf['LLGBOTOOLTIP']); $this->default_tooltip['TT-width'] = $Oldvalues[0]; $this->default_tooltip['TT-size'] = $Oldvalues[1]; $this->default_tooltip['TT-bordercolor'] = $Oldvalues[2]; $this->default_tooltip['TT-bgcolor'] = $Oldvalues[3]; $this->default_tooltip['TT-titlecolor'] = $Oldvalues[4]; $this->default_tooltip['TT-textcolor'] = $Oldvalues[5]; conf_delete_param('LLGBOTOOLTIP'); // old values before 2.7 } // +-----------------------------------------------------------------------+ if (isset($conf['LLGBOFRAME'])) // compatibility 2.6 --> 2.7 { $Oldvalues = explode("," , $conf['LLGBOFRAME']); $i=0; for ($x = 1 ;$x < 32 ; $x =$x +2) { $newcolors[$i] = $Oldvalues[$x]; $newsizes[$i] = $Oldvalues[$x +1]; $i = $i +1; } $this->default_frame['FR-titlecolor'] = $Oldvalues[0]; $this->default_frame['FR-sizes'] = $newsizes; $this->default_frame['FR-colors'] = $newcolors; conf_delete_param('LLGBOFRAME'); // old values before 2.7 } // +-----------------------------------------------------------------------+ if (isset($conf['LLGBOHEADER'])) // compatibility 2.6 --> 2.7 { $Oldvalues = explode("," , $conf['LLGBOHEADER']); $i = 0; foreach($this->default_header['HD-dispheader'] as $cle => $valeur) { if ($Oldvalues[$i] == 'true' ) {$Oldvalues[$i] = (boolean)true ;} else { $Oldvalues[$i] = (boolean)false;} $this->default_header['HD-dispheader'][$cle] = $Oldvalues[$i]; $i = $i +1;} conf_delete_param('LLGBOHEADER'); // old values before 2.7 } $conf['LLGBO2'] =array_merge((array)$this->default_main, (array)$this->default_tooltip,(array) $this->default_frame,(array) $this->default_header); print_r($this->default_main); conf_update_param('LLGBO2_Settings', $conf['LLGBO2']); } } // +-----------------------------------------------------------------------+ // +-----------------------------------------------------------------------+ function update($old_version, $new_version, &$errors=array()) { $this->install($new_version, $errors); } // +-----------------------------------------------------------------------+ function uninstall() { conf_delete_param('LLGBO2_Settings'); } } ?>