source: extensions/AMenuManager/amm_install.class.inc.php @ 4193

Last change on this file since 4193 was 3681, checked in by grum, 15 years ago

Add plugin Advanced Menu Manager 2.1.0

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1<?php
2/* -----------------------------------------------------------------------------
3  Plugin     : Advanced Menu Manager
4  Author     : Grum
5    email    : grum@grum.dnsalias.com
6    website  : http://photos.grum.dnsalias.com
7    PWG user : http://forum.phpwebgallery.net/profile.php?id=3706
8
9    << May the Little SpaceFrog be with you ! >>
10  ------------------------------------------------------------------------------
11  See main.inc.php for release information
12
13  MyPolls_Install : classe to manage plugin install
14
15  --------------------------------------------------------------------------- */
16  @include_once('amm_root.class.inc.php');
17  include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
18
19
20  class AMM_install extends AMM_root
21  {
22    private $tablef;
23    private $exportfile;
24
25    public function AMM_install($prefixeTable, $filelocation)
26    {
27      parent::__construct($prefixeTable, $filelocation);
28      $this->tablef= new manage_tables($this->tables);
29      $this->exportfile=dirname($this->filelocation).'/'.$this->plugin_name_files.'.sql';
30    }
31
32    /*
33        function for installation process
34        return true if install process is ok, otherwise false
35    */ 
36    public function install()
37    {
38
39      $tables_def=array(
40"CREATE TABLE  `".$this->tables['urls']."` (
41  `id` int(11) NOT NULL auto_increment,
42  `label` varchar(50) NOT NULL default '',
43  `url` varchar(255) NOT NULL default '',
44  `mode` int(11) NOT NULL default '0',
45  `icon` varchar(50) NOT NULL default '',
46  `position` int(11) NOT NULL default '0',
47  `visible` char(1) NOT NULL default 'y',
48  PRIMARY KEY  (`id`),
49  KEY `order_key` (`position`)
50)",
51
52"CREATE TABLE  `".$this->tables['personalised']."` (
53  `id` int(11) NOT NULL default '0',
54  `lang` varchar(5) NOT NULL default '',
55  `title` varchar(50) NOT NULL default '',
56  `content` text NOT NULL,
57  `visible` char(1) NOT NULL default 'y',
58  `nfo` varchar(25) NOT NULL default '',
59  PRIMARY KEY  (`id`,`lang`)
60)"
61);
62      //$table_def array
63      $tables_def = create_table_add_character_set($tables_def);
64      $result=$this->tablef->create_tables($tables_def);
65      return($result);
66    }
67
68
69    /*
70        function for uninstall process
71    */
72    public function uninstall()
73    {
74      $this->tablef->export($this->exportfile);
75      $this->delete_config();
76      $this->tablef->drop_tables();
77    }
78
79    public function activate()
80    {
81      global $template;
82
83      $this->init_config();
84      $this->load_config();
85      $this->save_config();
86    }
87
88    public function deactivate()
89    {
90    }
91
92  } //class
93
94?>
Note: See TracBrowser for help on using the repository browser.