Модуль Формы v1.26.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.4 KiB

<?php
if (! defined('BASE_DIR'))
exit;
/**
* Модуль "Формы"
*
*/
$module_sql_install = array();
$module_sql_deinstall = array();
$module_sql_update = array();
// Удаление
$module_sql_deinstall[] = "DROP TABLE IF EXISTS %%PRFX%%_module_forms_forms;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS %%PRFX%%_module_forms_fields;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS %%PRFX%%_module_forms_history;";
// Установка
$module_sql_install[] = "
CREATE TABLE IF NOT EXISTS `%%PRFX%%_module_forms_forms` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`alias` varchar(20) NOT NULL,
`title` varchar(255) NOT NULL,
`protection` enum('0','1') NOT NULL DEFAULT '1',
`rubheader` text NOT NULL,
`form_tpl` text NOT NULL,
`mail_set` text NOT NULL,
`mail_tpl` text NOT NULL,
`finish_tpl` text NOT NULL,
`code_onsubmit` text NOT NULL,
`code_onvalidate` text NOT NULL,
`code_beforesend` text NOT NULL,
`code_onsend` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 AUTO_INCREMENT=1;
";
$module_sql_install[] = "
CREATE TABLE IF NOT EXISTS `%%PRFX%%_module_forms_fields` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`form_id` int(10) NOT NULL,
`active` enum('0','1') NOT NULL DEFAULT '1',
`title` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`main` enum('0','1') NOT NULL DEFAULT '0',
`setting` text NOT NULL,
`required` enum('0','1') NOT NULL DEFAULT '0',
`defaultval` varchar(255) NOT NULL,
`attributes` text NOT NULL,
`tpl` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 AUTO_INCREMENT=1;
";
$module_sql_install[] = "
CREATE TABLE IF NOT EXISTS `%%PRFX%%_module_forms_history` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`form_id` int(10) NOT NULL,
`email` varchar(255) NOT NULL,
`subject` varchar(255) NOT NULL,
`status` enum('new','viewed','replied') NOT NULL DEFAULT 'new',
`date` int(10) NOT NULL,
`dialog` longtext NOT NULL,
`postdata` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 AUTO_INCREMENT=1;
";
// Обновление
$module_sql_update[] = "
UPDATE `%%PRFX%%_module`
SET
ModuleAveTag = '" . $module['ModuleAveTag'] . "',
ModulePHPTag = '" . $module['ModulePHPTag'] . "',
ModuleVersion = '" . $module['ModuleVersion'] . "'
WHERE
ModuleSysName = '" . $module['ModuleSysName'] . "'
LIMIT 1;
";
?>