1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Plugin Name : Register_llgbo | |
---|
4 | // | Plugin Version : 1.0 | |
---|
5 | // | File Version : 0.1 | |
---|
6 | // | Plugin Version author : Ex-FTB | |
---|
7 | // | Plugin description : | |
---|
8 | // | Ce plugin permet d'afficher les miniatures au survol des boutons | |
---|
9 | // | de navigation. This plugin allows display thumbnail under buton | |
---|
10 | // | | |
---|
11 | // +-----------------------------------------------------------------------+ |
---|
12 | // | This program is free software; you can redistribute it and/or modify | |
---|
13 | // | it under the terms of the GNU General Public License as published by | |
---|
14 | // | the Free Software Foundation | |
---|
15 | // | | |
---|
16 | // | This program is distributed in the hope that it will be useful, but | |
---|
17 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
18 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
19 | // | General Public License for more details. | |
---|
20 | // | | |
---|
21 | // | You should have received a copy of the GNU General Public License | |
---|
22 | // | along with this program; if not, write to the Free Software | |
---|
23 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
24 | // | USA. | |
---|
25 | // +-----------------------------------------------------------------------+ |
---|
26 | /* */ |
---|
27 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
28 | |
---|
29 | class MyLLGBO_maintain extends PluginMaintain |
---|
30 | { |
---|
31 | // +-----------------------------------------------------------------------+ |
---|
32 | // +--------------- Install all settings --------------------------------+ |
---|
33 | // +-----------------------------------------------------------------------+ |
---|
34 | function install($plugin_version, &$errors=array()) { |
---|
35 | global $conf; |
---|
36 | // +-----------------------------------------------------------------------+ |
---|
37 | // +----------------- default values ---------------------------+ |
---|
38 | // +-----------------------------------------------------------------------+ |
---|
39 | include(LLGBO_PATH.'defaultvalues.php'); |
---|
40 | // +-----------------------------------------------------------------------+ |
---|
41 | if (empty($conf['LLGBO2settings'])) |
---|
42 | { if (isset($conf['LLGBO'])) // compatibility 2.6 --> 2.7 |
---|
43 | { $Oldvalues = explode("," , $conf['LLGBO']); |
---|
44 | foreach($Oldvalues as $cle => $valeur) |
---|
45 | { if ($Oldvalues[$cle] == 'true' ) |
---|
46 | {$Oldvalues[$cle] = (boolean)true ;} else { $Oldvalues[$cle] = (boolean)false;} |
---|
47 | } |
---|
48 | $default_Main = array( |
---|
49 | 'version' => 1, |
---|
50 | 'frame' => $Oldvalues[0] , |
---|
51 | 'tooltipdisp' => $Oldvalues[1], |
---|
52 | 'exifunderbt' => $Oldvalues[2], |
---|
53 | 'titleframe' => $Oldvalues[5], |
---|
54 | 'manageheader'=> $Oldvalues[6], |
---|
55 | 'alwaysdisplayexif' => $Oldvalues[10],); |
---|
56 | conf_delete_param('LLGBO'); // old values before 2.7 |
---|
57 | } |
---|
58 | conf_update_param('LLGBO2settings',serialize($default_Main), true); |
---|
59 | } |
---|
60 | // +-----------------------------------------------------------------------+ |
---|
61 | if (empty($conf['LLGBO2tooltip'])) |
---|
62 | { if (isset($conf['LLGBOTOOLTIP'])) // compatibility 2.6 --> 2.7 |
---|
63 | { $Oldvalues = explode("," , $conf['LLGBOTOOLTIP']); |
---|
64 | $default_tooltip = array( |
---|
65 | 'TT-width' => $Oldvalues[0], |
---|
66 | 'TT-size' => $Oldvalues[1], |
---|
67 | 'TT-bordercolor' => $Oldvalues[2], |
---|
68 | 'TT-bgcolor' => $Oldvalues[3], |
---|
69 | 'TT-titlecolor' => $Oldvalues[4], |
---|
70 | 'TT-textcolor' => $Oldvalues[5]); |
---|
71 | |
---|
72 | conf_delete_param('LLGBOTOOLTIP'); // old values before 2.7 |
---|
73 | } |
---|
74 | conf_update_param('LLGBO2tooltip',serialize($default_tooltip), true); |
---|
75 | } |
---|
76 | // +-----------------------------------------------------------------------+ |
---|
77 | if (empty($conf['LLGBO2frame'])) |
---|
78 | { if (isset($conf['LLGBOFRAME'])) // compatibility 2.6 --> 2.7 |
---|
79 | { $Oldvalues = explode("," , $conf['LLGBOFRAME']); |
---|
80 | $i=0; |
---|
81 | for ($x = 1 ;$x < 32 ; $x =$x +2) |
---|
82 | { $newcolors[$i] = $Oldvalues[$x]; |
---|
83 | $newsizes[$i] = $Oldvalues[$x +1]; |
---|
84 | $i = $i +1; |
---|
85 | } |
---|
86 | $default_frame = array( |
---|
87 | 'FR-titlecolor' => $Oldvalues[0], |
---|
88 | 'FR-sizes' => $newsizes, |
---|
89 | 'FR-colors' => $newcolors ); |
---|
90 | |
---|
91 | conf_delete_param('LLGBOFRAME'); // old values before 2.7 |
---|
92 | } |
---|
93 | conf_update_param('LLGBO2frame', serialize($default_frame), true); |
---|
94 | } |
---|
95 | // +-----------------------------------------------------------------------+ |
---|
96 | if (empty($conf['LLGBO2header'])) |
---|
97 | { if (isset($conf['LLGBOHEADER'])) // compatibility 2.6 --> 2.7 |
---|
98 | { $Oldvalues = explode("," , $conf['LLGBOHEADER']); |
---|
99 | $i = 0; |
---|
100 | foreach($default_header['HD-dispheader'] as $cle => $valeur) |
---|
101 | { if ($Oldvalues[$i] == 'true' ) {$Oldvalues[$i] = (boolean)true ;} else { $Oldvalues[$i] = (boolean)false;} |
---|
102 | $default_header['HD-dispheader'][$cle] = $Oldvalues[$i]; |
---|
103 | $i = $i +1;} |
---|
104 | conf_delete_param('LLGBOHEADER'); // old values before 2.7 |
---|
105 | } |
---|
106 | conf_update_param('LLGBO2header',serialize($default_header), true); |
---|
107 | } |
---|
108 | } |
---|
109 | |
---|
110 | |
---|
111 | // +-----------------------------------------------------------------------+ |
---|
112 | // +-----------------------------------------------------------------------+ |
---|
113 | function activate($plugin_version, &$errors=array()) |
---|
114 | { $this->install($plugin_version, $errors); |
---|
115 | } |
---|
116 | // +-----------------------------------------------------------------------+ |
---|
117 | function deactivate() { |
---|
118 | /* */ |
---|
119 | } |
---|
120 | // +-----------------------------------------------------------------------+ |
---|
121 | function uninstall() { |
---|
122 | conf_delete_param('LLGBO2settings'); |
---|
123 | conf_delete_param('LLGBO2tooltip'); |
---|
124 | conf_delete_param('LLGBO2frame'); |
---|
125 | conf_delete_param('LLGBO2header'); |
---|
126 | } |
---|
127 | } |
---|
128 | ?> |
---|