Changeset 5421 for extensions/AMenuManager/amm_install.class.inc.php
- Timestamp:
- Mar 28, 2010, 5:57:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMenuManager/amm_install.class.inc.php
r4391 r5421 4 4 Author : Grum 5 5 email : grum@grum.dnsalias.com 6 website : http://photos.grum. dnsalias.com6 website : http://photos.grum.fr 7 7 PWG user : http://forum.phpwebgallery.net/profile.php?id=3706 8 8 … … 14 14 15 15 --------------------------------------------------------------------------- */ 16 @include_once('amm_root.class.inc.php'); 16 include_once('amm_version.inc.php'); 17 include_once('amm_root.class.inc.php'); 17 18 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php'); 18 19 … … 36 37 public function install() 37 38 { 39 $this->init_config(); 40 $this->load_config(); 41 $this->my_config['installed']=AMM_VERSION2; 42 $this->save_config(); 38 43 39 44 $tables_def=array( … … 53 58 `id` int(11) NOT NULL default '0', 54 59 `lang` varchar(5) NOT NULL default '', 55 `title` varchar( 50) NOT NULL default '',60 `title` varchar(255) NOT NULL default '', 56 61 `content` text NOT NULL, 57 62 `visible` char(1) NOT NULL default 'y', 58 `nfo` varchar(25 ) NOT NULL default '',63 `nfo` varchar(255) NOT NULL default '', 59 64 PRIMARY KEY (`id`,`lang`) 60 65 )" … … 83 88 $this->init_config(); 84 89 $this->load_config(); 90 91 $this->udpateTablesDef(); 92 93 $this->my_config['installed']=AMM_VERSION2; //update the installed release number 94 $this->save_config(); 95 } 96 97 public function deactivate() 98 { 99 } 100 101 102 /** 103 * update tables & config between releases 104 * 105 */ 106 protected function udpateTablesDef() 107 { 85 108 /* AMM release earlier than the 2.1.3 uses two parameters to manage the display 86 109 * of the menu items ("amm_sections_modspecials" and "amm_sections_modmenu") … … 108 131 } 109 132 110 $this->save_config(); 111 } 133 if(!array_key_exists('installed', $this->my_config)) 134 { 135 /* 136 * if key does not exist, probably try to update a plugin older than the 137 * 2.2.0 release 138 */ 139 $this->my_config['installed']="02.01.06"; 140 } 112 141 113 public function deactivate() 114 { 142 if($this->my_config['installed']<="02.01.06") 143 { 144 /* 145 * 2.2.0 updates 146 * 147 * - update fields length for table 'personalised' 148 * - update config for menu translation 149 */ 150 $sql="ALTER TABLE `".$this->tables['personalised']."` 151 MODIFY COLUMN `title` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, 152 MODIFY COLUMN `nfo` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;"; 153 pwg_query($sql); 154 155 foreach($this->my_config['amm_sections_items'] as $key => $val) 156 { 157 $this->my_config['amm_sections_items'][$key]['translation'] = $this->defaultMenus[$key]['translation']; 158 } 159 } 115 160 } 116 161
Note: See TracChangeset
for help on using the changeset viewer.