1 | <?php |
---|
2 | // Update configuration settings in database |
---|
3 | |
---|
4 | // +-----------------------------------------------------------------------+ |
---|
5 | ///// FRAME |
---|
6 | // +-----------------------------------------------------------------------+ |
---|
7 | if ( isset($_POST['save']) or isset($_POST['preview'])) |
---|
8 | { for ($i = 0 ;$i < 16 ; $i++) |
---|
9 | { $newcolors[$i] = empty($_POST['llgbo_frame_bdcolor'.$i]) ? '#fff' : $_POST['llgbo_frame_bdcolor'.$i]; |
---|
10 | $newsizes[$i] = empty($_POST['llgbo_frame_bdsize'.$i]) ? 0 : $_POST['llgbo_frame_bdsize'.$i]; |
---|
11 | } |
---|
12 | |
---|
13 | $param_llgbo_frame = array( |
---|
14 | 'FR-titlecolor' => empty($_POST['llgbo_frame_titlecolor']) ? $default_frame['FR-titlecolor'] : $_POST['llgbo_frame_titlecolor'], |
---|
15 | 'FR-sizes' => $newsizes, |
---|
16 | 'FR-colors' => $newcolors,); |
---|
17 | // -------- Save -- |
---|
18 | if ( isset($_POST['save']) ) |
---|
19 | { // $conf['LLGBO2'] = array_replace($conf['LLGBO2'], $param_llgbo_frame); |
---|
20 | $conf['LLGBO2'] = update_llgboconf($conf['LLGBO2'], $param_llgbo_frame); |
---|
21 | conf_update_param('LLGBO2_settings',$conf['LLGBO2'],true); |
---|
22 | array_push($page['infos'], l10n('Information data registered in database')); |
---|
23 | unset($samples['MY_LAST_VALUES']); } |
---|
24 | |
---|
25 | } |
---|
26 | // -------- Preview -- |
---|
27 | if ( isset($_POST['preview']) ) |
---|
28 | { $conf['LLGBO2'] = update_llgboconf($conf['LLGBO2'], $param_llgbo_frame); |
---|
29 | // $conf['LLGBO2'] = array_replace($conf['LLGBO2'], $param_llgbo_frame); |
---|
30 | } |
---|
31 | |
---|
32 | // -------- Reset -- |
---|
33 | if ( isset($_POST['reset']) ) |
---|
34 | { $conf['LLGBO2'] = update_llgboconf($conf['LLGBO2'], $default_frame); |
---|
35 | //$conf['LLGBO2'] = array_replace($conf['LLGBO2'], $default_frame); |
---|
36 | } |
---|
37 | |
---|
38 | // -------- Preview sample -- |
---|
39 | if ( isset($_POST['previewsample']) and isset($_POST['sample']) ) |
---|
40 | { |
---|
41 | if (!isset($samples['MY_LAST_VALUES'])) |
---|
42 | { $samples['MY_LAST_VALUES']= array( |
---|
43 | 'FR-titlecolor' => $conf['LLGBO2']['FR-titlecolor'], |
---|
44 | 'FR-sizes' => $conf['LLGBO2']['FR-sizes'], |
---|
45 | 'FR-colors' => $conf['LLGBO2']['FR-colors'],); |
---|
46 | } |
---|
47 | $s = $_POST['sample']; |
---|
48 | $conf['LLGBO2'] = update_llgboconf($conf['LLGBO2'], $samples[$s]); |
---|
49 | // $conf['LLGBO2'] = array_replace($conf['LLGBO2'], $samples[$s]); |
---|
50 | |
---|
51 | } |
---|
52 | $template->assign('LLGBO_SETTINGS' , array( |
---|
53 | 'frame_titlecolor' => $conf['LLGBO2']['FR-titlecolor'], |
---|
54 | 'FRcolors' => $conf['LLGBO2']['FR-colors'], |
---|
55 | 'FRsizes' => $conf['LLGBO2']['FR-sizes']), |
---|
56 | true); |
---|
57 | |
---|
58 | /// re draw frame after update |
---|
59 | Draw_frame(); |
---|
60 | // +-----------------------------------------------------------------------+ |
---|
61 | // END FRAME |
---|
62 | // +-----------------------------------------------------------------------+ |
---|
63 | function Draw_frame() |
---|
64 | {global $conf ,$template; |
---|
65 | $bd = 0; |
---|
66 | $frame_begin =''; |
---|
67 | $frame_end=''; |
---|
68 | |
---|
69 | for ($i = 0 ;$i < 16 ; $i++) |
---|
70 | { |
---|
71 | if ((isset($conf['LLGBO2']['FR-sizes'][$i])) and ($conf['LLGBO2']['FR-sizes'][$i] > 0)) |
---|
72 | { $frame_begin = '<div class="llgboFR" style="border: '.$conf['LLGBO2']['FR-sizes'][$i].'px solid '.$conf['LLGBO2']['FR-colors'][$i].'">'."\n".$frame_begin; |
---|
73 | $frame_end = $frame_end .' </div>'; } |
---|
74 | |
---|
75 | } |
---|
76 | $template->assign('FRAME_BEGIN', $frame_begin); |
---|
77 | $template->assign('FRAME_END', $frame_end); |
---|
78 | } |
---|
79 | ?> |
---|