source: extensions/LLGBO2/admin/frame.php @ 29842

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

bad usage of svn --> 2.7B Fix some notice (when no title on frame) and compatibilty Back2Front

File size: 2.8 KB
Line 
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_update_param('LLGBO2_settings',$conf['LLGBO2']); 
21                                array_push($page['infos'], l10n('Information data registered in database'));
22                                unset($samples['MY_LAST_VALUES']);      }
23               
24        }
25// -------- Preview  --
26        if ( isset($_POST['preview']) ) 
27                {   $conf['LLGBO2'] = array_replace($conf['LLGBO2'], $param_llgbo_frame);       }
28               
29// -------- Reset --
30        if ( isset($_POST['reset']) ) 
31                {   $conf['LLGBO2'] = array_replace($conf['LLGBO2'], $default_frame);   }
32       
33// -------- Preview  sample -- 
34        if ( isset($_POST['previewsample'])  and   isset($_POST['sample']) )
35                { 
36                if  (!isset($samples['MY_LAST_VALUES']))
37                   {  $samples['MY_LAST_VALUES']= array( 
38                                                'FR-titlecolor' => $conf['LLGBO2']['FR-titlecolor'],
39                                                'FR-sizes'              => $conf['LLGBO2']['FR-sizes'],
40                                                'FR-colors'             => $conf['LLGBO2']['FR-colors'],); 
41                        }
42                $s = $_POST['sample'];
43                $conf['LLGBO2'] = array_replace($conf['LLGBO2'], $samples[$s]);
44                 
45                }
46 $template->assign('LLGBO_SETTINGS'     ,  array(
47                        'frame_titlecolor'              => $conf['LLGBO2']['FR-titlecolor'],
48                        'FRcolors'                              => $conf['LLGBO2']['FR-colors'],
49                        'FRsizes'                               => $conf['LLGBO2']['FR-sizes']), 
50                        true); 
51       
52///  re draw frame after update
53        Draw_frame();
54// +-----------------------------------------------------------------------+
55 //             END FRAME
56// +-----------------------------------------------------------------------+
57function Draw_frame()
58        {global $conf ,$template;
59        $bd = 0; 
60        $frame_begin ='';
61        $frame_end='';
62               
63        for ($i = 0   ;$i < 16  ; $i++)
64        { 
65        if ((isset($conf['LLGBO2']['FR-sizes'][$i])) and  ($conf['LLGBO2']['FR-sizes'][$i] > 0))
66        {  $frame_begin = '<div  class="llgboFR" style="border: '.$conf['LLGBO2']['FR-sizes'][$i].'px solid '.$conf['LLGBO2']['FR-colors'][$i].'">'."\n".$frame_begin;
67         $frame_end = $frame_end .' </div>';      }
68
69         }
70        $template->assign('FRAME_BEGIN', $frame_begin);
71        $template->assign('FRAME_END', $frame_end); 
72        }
73?>     
Note: See TracBrowser for help on using the repository browser.