download_file("wbg_products_templates.txt", $_POST['title'].".php"); $install->download_file("__template.txt", "__template.php"); $install->download_file("_translations.txt", "_translations.php"); $install->download_file("_functions.txt", "_functions.php"); $install->download_file("popup.select_template.txt", "popup.select_template.php"); $install->download_file("_extension_save.txt", "_extension_save.php"); $install->download_file("_extension_template.txt", "_extension_template.php"); $install->replace_data_in_file("{SQL_TABLENAME}", $_POST['sql_table'], $_POST['title'].".php"); // >>> Kopirujem faili //====================================================================================== // <<< Sozdajem tablicu $query = " CREATE TABLE `".$_POST['sql_table']."` ( `id` int(11) NOT NULL auto_increment, `category_id` int(11) default NULL, `title` varchar(255) default NULL, `info` varchar(255) default NULL, `content` text, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='Administracija shablonov produktov' "; $install->add_table(''.$_POST['sql_table'], $query); // >>> Sozdajem tablicu //====================================================================================== // <<< Sozdajem bazovuju kategoriju dlja kataloga produktov $data = array(); $data['parent_id'] = 0; $data['level'] = 0; $data['sort_id'] = mysql_result(mysql_query("select max(sort_id) from wbg_tree_categories where level=0"),0,0)+1; $data['title'] = "Products templates"; $data['language'] = 0; $data['type'] = 1; $data['active'] = 1; $data['enabled'] = 1; $data['input_module'] = $install->new_module_id; $data['property_template'] = 0; $category_id = $install->add_category($data); // >>> Sozdajem bazovuju kategoriju dlja kataloga produktov //====================================================================================== $install->replace_data_in_file("{ROOT_CAT_ID}", $category_id, "popup.select_template.php"); $install->replace_data_in_file("{SQL_TABLENAME}", $_POST['sql_table'], "popup.select_template.php"); $install->replace_data_in_file("{SQL_TABLENAME}", $_POST['sql_table'], "_extension_save.php"); $install->replace_data_in_file("{SQL_TABLENAME}", $_POST['sql_table'], "_extension_template.php"); ?>