From: <txm...@us...> - 2012-02-02 13:46:38
|
Revision: 8871 http://xoops.svn.sourceforge.net/xoops/?rev=8871&view=rev Author: txmodxoops Date: 2012-02-02 13:46:31 +0000 (Thu, 02 Feb 2012) Log Message: ----------- Beta 2 Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/building.php Removed Paths: ------------- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/const.php Added: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/building.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/building.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/building.php 2012-02-02 13:46:31 UTC (rev 8871) @@ -0,0 +1,222 @@ +<?php +/** + * **************************************************************************** + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * + * Cette licence, contient des limitations!!! + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @license TDM GPL license + * @author TDM TEAM DEV MODULE + * + * **************************************************************************** + */ + +include 'admin_header.php'; +xoops_cp_header(); + +$indexAdmin = new ModuleAdmin(); +echo $indexAdmin->addNavigation('const.php'); + +$op = TDMCreate_CleanVars($_REQUEST, 'op', 'default', 'string'); + +$modPath = XOOPS_ROOT_PATH.'/modules/TDMCreate'; + +switch ($op) { + case "creation": + $modules =& $modulesHandler->get($_REQUEST['modules_name']); + $modules_name = $modules->getVar('modules_name'); + $modules_desc = $modules->getVar('modules_description'); + $modules_author_website_name = $modules->getVar('modules_author_website_name'); + $modules_author_website_url = $modules->getVar('modules_author_website_url'); + $modules_image = $modules->getVar('modules_image'); + //Effacer repertoire du nouveau module s'il existe + clearDir($modPath.'/modules/'.$modules_name); + + //Nom des tables et combien de tables + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('tables_modules', $_REQUEST['modules_name'])); + $nb_tables = $tablesHandler->getCount($criteria); + $tables_arr = $tablesHandler->getall($criteria); + + //Debut + echo '<table width="100%" cellspacing="1" class="outer">'; + /************************************************/ + /*Structure*/ + /************************************************/ + //Creation de l'architecture + const_architecture($modules_name, $modules_image); + //Creation du changelog.txt + const_changelog($modules, $modules_name); + //Creation de admin index.php + const_admin_index($modules, $modules_name, $tables_arr); + //const_class_admin($modules, $modules_name); + + foreach (array_keys($tables_arr) as $i) + { + //Variables + $tables_id = $tables_arr[$i]->getVar('tables_id'); + $tables_name = $tables_arr[$i]->getVar('tables_name'); + $tables_module_table = $tables_arr[$i]->getVar('tables_module_table'); + $tables_img = $tables_arr[$i]->getVar('tables_img'); + $tables_champs = $tables_arr[$i]->getVar('tables_champs'); + $tables_parametres = $tables_arr[$i]->getVar('tables_parametres'); + $tables_blocks = $tables_arr[$i]->getVar('tables_blocks'); + $tables_display_admin = $tables_arr[$i]->getVar('tables_display_admin'); + $tables_display_user = $tables_arr[$i]->getVar('tables_display_user'); + $tables_search = $tables_arr[$i]->getVar('tables_search'); + $tables_coms = $tables_arr[$i]->getVar('tables_coms'); + + //Fabrication + //Copie of images tables + $tables_img1 = $modPath."/images/uploads/tables/".$tables_img; + if (file_exists($tables_img1)) { + copy($tables_img1, $modPath."/modules/".$modules_name."/images/deco/".$tables_img); + } + //Creation des classes + const_class($modules, $modules_name, $tables_module_table, $tables_name, $tables_champs, $tables_parametres); + + //Creation of pages admin + if ( $tables_display_admin == 1 ) { + const_admin_pages($modules, $modules_name, $tables_id, $tables_module_table, $tables_name, $tables_img, $tables_champs, $tables_parametres); + } + //Creation of pages and templates user + if ( $tables_display_user == 1 && $tables_module_table != null ) { + //const_user_pages($modules, $modules_name, $tables_id, $tables_module_table, $tables_name, $champs_param_display_user, $champs_param_type, $tables_img, $tables_champs, $tables_parametres); + } + //Creation de search + if ( $tables_search == 1 ) { + const_include_search($modules, $modules_name, $tables_name, $tables_module_table, $tables_champs, $tables_parametres, $tables_img); + } + //Creation des coms + if ( $tables_coms == 1 ) { + const_include_coms($modules, $modules_name, $tables_name, $tables_module_table, $tables_champs, $tables_parametres, $tables_img); + } + + //Creation of the file mysql.sql + const_sql($modules_name, $tables_module_table, $tables_name, $tables_champs); + + $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables")." WHERE tables_name = 'topic'"); + list( $topic ) = $xoopsDB->fetchRow($result); + //Creation des blocs + if ( $tables_blocks == 1 ) { + const_blocks($modules, $modules_name, $tables_module_table, $tables_name, $tables_champs, $tables_parametres, $topic); + //Creation du template des blocks + const_blocks_templates($modules, $modules_name, $tables_name, $tables_module_table, $tables_champs, $tables_parametres); + } + } + //Variables + $tables_id = $tablesHandler->getVar('tables_id'); + $tables_name = $tablesHandler->getVar('tables_name'); + $tables_module_table = $tablesHandler->getVar('tables_module_table'); + $tables_img = $tablesHandler->getVar('tables_img'); + $tables_champs = $tablesHandler->getVar('tables_champs'); + $tables_parametres = $tablesHandler->getVar('tables_parametres'); + $tables_blocks = $tablesHandler->getVar('tables_blocks'); + $tables_display_admin = $tablesHandler->getVar('tables_display_admin'); + $tables_display_user = $tablesHandler->getVar('tables_display_user'); + $tables_search = $tablesHandler->getVar('tables_search'); + $tables_coms = $tablesHandler->getVar('tables_coms'); + //Creation de xoopsversion.php + /*Mettre xoops version vers la fin pour integrer les bloc, etc*/ + const_xoopsversion($modules, $modules_name, $tables_blocks, $tables_arr, $tables_module_table, $tables_parametres); + // Creation of template index + const_templates_index($modules, $modules_name, $tables_name, $tables_module_table, $tables_champs, $tables_parametres); + // Creation of template header + const_templates_header($modules, $modules_name); + // Creation of template footer + const_templates_footer($modules, $modules_name, $tables_module_table); + // Creation of template admin about + const_templates_admin_about($modules, $modules_name); + // Creation of template admin help + const_templates_admin_help($modules, $modules_name); + //Creation du fichier permissions + $topic = 0; + if ( $topic == 1 || $tables_module_table != null) { // + const_admin_permissions($modules, $modules_name, $tables_arr, $topic); + } + + //Include + //Configs + const_include_configs($modules, $modules_name, $modules_author_website_name, $modules_author_website_url); + //Style + //const_css_admin($modules, $modules_name); + //const_include_style($modules, $modules_name); + //Functions + const_include_functions($modules, $modules_name); + //Creation du fichier install pour l'uploads + const_include_install($modules, $modules_name, $tables_arr); + //Language + /////////////////////////////////////////////////////////////////////// + //Creation du language main.php + const_main_language($modules, $modules_name, $modules_desc); + //Creation du language modinfo.php + const_modinfo_language($modules, $modules_name, $modules_desc); + //Creation du language admin.php + const_admin_language($modules, $modules_name, $modules_desc); + //Creation du language blocks.php + const_blocks_language($modules, $modules_name); + //Creation du language help.php + const_help_language($modules, $modules_name); + /////////////////////////////////////////////////////////////////////// + //Creation de la class menu + //const_class_menu($modules, $modules_name); + + /************************************************/ + /*Admin*/ + /************************************************/ + //Creation de admin header.php + const_admin_header($modules, $modules_name, $tables_arr); + //Creation de admin footer.php + const_admin_footer($modules, $modules_name, $tables_arr); + //Creation de admin menu.php + const_admin_menu($modules, $modules_name, $tables_arr, $topic); + //Creation de admin about.php + //$menu++; + const_admin_about($modules, $modules_name); + /************************************************/ + /*Admin*/ + /************************************************/ + if ( $tables_display_user == 1 && $tables_module_table != null ) { + const_user_header($modules, $modules_name, $tables_id, $tables_module_table, $tables_name); + const_user_index($modules, $modules_name, $tables_id, $tables_module_table, $tables_name, $tables_champs, $tables_parametres); + } + echo '</table>'; + + break; + + case "default": + default: + + include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php"); + $action = $_SERVER['REQUEST_URI']; + + $form = new XoopsThemeForm(_AM_TDMCREATE_ADMIN_CONST, 'form_creation', $action, 'post', true); + + $modules_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_MODULES, 'modules_name', 'modules_name'); + $modules_select->addOptionArray($modulesHandler->getList()); + $form->addElement($modules_select, true); + + /*foreach (array_keys($tables_arr) as $i) + { + //Variables + $tables_name = $tables_arr[$i]->getVar('tables_name'); + }*/ + $tables_name = $tablesHandler->getVar('tables_name'); + $tables_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_TABLES, 'tables_name', $tables_name, 4); + $tables_select->addOptionArray($tablesHandler->getList()); + $form->addElement($tables_select, false); + + $form->addElement(new XoopsFormHidden('op', 'creation')); + $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $form->display(); + break; +} +include "admin_footer.php"; \ No newline at end of file Deleted: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/const.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/const.php 2012-02-02 13:45:24 UTC (rev 8870) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/const.php 2012-02-02 13:46:31 UTC (rev 8871) @@ -1,222 +0,0 @@ -<?php -/** - * **************************************************************************** - * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS - * - Licence GPL Copyright (c) (http://www.tdmxoops.net) - * - * Cette licence, contient des limitations!!! - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @license TDM GPL license - * @author TDM TEAM DEV MODULE - * - * **************************************************************************** - */ - -include 'admin_header.php'; -xoops_cp_header(); - -$indexAdmin = new ModuleAdmin(); -echo $indexAdmin->addNavigation('const.php'); - -$op = TDMCreate_CleanVars($_REQUEST, 'op', 'default', 'string'); - -$modPath = XOOPS_ROOT_PATH.'/modules/TDMCreate'; - -switch ($op) { - case "creation": - $modules =& $modulesHandler->get($_REQUEST['modules_name']); - $modules_name = $modules->getVar('modules_name'); - $modules_desc = $modules->getVar('modules_description'); - $modules_author_website_name = $modules->getVar('modules_author_website_name'); - $modules_author_website_url = $modules->getVar('modules_author_website_url'); - $modules_image = $modules->getVar('modules_image'); - //Effacer repertoire du nouveau module s'il existe - clearDir($modPath.'/modules/'.$modules_name); - - //Nom des tables et combien de tables - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('tables_modules', $_REQUEST['modules_name'])); - $nb_tables = $tablesHandler->getCount($criteria); - $tables_arr = $tablesHandler->getall($criteria); - - //Debut - echo '<table width="100%" cellspacing="1" class="outer">'; - /************************************************/ - /*Structure*/ - /************************************************/ - //Creation de l'architecture - const_architecture($modules_name, $modules_image); - //Creation du changelog.txt - const_changelog($modules, $modules_name); - //Creation de admin index.php - const_admin_index($modules, $modules_name, $tables_arr); - //const_class_admin($modules, $modules_name); - - foreach (array_keys($tables_arr) as $i) - { - //Variables - $tables_id = $tables_arr[$i]->getVar('tables_id'); - $tables_name = $tables_arr[$i]->getVar('tables_name'); - $tables_module_table = $tables_arr[$i]->getVar('tables_module_table'); - $tables_img = $tables_arr[$i]->getVar('tables_img'); - $tables_champs = $tables_arr[$i]->getVar('tables_champs'); - $tables_parametres = $tables_arr[$i]->getVar('tables_parametres'); - $tables_blocks = $tables_arr[$i]->getVar('tables_blocks'); - $tables_display_admin = $tables_arr[$i]->getVar('tables_display_admin'); - $tables_display_user = $tables_arr[$i]->getVar('tables_display_user'); - $tables_search = $tables_arr[$i]->getVar('tables_search'); - $tables_coms = $tables_arr[$i]->getVar('tables_coms'); - - //Fabrication - //Copie of images tables - $tables_img1 = $modPath."/images/uploads/tables/".$tables_img; - if (file_exists($tables_img1)) { - copy($tables_img1, $modPath."/modules/".$modules_name."/images/deco/".$tables_img); - } - //Creation des classes - const_class($modules, $modules_name, $tables_module_table, $tables_name, $tables_champs, $tables_parametres); - - //Creation of pages admin - if ( $tables_display_admin == 1 ) { - const_admin_pages($modules, $modules_name, $tables_id, $tables_module_table, $tables_name, $tables_img, $tables_champs, $tables_parametres); - } - //Creation of pages and templates user - if ( $tables_display_user == 1 && $tables_module_table != null ) { - //const_user_pages($modules, $modules_name, $tables_id, $tables_module_table, $tables_name, $champs_param_display_user, $champs_param_type, $tables_img, $tables_champs, $tables_parametres); - } - //Creation de search - if ( $tables_search == 1 ) { - const_include_search($modules, $modules_name, $tables_name, $tables_module_table, $tables_champs, $tables_parametres, $tables_img); - } - //Creation des coms - if ( $tables_coms == 1 ) { - const_include_coms($modules, $modules_name, $tables_name, $tables_module_table, $tables_champs, $tables_parametres, $tables_img); - } - - //Creation of the file mysql.sql - const_sql($modules_name, $tables_module_table, $tables_name, $tables_champs); - - $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables")." WHERE tables_name = 'topic'"); - list( $topic ) = $xoopsDB->fetchRow($result); - //Creation des blocs - if ( $tables_blocks == 1 ) { - const_blocks($modules, $modules_name, $tables_module_table, $tables_name, $tables_champs, $tables_parametres, $topic); - //Creation du template des blocks - const_blocks_templates($modules, $modules_name, $tables_name, $tables_module_table, $tables_champs, $tables_parametres); - } - } - //Variables - $tables_id = $tablesHandler->getVar('tables_id'); - $tables_name = $tablesHandler->getVar('tables_name'); - $tables_module_table = $tablesHandler->getVar('tables_module_table'); - $tables_img = $tablesHandler->getVar('tables_img'); - $tables_champs = $tablesHandler->getVar('tables_champs'); - $tables_parametres = $tablesHandler->getVar('tables_parametres'); - $tables_blocks = $tablesHandler->getVar('tables_blocks'); - $tables_display_admin = $tablesHandler->getVar('tables_display_admin'); - $tables_display_user = $tablesHandler->getVar('tables_display_user'); - $tables_search = $tablesHandler->getVar('tables_search'); - $tables_coms = $tablesHandler->getVar('tables_coms'); - //Creation de xoopsversion.php - /*Mettre xoops version vers la fin pour integrer les bloc, etc*/ - const_xoopsversion($modules, $modules_name, $tables_blocks, $tables_arr, $tables_module_table, $tables_parametres); - // Creation of template index - const_templates_index($modules, $modules_name, $tables_name, $tables_module_table, $tables_champs, $tables_parametres); - // Creation of template header - const_templates_header($modules, $modules_name); - // Creation of template footer - const_templates_footer($modules, $modules_name, $tables_module_table); - // Creation of template admin about - const_templates_admin_about($modules, $modules_name); - // Creation of template admin help - const_templates_admin_help($modules, $modules_name); - //Creation du fichier permissions - $topic = 0; - if ( $topic == 1 || $tables_module_table != null) { // - const_admin_permissions($modules, $modules_name, $tables_arr, $topic); - } - - //Include - //Configs - const_include_configs($modules, $modules_name, $modules_author_website_name, $modules_author_website_url); - //Style - //const_css_admin($modules, $modules_name); - //const_include_style($modules, $modules_name); - //Functions - const_include_functions($modules, $modules_name); - //Creation du fichier install pour l'uploads - const_include_install($modules, $modules_name, $tables_arr); - //Language - /////////////////////////////////////////////////////////////////////// - //Creation du language main.php - const_main_language($modules, $modules_name, $modules_desc); - //Creation du language modinfo.php - const_modinfo_language($modules, $modules_name, $modules_desc); - //Creation du language admin.php - const_admin_language($modules, $modules_name, $modules_desc); - //Creation du language blocks.php - const_blocks_language($modules, $modules_name); - //Creation du language help.php - const_help_language($modules, $modules_name); - /////////////////////////////////////////////////////////////////////// - //Creation de la class menu - //const_class_menu($modules, $modules_name); - - /************************************************/ - /*Admin*/ - /************************************************/ - //Creation de admin header.php - const_admin_header($modules, $modules_name, $tables_arr); - //Creation de admin footer.php - const_admin_footer($modules, $modules_name, $tables_arr); - //Creation de admin menu.php - const_admin_menu($modules, $modules_name, $tables_arr, $topic); - //Creation de admin about.php - //$menu++; - const_admin_about($modules, $modules_name); - /************************************************/ - /*Admin*/ - /************************************************/ - if ( $tables_display_user == 1 && $tables_module_table != null ) { - const_user_header($modules, $modules_name, $tables_id, $tables_module_table, $tables_name); - const_user_index($modules, $modules_name, $tables_id, $tables_module_table, $tables_name, $tables_champs, $tables_parametres); - } - echo '</table>'; - - break; - - case "default": - default: - - include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php"); - $action = $_SERVER['REQUEST_URI']; - - $form = new XoopsThemeForm(_AM_TDMCREATE_ADMIN_CONST, 'form_creation', $action, 'post', true); - - $modules_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_MODULES, 'modules_name', 'modules_name'); - $modules_select->addOptionArray($modulesHandler->getList()); - $form->addElement($modules_select, true); - - /*foreach (array_keys($tables_arr) as $i) - { - //Variables - $tables_name = $tables_arr[$i]->getVar('tables_name'); - }*/ - $tables_name = $tablesHandler->getVar('tables_name'); - $tables_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_TABLES, 'tables_name', $tables_name, 4); - $tables_select->addOptionArray($tablesHandler->getList()); - $form->addElement($tables_select, false); - - $form->addElement(new XoopsFormHidden('op', 'creation')); - $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); - $form->display(); - break; -} -include "admin_footer.php"; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |