Там так написано:
Код:
function install()
{
if (!parent::install() OR !$this->registerHook('header') OR !$this->registerHook('csmegamenu'))
return false;
if (!Db::getInstance()->Execute('CREATE TABLE '._DB_PREFIX_.'csmegamenu (`id_menu` int(10) unsigned NOT NULL AUTO_INCREMENT,`number_column` int(10) unsigned default \'1\', `width` int(10) unsigned default \'120\', `link_of_title` varchar(300),`icon` varchar(255) default \'\', `display` tinyint(1) NOT NULL default \'1\',`display_icon` tinyint(1) NOT NULL default \'1\',`position` int(10) unsigned default \'0\',PRIMARY KEY (`id_menu`)) ENGINE=InnoDB default CHARSET=utf8'))
return false;
if (!Db::getInstance()->Execute('CREATE TABLE '._DB_PREFIX_.'csmegamenu_shop (`id_menu` int(10) unsigned NOT NULL ,`id_shop` int(10) unsigned NOT NULL,`number_column` int(10) unsigned default \'1\', `width` int(10) unsigned default \'120\', `link_of_title` varchar(300), `display` tinyint(1) NOT NULL default \'1\',`position` int(10) unsigned default \'0\',PRIMARY KEY (`id_menu`,`id_shop`)) ENGINE=InnoDB default CHARSET=utf8'))
return false;
if (!Db::getInstance()->Execute('CREATE TABLE '._DB_PREFIX_.'csmegamenu_option (`id_option` int(10) unsigned NOT NULL AUTO_INCREMENT,`id_menu` int(10) unsigned NOT NULL,`type_option` int(10) unsigned NOT NULL, `position_option` int(10) unsigned default \'0\', `content_option` text ,PRIMARY KEY (`id_option`)) ENGINE=InnoDB default CHARSET=utf8'))
return false;
if (!Db::getInstance()->Execute('CREATE TABLE '._DB_PREFIX_.'csmegamenu_option_shop (`id_option` int(10) unsigned NOT NULL,`id_menu` int(10) unsigned NOT NULL,`id_shop` int(10) unsigned NOT NULL,`type_option` int(10) unsigned NOT NULL, `position_option` int(10) unsigned default \'0\', `content_option` text ,PRIMARY KEY (`id_option`,`id_shop`)) ENGINE=InnoDB default CHARSET=utf8'))
return false;
if (!Db::getInstance()->Execute('CREATE TABLE '._DB_PREFIX_.'csmegamenu_lang (`id_menu` int(10) unsigned NOT NULL, `id_lang` int(10) unsigned NOT NULL,`id_shop` int(10) unsigned NOT NULL, `title` varchar(255) NOT NULL default \'\', `description` varchar(255) default \'\', PRIMARY KEY (`id_menu`,`id_lang`,`id_shop`)) ENGINE=InnoDB default CHARSET=utf8'))
return false;
$this->init_data();
return true;
}
public function uninstall()
{
if (parent::uninstall() == false)
return false;
if (!Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'csmegamenu') OR !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'csmegamenu_shop') OR !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'csmegamenu_option') OR !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'csmegamenu_option_shop') OR !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'csmegamenu_lang'))
return false;
return true;
}