'', 'physical_postfix' => '', 'virtual_prefix' => '', 'virtual_postfix' => '', 'parent_cat' => null, 'lock_physical' => false, 'private_physical' => false, 'unlock_virtual' => false, 'inherit' => false, 'update_on_manual' => true, 'update_on_upload' => false, 'update_on_date' => false, 'update_timeout' => 3, 'last_update' => 0, 'store_structure' => true, ); function __construct($plugin_id) { global $prefixeTable; parent::__construct($plugin_id); $this->table = $prefixeTable . 'phy2virt_categories'; } function install($plugin_version, &$errors=array()) { global $conf, $prefixeTable; if (empty($conf['physical2virtual'])) { $conf['physical2virtual'] = serialize($this->default_conf); conf_update_param('physical2virtual', $conf['physical2virtual']); } else { $new_conf = is_string($conf['physical2virtual']) ? unserialize($conf['physical2virtual']) : $conf['physical2virtual']; $conf['physical2virtual'] = serialize($new_conf); conf_update_param('physical2virtual', $conf['physical2virtual']); } // new table pwg_query( 'CREATE TABLE IF NOT EXISTS `' . $this->table . '` ( `phy_category_id` smallint(5) unsigned NOT NULL, `virt_category_id` smallint(5) unsigned NOT NULL, `updated` DATETIME NOT NULL DEFAULT "1970-01-01 00:00:00", KEY `phy_category_id` (`phy_category_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;'); $this->installed = true; } function activate($plugin_version, &$errors=array()) { if (!$this->installed) { $this->install($plugin_version, $errors); } } function deactivate() { } function uninstall() { conf_delete_param('physical2virtual'); pwg_query('DROP TABLE `' . $this->table . '`;'); } } ?>