source: extensions/LLGBO2/admin/settings.php

Last change on this file was 29862, checked in by gbo, 10 years ago

Fix notice during installation or activation

File size: 2.0 KB
Line 
1<?php
2// Update configuration settings in database
3global $conf;
4// +-----------------------------------------------------------------------+
5////  MAIN SETTINGS     
6// +-----------------------------------------------------------------------+
7        if ( isset($_POST['submit']) ) 
8        { 
9         $param_llgbo = array(
10                                'version'                        => $default_main['version'],
11                                'frame'                          => empty($_POST['llgbo_frame'])                                ? false : true,
12                                'tooltipdisp'            => empty($_POST['llgbo_tooltipdisp'])                  ? false : true,
13                                'alwaysdisplayexif'      => empty($_POST['llgbo_alwaysdisplayexif'])    ? false : true,
14                                'exifunderbt'            => empty($_POST['llgbo_exifunderbt'])                  ? false : true,
15                                'titleframe'             => empty($_POST['llgbo_titleframe'])                   ? false : true,
16                                'manageheader'           => empty($_POST['llgbo_manageheader'])                 ? false : true,
17                                        );               
18                $conf['LLGBO2'] = update_llgboconf($conf['LLGBO2'], $param_llgbo);
19                //$conf['LLGBO2'] = array_replace($conf['LLGBO2'], $param_llgbo);
20           
21        // Update DB
22                                conf_update_param('LLGBO2_settings',$conf['LLGBO2'],true); 
23                                array_push($page['infos'], l10n('Information data registered in database'));
24       
25        }
26        // +-----------------------------------------------------------------------+
27        // end submit
28        if ( isset($_POST['reset']) ) 
29        {   $conf['LLGBO2'] = update_llgboconf($conf['LLGBO2'], $default_main); 
30                //$conf['LLGBO2'] = array_replace($conf['LLGBO2'], $default_main);
31                }
32       
33 // Reload settings for correct display after update
34  $template->assign('LLGBO_SETTINGS'    ,  array(
35                        'disp_frame'                    => $conf['LLGBO2']['frame'],
36                        'tooltip_disp'                  => $conf['LLGBO2']['tooltipdisp'],
37                        'exif_underbt'                  => $conf['LLGBO2']['exifunderbt'],
38                        'title_frame'                   => $conf['LLGBO2']['titleframe'],
39                        'manage_header'                 => $conf['LLGBO2']['manageheader'] ,
40                        'always_displayexif'    => $conf['LLGBO2']['alwaysdisplayexif']), true); 
41
42   
43// +-----------------------------------------------------------------------+
44////  END       MAIN   
45// +-----------------------------------------------------------------------+
46?>
Note: See TracBrowser for help on using the repository browser.