download_file("textlist_input.txt" , $_POST['title'].".php"); $install->download_file("_list_functions.txt" , "_list_functions.php"); $install->download_file("_list_template_table.tpl" , "_list_template_table.tpl"); $install->download_file("_translations.txt" , "_translations.php"); $install->download_file("onclick.js" , "onclick.js"); $install->download_file("popup.copy_data.txt" , "popup.copy_data.php"); $install->download_file("popup.move_data.txt" , "popup.move_data.php"); $install->download_file("wbg_make_search.txt" , "wbg_make_search.php"); $install->download_file("wbg_seo_sitemap.txt" , "wbg_seo_sitemap.php"); $install->download_file("wbg_set_crosslink.txt" , "wbg_set_crosslink.php"); $FILE = $_POST['title'].".php"; $install->replace_data_in_file("{SQL_TABLENAME}" , $_POST['sql_table'], $FILE); $install->replace_data_in_file("{DIRECTION}" , $_POST['new_items'], $FILE); $FILE = $_POST['title'].".php"; $install->replace_data_in_file("{SQL_TABLENAME}" , $_POST['sql_table'], $FILE); $install->replace_data_in_file("{FILENAME}" , $_POST['title'], "wbg_set_crosslink.php"); $query = " CREATE TABLE ".$_POST['sql_table']." ( id int(10) unsigned NOT NULL auto_increment, category_id int(10) unsigned NOT NULL default '0', sort_id int(10) unsigned default NULL, ins_title varchar(255) NOT NULL default '', doc_url varchar(255) NOT NULL default '', content text, lang tinyint(3) unsigned NOT NULL default '0', created int(10) unsigned default '0', `updated` datetime default NULL, owner varchar(50) default '0', active tinyint(1) unsigned NOT NULL default '0', PRIMARY KEY (id), UNIQUE KEY id (id), KEY id_2 (id), KEY category_id (category_id), KEY active (active), KEY lang (lang) )"; $install->add_table($_POST['sql_table'], $query); $template_file = array(); $template_file[] = 'smalltext("title","Title",60);'; } if ($_POST['txt_date']){ $template_file[] = '$this->datums("date","Date");'; } if ($_POST['txt_lead']){ $template_file[] = '$this->textarea("lead","Lead",70,3,90,10);'; $template_file[] = '$this->wysiwyg("lead",600,500);'; } if ($_POST['txt_lead_img']){ $template_file[] = '$this->image("lead_img","Image for lead","text/");'; } if ($_POST['txt_text']){ $template_file[] = '$this->textarea("text","Text",90,10, 90, 10);'; $template_file[] = '$this->wysiwyg("text",600,500);'; } if ($_POST['txt_text_img']){ $template_file[] = '$this->image("text_img","Image for text","text/");'; } if ($_POST['related_links']){ $template_file[] = '$this->start_repeat_block("Links", "Link name / Link code / Link type / How to open");'; $template_file[] = 'echo $this->smalltext("linkTitle",null,20);'; $template_file[] = 'echo $this->smalltext("LinkCode",null,20);'; $template_file[] = 'echo $this->crosslink_alone("LinkType");'; $template_file[] = 'echo $this->select("LinkTarget",null,array("1"=>"_blank","2"=>"_self"),null,"style=\'width:80px\'");'; $template_file[] = '$this->end_repeat_block();'; } if ($_POST['related_docs']){ $template_file[] = '$this->fileblock("docs","Related files","text/");'; } $install->create_new_file ('__template.php', implode("\n", $template_file)); ?>