source: extensions/LLGBO2/maintain.inc.php @ 4581

Revision 4574, 4.2 KB checked in by EXFTB, 10 years ago (diff)

LLGBO improve Header management

  • Property svn:eol-style set to LF
Line 
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// ******************************************
28// ** Database install - uninstall queries **
29// ******************************************
30if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
31function plugin_install()
32{  global $prefixeTable,$conf,$ttvalues,$plugvalues,$frvalues,$headvalues; 
33  plugin_uninstall(); // en cas de mauvaise deinstallation anterieure
34        $q = '
35INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
36        VALUES 
37        ("LLGBO","'.$plugvalues.'","look like gbo global settings");';
38  pwg_query($q);
39        $q = '
40INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
41        VALUES 
42        ("LLGBOTOOLTIP","'.$ttvalues.'","look like gbo tooltip settings");';
43  pwg_query($q);
44        $q = '
45INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
46        VALUES 
47        ("LLGBOFRAME","'.$frvalues.'","look like gbo frame settings");';
48  pwg_query($q);
49        $q = '
50INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
51        VALUES 
52        ("LLGBOHEADER","'.$headvalues.'","look like gbo header settings");';
53  pwg_query($q);
54 
55$conf['LLGBO_SETTINGS'] =  explode("," , $plugvalues);
56$conf['LLGBO_TOOLTIP'] = explode(",",$ttvalues);
57$conf['LLGBO_FRAME'] = explode (",", $frvalues); 
58$conf['LLGBO_HEADER'] = explode (",", $headvalues);
59 
60}
61function plugin_activate()
62{ global $prefixeTable,$conf,$ttvalues,$plugvalues,$frvalues,$headvalues; 
63 ///////////////////////////////////////////////////
64// Vérification de la config, si pas bon -> reinstallation
65$plugvalues = "true,true,true,true,true,true,true,theAboutPage;theTagsPage;theCommentsPage;theIdentificationPage;theAdminPage,true,true";
66$ttvalues = "150,2,#fff,#000,#c92,#dadada";
67$frvalues = "#16195f,#ffffff,3,#040404,1,#ffffff,7,#ffffff,1,#fdfdfd,1,#fcfcfc,1,#fafafa,1,#eaeaea,1,#d3d3d3,1,#bababa,1,#9f9f9f,1,#858585,1,#777777,1,#646464,1,#575757,1,#474747,1";
68$headvalues = "true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true";
69
70//
71 if ( (!isset($conf['LLGBO'])) or (substr_count($conf['LLGBO'], ',')  != 9) 
72 or  (!isset($conf['LLGBOTOOLTIP'])) or (substr_count($conf['LLGBOTOOLTIP'], ',')  != 5) 
73 or  (!isset($conf['LLGBOFRAME'])) or (substr_count($conf['LLGBOFRAME'], ',')  != 32)
74 or  (!isset($conf['LLGBOHEADER'])) or (substr_count($conf['LLGBOHEADER'], ',')  != 21)) 
75        {         plugin_install(); }
76}
77
78function plugin_uninstall()
79{ global $prefixeTable;
80  $q = '
81DELETE FROM '.CONFIG_TABLE.' WHERE param like "LLGBO%" LIMIT 5;';
82  pwg_query( $q );
83}
84
85?>
Note: See TracBrowser for help on using the repository browser.