From: <be...@us...> - 2012-09-24 21:19:39
|
Revision: 10188 http://xoops.svn.sourceforge.net/xoops/?rev=10188&view=rev Author: beckmi Date: 2012-09-24 21:19:29 +0000 (Mon, 24 Sep 2012) Log Message: ----------- Adding version 1.38.1 Beta 1 Added Paths: ----------- XoopsModules/TDMCreate/branches/mamba/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/about.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/admin_footer.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/admin_header.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/building.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/includes.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/index.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/menu.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/modules.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/tables.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/class/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/class/constArch.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/class/constArchitecture.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/class/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/class/logoGenerator.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/class/tdmcreate_modules.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/class/tdmcreate_tables.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_about_language.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_admin_about.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_admin_footer.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_admin_header.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_admin_help.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_admin_index.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_admin_language.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_admin_menu.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_admin_pages.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_admin_permissions.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_architecture.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_blocks.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_blocks_language.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_blocks_templates.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_changelog.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_class.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_class_admin.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_class_menu.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_css_admin.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_css_style.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_entete.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_header.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_help_language.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_include_comments.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_include_comments_functions.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_include_configs.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_include_functions.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_include_install.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_include_jquery.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_include_notification.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_include_search.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_js_jquery.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_languages.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_main_header.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_main_index.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_main_language.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_modinfo_language.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_sql.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_templates.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_templates_admin_about.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_templates_admin_help.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_templates_footer.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_templates_header.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_templates_index.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_templates_pages.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_user_comments.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_user_header.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_user_index.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_user_pages.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_waiting.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/const/const_xoopsversion.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/css/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/css/admin.css XoopsModules/TDMCreate/branches/mamba/TDMCreate/css/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/docs/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/docs/changelog.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/docs/credits.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/docs/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/docs/install.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/docs/lang_diff.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/docs/license.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/docs/readme.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/32/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/32/addmodule.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/32/addtable.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/32/builder.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/32/dashboard.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/32/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/icons/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/icons/arrow.gif XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/icons/blank.gif XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/icons/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/icons/loading.gif XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/icons/off.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/icons/on.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/loading.gif XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/logos/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/logos/VeraBd.ttf XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/logos/green.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/logos/red.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/logos/xoops2.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/menu/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/menu/bg.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/menu/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/menu/left_both.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/menu/right_both.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/module_logo.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/tdmcreate_slogo.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/Test1Logo.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/empty.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/module_logo.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/test3_logo.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/test4_logo.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/test5_logo.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/test6_logo.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/test7_logo.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/modules/xcvLogo.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/tables/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/tables/blank.gif XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/uploads/tables/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/images/xoops2.png XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/comment_delete.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/comment_edit.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/comment_new.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/comment_post.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/comment_reply.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/functions.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/functions_const.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/install.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/jq.init.js XoopsModules/TDMCreate/branches/mamba/TDMCreate/include/update.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/js/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/js/functions.js XoopsModules/TDMCreate/branches/mamba/TDMCreate/js/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/english/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/english/admin.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/english/help/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/english/help/help.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/english/help/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/english/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/english/modinfo.php XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/update language 1.0 to 1.1.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/update language 1.1 to 1.15.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/update language 1.1 to 1.37.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/update language 1.15 to 1.37.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/language/update language 1.37 to 1.38.txt XoopsModules/TDMCreate/branches/mamba/TDMCreate/modules/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/modules/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/sql/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/sql/index.html XoopsModules/TDMCreate/branches/mamba/TDMCreate/sql/mysql.sql XoopsModules/TDMCreate/branches/mamba/TDMCreate/templates/ XoopsModules/TDMCreate/branches/mamba/TDMCreate/xoops_version.php Added: XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/about.php =================================================================== --- XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/about.php (rev 0) +++ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/about.php 2012-09-24 21:19:29 UTC (rev 10188) @@ -0,0 +1,22 @@ +<?php +/** + * TDMCreate module + * + * 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. + * + * @copyright The XOOPS Project (http://www.xoops.org) + * @license GNU GPL (http://www.gnu.org/licenses/gpl-2.0.html/) + * @package TDMCreate + * @since 2.5.0 + * @author Mage, Mamba + * @version $Id $ + **/ +include 'admin_header.php'; +echo $adminMenu->addNavigation('about.php'); +echo $adminMenu->renderabout('6KJ7RW5DR3VTJ', false); +include 'admin_footer.php'; \ No newline at end of file Added: XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/admin_footer.php =================================================================== --- XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/admin_footer.php (rev 0) +++ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/admin_footer.php 2012-09-24 21:19:29 UTC (rev 10188) @@ -0,0 +1,22 @@ +<?php +/** + * XoopsPoll module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package XoopsPoll + * @since 2.5.0 + * @author Mamba (www.xoops.org) + * @version $Id $ +**/ + +echo "<div align=\"center\"><a href=\"http://www.xoops.org\" target=\"_blank\"><img src=" . $pathIcon32.'/xoopsmicrobutton.gif'.' '." alt='XOOPS' title='XOOPS'></a></div>"; +echo "<div class='center smallsmall italic pad5'><strong>" . $xoopsModule->getVar("name") . "</strong> is maintained by the <a class='tooltip' rel='external' href='http://www.xoops.org/' title='Visit XOOPS Community'>XOOPS Community</a></div>"; +xoops_cp_footer(); \ No newline at end of file Added: XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/admin_header.php =================================================================== --- XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/admin_header.php (rev 0) +++ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/admin_header.php 2012-09-24 21:19:29 UTC (rev 10188) @@ -0,0 +1,54 @@ +<?php +/** + * Marquee module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package Marquee + * @since 2.5.0 + * @author XOOPS Module Team + * @version $Id $ +**/ +include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; +include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; +include_once("../include/functions.php"); +include_once 'includes.php'; +// +$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname'); +// + +$pathIcon16 = '../' . $xoopsModule->getInfo('icons16'); +$pathIcon32 = '../' . $xoopsModule->getInfo('icons32'); +$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); + +//load class +$modulesHandler =& xoops_getModuleHandler('tdmcreate_modules', 'TDMCreate'); +$tablesHandler =& xoops_getModuleHandler('tdmcreate_tables', 'TDMCreate'); +// +$myts =& MyTextSanitizer::getInstance(); +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); +} +// +$xoopsTpl->assign('pathIcon16', $pathIcon16); +$xoopsTpl->assign('pathIcon32', $pathIcon32); +//Load languages +xoops_loadLanguage('admin', $thisDirname); +xoops_loadLanguage('modinfo', $thisDirname); +xoops_loadLanguage('main', $thisDirname); +// Locad admin menu class +if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){ + include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); +}else{ + redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false); +} +xoops_cp_header(); +$adminMenu = new ModuleAdmin(); \ No newline at end of file Added: XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/building.php =================================================================== --- XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/building.php (rev 0) +++ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/building.php 2012-09-24 21:19:29 UTC (rev 10188) @@ -0,0 +1,224 @@ +<?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'; +echo $adminMenu->addNavigation('const.php'); +$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' ); + +if (isset($_REQUEST['modules_name'])) { + $modules =& $modulesHandler->get($_REQUEST['modules_name']); +} else { + $modules = & $modulesHandler; +} + +$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'); +$modules_active_search = $modules->getVar('modules_active_search'); +$modules_active_comments = $modules->getVar('modules_active_comments'); + +//Nom des tables et combien de tables +$criteria = new CriteriaCompo(); +if (isset($_REQUEST['modules_name'])) { + $criteria->add(new Criteria('tables_modules', $_REQUEST['modules_name'])); +} else { + $criteria->add(new Criteria('tables_modules')); +} + +$nb_tables = $tablesHandler->getCount($criteria); +$tables_arr = $tablesHandler->getall($criteria); + +switch ($op) { + case "creation": + + //Effacer repertoire du nouveau module s'il existe + clearDir($modPath.'/modules/'.$modules_name); + + //Debut + OpenTable(); + /************************************************/ + /*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_category = $tables_arr[$i]->getVar('tables_category'); + $tables_module_table = $tables_arr[$i]->getVar('tables_module_table'); + $tables_img = $tables_arr[$i]->getVar('tables_img'); + $tables_fields = $tables_arr[$i]->getVar('tables_fields'); + $tables_parameters = $tables_arr[$i]->getVar('tables_parameters'); + $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_comments = $tables_arr[$i]->getVar('tables_comments'); + $tables_waiting = $tables_arr[$i]->getVar('tables_waiting'); + + //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/icons/".$tables_img); + } + //Creation des classes + const_class($modules, $modules_name, $tables_module_table, $tables_name, $tables_fields, $tables_parameters); + + if ( $tables_category == 1) { //|| $tables_module_table != null + const_admin_permissions($modules, $modules_name, $tables_name, $category); + } + + //Creation of pages admin + if ( $tables_display_admin == 1 ) { + const_admin_pages($modules, $modules_name, $tables_id, $tables_module_table, $tables_category, $tables_name, $tables_img, $tables_fields, $tables_parameters); + } + //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, $tables_img, $tables_fields, $tables_parameters); + const_templates_pages($modules, $modules_name, $tables_name, $tables_module_table, $tables_fields, $tables_parameters); + } + //Creation de search + if ( $modules_active_search == 1 && $tables_search == 1 ) { + const_include_search($modules, $modules_name, $tables_name, $tables_module_table, $tables_fields, $tables_parameters, $tables_img); + } + //Creation of comments + if ( $modules_active_comments == 1 && $tables_comments == 1 ) { + const_include_comments($modules, $modules_name, $tables_name, $tables_module_table, $tables_fields, $tables_parameters, $tables_img); + } + + //Creation of the file mysql.sql + const_sql($modules_name, $tables_module_table, $tables_name, $tables_fields); + + $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables")." WHERE tables_name = 'category'"); + list( $category ) = $xoopsDB->fetchRow($result); + //Creation des blocks + if ( $tables_blocks == 1 ) { + const_blocks($modules, $modules_name, $tables_module_table, $tables_name, $tables_fields, $tables_parameters, $category); + //Creation du template des blocks + const_blocks_templates($modules, $modules_name, $tables_name, $tables_module_table, $tables_fields, $tables_parameters); + } + } + + //Creation of Waiting Plugin + const_waiting($modules, $modules_name, $tables_arr); + + + //Creation de xoopsversion.php + /*Mettre xoops version vers la fin pour integrer les bloc, etc*/ + const_xoopsversion($modules, $modules_name, $tables_arr, $tables_module_table); + // Creation of template index + const_templates_index($modules, $modules_name, $tables_name, $tables_module_table, $tables_fields, $tables_parameters); + // 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 + + + //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, $tables_arr); + //Creation du language modinfo.php + const_modinfo_language($modules, $modules_name, $modules_desc, $tables_arr, $category); + //Creation du language admin.php + const_admin_language($modules, $modules_name, $tables_arr, $tables_name); + //Creation du language blocks.php + const_blocks_language($modules, $modules_name, $tables_arr); + //Creation du language help/help.html + const_help_language($modules, $modules_name, $modules_desc); + /////////////////////////////////////////////////////////////////////// + //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, $category); + //Creation de admin about.php + //$menu++; + const_admin_about($modules, $modules_name); + /************************************************/ + /*Admin*/ + /************************************************/ + 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_fields, $tables_parameters); + CloseTable(); + + 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_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 Added: XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/includes.php =================================================================== --- XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/includes.php (rev 0) +++ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/includes.php 2012-09-24 21:19:29 UTC (rev 10188) @@ -0,0 +1,67 @@ +<?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 '../../../include/cp_header.php'; +include_once("../include/functions.php"); + +$modPath = XOOPS_ROOT_PATH.'/modules/TDMCreate'; +$cPath = $modPath.'/const'; + +include_once $cPath.'/const_architecture.php'; +include_once $cPath.'/const_xoopsversion.php'; +include_once $cPath.'/const_changelog.php'; +include_once $cPath.'/const_include_search.php'; +include_once $cPath.'/const_include_comments.php'; +include_once $cPath.'/const_include_configs.php'; +include_once $cPath.'/const_include_functions.php'; +include_once $cPath.'/const_include_install.php'; +include_once $cPath.'/const_waiting.php'; +//include_once $cPath.'/const_include_style.php'; +include_once $cPath.'/const_sql.php'; +include_once $cPath.'/const_blocks.php'; +include_once $cPath.'/const_blocks_templates.php'; +include_once $cPath.'/const_class.php'; +include_once $cPath.'/const_class_admin.php'; +//include_once $cPath.'/const_class_menu.php'; + +include_once $cPath.'/const_admin_header.php'; +include_once $cPath.'/const_admin_footer.php'; +include_once $cPath.'/const_admin_menu.php'; +include_once $cPath.'/const_admin_index.php'; +include_once $cPath.'/const_admin_pages.php'; +include_once $cPath.'/const_admin_about.php'; +include_once $cPath.'/const_admin_permissions.php'; +include_once $cPath.'/const_admin_language.php'; +include_once $cPath.'/const_modinfo_language.php'; +include_once $cPath.'/const_about_language.php'; +include_once $cPath.'/const_help_language.php'; +include_once $cPath.'/const_blocks_language.php'; +include_once $cPath.'/const_main_language.php'; +include_once $cPath.'/const_user_header.php'; +include_once $cPath.'/const_user_index.php'; +include_once $cPath.'/const_user_pages.php'; +include_once $cPath.'/const_templates_header.php'; +include_once $cPath.'/const_templates_index.php'; +include_once $cPath.'/const_templates_pages.php'; +include_once $cPath.'/const_templates_footer.php'; +include_once $cPath.'/const_templates_admin_about.php'; +include_once $cPath.'/const_templates_admin_help.php'; + +?> \ No newline at end of file Added: XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/index.html =================================================================== --- XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/index.html (rev 0) +++ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/index.html 2012-09-24 21:19:29 UTC (rev 10188) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/index.php =================================================================== --- XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/index.php (rev 0) +++ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/index.php 2012-09-24 21:19:29 UTC (rev 10188) @@ -0,0 +1,33 @@ +<?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'; + $criteria = new CriteriaCompo(); + $count_modules = $modulesHandler->getCount($criteria); + $count_tables = $tablesHandler->getCount($criteria); + +$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ; +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, "<label>" ._AM_TDMCREATE_THEREARE_NUMMODULES. "</label>", $count_modules, 'Green') ; +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, "<label>" ._AM_TDMCREATE_THEREARE_NUMTABLES. "</label>", $count_tables, 'Orange'); + + echo $adminMenu->addNavigation('index.php'); + echo $adminMenu->renderIndex(); + +include "admin_footer.php"; \ No newline at end of file Added: XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/menu.php =================================================================== --- XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/menu.php (rev 0) +++ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/menu.php 2012-09-24 21:19:29 UTC (rev 10188) @@ -0,0 +1,46 @@ +<?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 + * + * **************************************************************************** + */ +$module_handler =& xoops_gethandler('module'); +$xoopsModule =& XoopsModule::getByDirname('TDMCreate'); +$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid')); +$pathIcon32 = $moduleInfo->getInfo('icons32'); +$adminmenu = array(); +$i = 1; +$adminmenu[$i]["title"] = _MI_TDMCREATE_ADMIN_INDEX; +$adminmenu[$i]["link"] = 'admin/index.php'; +$adminmenu[$i]["icon"] = $pathIcon32.'/home.png'; +$i++; +$adminmenu[$i]["title"] = _MI_TDMCREATE_ADMIN_MODULES; +$adminmenu[$i]["link"] = 'admin/modules.php'; +$adminmenu[$i]["icon"] = 'images/32/addmodule.png'; +$i++; +$adminmenu[$i]["title"] = _MI_TDMCREATE_ADMIN_TABLES; +$adminmenu[$i]["link"] = 'admin/tables.php'; +$adminmenu[$i]["icon"] = 'images/32/addtable.png'; +$i++; +$adminmenu[$i]["title"] = _MI_TDMCREATE_ADMIN_CONST; +$adminmenu[$i]["link"] = 'admin/building.php'; +$adminmenu[$i]["icon"] = 'images/32/builder.png'; +$i++; +$adminmenu[$i]["title"] = _MI_TDMCREATE_ADMIN_ABOUT; +$adminmenu[$i]["link"] = 'admin/about.php'; +$adminmenu[$i]["icon"] = $pathIcon32.'/about.png'; +unset($i); \ No newline at end of file Added: XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/modules.php (rev 0) +++ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/modules.php 2012-09-24 21:19:29 UTC (rev 10188) @@ -0,0 +1,167 @@ +<?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_once 'admin_header.php'; +$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' ); +switch ($op) { + case "modules_save": + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + + if (isset($_REQUEST['modules_id'])) { + $obj =& $modulesHandler->get($_REQUEST['modules_id']); + } else { + $obj =& $modulesHandler->create(); + } + //Image + include_once XOOPS_ROOT_PATH.'/class/uploader.php'; + $uploaddir = XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/images/uploads/modules/"; + $uploader = new XoopsMediaUploader($uploaddir, "gif|jpeg|pjpeg|png", 104857600, null, null); + + if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { + $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["attachedfile"]['name']) ; + $name_img = $_REQUEST['modules_name'].'_slogo.'.$extension; + $uploader->setTargetFileName($name_img); + $uploader->fetchMedia($_POST['xoops_upload_file'][0]); + if (!$uploader->upload()) { + $errors = $uploader->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar('modules_image', $uploader->getSavedFileName()); + } + } else { + $obj->setVar('modules_image', $_REQUEST['modules_image']); + } + //remove all spaces from the new name + $spacesRemoved = str_replace(' ', '', $_REQUEST['modules_name']); + + $obj->setVar('modules_name', $spacesRemoved ); + $obj->setVar('modules_version', $_REQUEST['modules_version']); + $obj->setVar('modules_description', $_REQUEST['modules_description']); + $obj->setVar('modules_author', $_REQUEST['modules_author']); + $obj->setVar('modules_author_mail', $_REQUEST['modules_author_mail']); + $obj->setVar('modules_author_website_url', $_REQUEST['modules_author_website_url']); + $obj->setVar('modules_author_website_name', $_REQUEST['modules_author_website_name']); + $obj->setVar('modules_credits', $_REQUEST['modules_credits']); + $obj->setVar('modules_license', $_REQUEST['modules_license']); + $obj->setVar('modules_release_info', $_REQUEST['modules_release_info']); + $obj->setVar('modules_release_file', $_REQUEST['modules_release_file']); + $obj->setVar('modules_manual', $_REQUEST['modules_manual']); + $obj->setVar('modules_manual_file', $_REQUEST['modules_manual_file']); + $obj->setVar('modules_demo_site_url', $_REQUEST['modules_demo_site_url']); + $obj->setVar('modules_demo_site_name', $_REQUEST['modules_demo_site_name']); + $obj->setVar('modules_forum_site_url', $_REQUEST['modules_forum_site_url']); + $obj->setVar('modules_forum_site_name', $_REQUEST['modules_forum_site_name']); + $obj->setVar('modules_module_website_url', $_REQUEST['modules_module_website_url']); + $obj->setVar('modules_module_website_name', $_REQUEST['modules_module_website_name']); + $obj->setVar('modules_release', $_REQUEST['modules_release']); + $obj->setVar('modules_module_status', $_REQUEST['modules_module_status']); + $obj->setVar('modules_display_admin', $_REQUEST['modules_display_admin']); + $obj->setVar('modules_display_user', $_REQUEST['modules_display_user']); + $obj->setVar('modules_active_search', $_REQUEST['modules_active_search']); + $obj->setVar('modules_active_comments', $_REQUEST['modules_active_comments']); + + if ($modulesHandler->insert($obj)) { + redirect_header('modules.php?op=default', 2, _AM_TDMCREATE_FORMOK); + } + break; + + case "modules_create": + echo $adminMenu->addNavigation('modules.php'); + $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=modules_list', 'list'); + echo $adminMenu->renderButton(); + + $obj =& $modulesHandler->create(); + $form = $obj->getForm(); + break; + case "modules_edit": + $obj =& $modulesHandler->get($_REQUEST['modules_id']); + $form = $obj->getForm(); + break; + case "modules_delete": + $obj =& $modulesHandler->get($_REQUEST['modules_id']); + if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) + { + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if ($modulesHandler->delete($obj)) { + $xoopsDB->queryF("DELETE FROM ".$xoopsDB->prefix("tdmcreate_modules")." WHERE modules_id = ".$_REQUEST['modules_id']); + redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array('ok' => 1, 'modules_id' => $_REQUEST['modules_id'], 'op' => 'modules_delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('modules_name'))); + } + break; + case "modules_list": + default: + echo $adminMenu->addNavigation('modules.php'); + $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_NEW, 'modules.php?op=modules_create', 'add'); + echo $adminMenu->renderButton(); + + $criteria = new CriteriaCompo(); + $criteria->setSort('modules_name'); + $criteria->setOrder('ASC'); + $modules_arr = $modulesHandler->getall($criteria); + $numrows_modules = $modulesHandler->getCount(); + + if ( $numrows_modules > 0 ) + { + echo '<table width="100%" cellspacing="1" class="outer">'; + echo '<tr class="center">'; + echo '<th width="20%">'._AM_TDMCREATE_NAME.'</th>'; + echo '<th width="10%">'._AM_TDMCREATE_IMAGE.'</th>'; + echo '<th width="15%">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>'; + echo '<th width="15%">'._AM_TDMCREATE_DISPLAY_USER.'</th>'; + echo '<th width="10%">'._AM_TDMCREATE_BLOCKS.'</th>'; + echo '<th width="10%">'._AM_TDMCREATE_NB_FIELDS.'</th>'; + echo '<th width="10%">'._AM_TDMCREATE_FORMACTION.'</th>'; + echo '</tr>'; + $class = 'odd'; + foreach (array_keys($modules_arr) as $i) + { + $modules_id = $modules_arr[$i]->getVar('modules_id'); + $modules_name = $modules_arr[$i]->getVar('modules_name'); + $modules_image = $modules_arr[$i]->getVar('modules_image'); + //$modules_blocks = $modules_arr[$i]->getVar('modules_blocks'); + $modules_display_admin = $modules_arr[$i]->getVar('modules_display_admin'); + $modules_display_user = $modules_arr[$i]->getVar('modules_display_user'); + $display_admin = ($modules_display_admin == 1) ? _YES : _NO; + $display_user = ($modules_display_user == 1) ? _YES : _NO; + echo '<tr class="odd center">'; + echo '<td><b>'.$modules_name.'</b></td>'; + echo '<td><img src="../images/uploads/modules/'.$modules_image.'" height="30px"></td>'; + echo '<td>'.$display_admin.'</td>'; + echo '<td>'.$display_user.'</td>'; + echo '<td> </td>'; + echo '<td> </td>'; + echo '<td>'; + echo '<a href="modules.php?op=modules_edit&modules_id='.$modules_id.'"><img src='. $pathIcon16 ."/edit.png alt="._AM_TDMCREATE_FORMEDIT.'" title="'._AM_TDMCREATE_FORMEDIT.'"></a> <a href="modules.php?op=modules_delete&modules_id='.$modules_id.'"><img src='. $pathIcon16 ."/delete.png alt="._AM_TDMCREATE_FORMDEL.'" title="'._AM_TDMCREATE_FORMDEL.'"></a>'; + echo '</td>'; + echo '</tr>'; + } + echo '</table><br><br>'; + } + break; +} +include_once "admin_footer.php"; \ No newline at end of file Added: XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/tables.php (rev 0) +++ XoopsModules/TDMCreate/branches/mamba/TDMCreate/admin/tables.php 2012-09-24 21:19:29 UTC (rev 10188) @@ -0,0 +1,569 @@ +<?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_once 'admin_header.php'; +$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' ); +switch ($op) { + case "tables_save": + if (isset($_REQUEST['tables_id'])) { + $obj =& $tablesHandler->get($_REQUEST['tables_id']); + } else { + $obj =& $tablesHandler->create(); + } + + //Module Name + $modules =& $modulesHandler->get($_REQUEST['tables_modules']); + $modules_name = $modules->getVar('modules_name'); + + $obj->setVar('tables_modules', $_REQUEST['tables_modules']); + + if ( $_REQUEST['select'] == 1 ) + { + $obj->setVar('tables_module_table', strtolower($modules_name.'_category')); + $obj->setVar('tables_category', 1); + $obj->setVar('tables_name', 'category'); + $obj->setVar('tables_blocks', 0); + $obj->setVar('tables_display_admin', 1); + $obj->setVar('tables_display_user', 1); + $obj->setVar('tables_status', 0); + $obj->setVar('tables_waiting', 0); + $obj->setVar('tables_online', 0); + $obj->setVar('tables_search', 0); + $obj->setVar('tables_comments', 0); + $obj->setVar('tables_nb_fields', 7); + + $tables_fields = 'category_id:int:11:unsigned:NOT NULL: :|category_pid:int:5:unsigned:NOT NULL:0:|category_title:varchar:255: :NOT NULL: :|category_desc:text: : :NOT NULL: :|category_img:varchar:255: :NOT NULL: :|category_weight:int:5: :NOT NULL:0:|category_color:varchar:10: :NULL: :'; + + $tables_parameters = 'XoopsFormCategory:0:0:0:0:0:0|XoopsFormText:1:1:0:1:0:1|XoopsFormTextArea:0:1:0:0:0:1|XoopsFormUploadImage:1:1:0:0:0:0|XoopsFormText:1:1:0:0:0:0|XoopsFormColorPicker:1:1:0:0:0:0|XoopsFormSelectUser:0:0:0:0:0:1|XoopsFormTextDateSelect:0:0:0:0:0:1|XoopsFormCheckBox:1:1:0:0:0:1'; + + //Image + include_once XOOPS_ROOT_PATH.'/class/uploader.php'; + + if(is_dir($pathIcon32)){ + $uploaddir = $pathIcon32; + }else{ + $uploaddir = XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/images/uploads/tables/"; + } + + $uploader = new XoopsMediaUploader($uploaddir, "gif|jpeg|pjpeg|png", 104857600, null, null); + + if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { + $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["attachedfile1"]['name']) ; + $name_img = 'category.'.$extension; + $uploader->setTargetFileName($name_img); + $uploader->fetchMedia($_POST['xoops_upload_file'][0]); + if (!$uploader->upload()) { + $errors = $uploader->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar('tables_img', $uploader->getSavedFileName()); + } + } else { + $obj->setVar('tables_img', $_REQUEST['tables_img1']); + } + } else { + + $obj->setVar('tables_module_table', strtolower($modules_name.'_'.$_REQUEST['tables_name'])); + $obj->setVar('tables_name', strtolower($_REQUEST['tables_name'])); + $obj->setVar('tables_blocks', $_REQUEST['tables_blocks']); + $obj->setVar('tables_display_admin', $_REQUEST['tables_display_admin']); + $obj->setVar('tables_display_user', $_REQUEST['tables_display_user']); + $obj->setVar('tables_status', $_REQUEST['tables_status']); + $obj->setVar('tables_waiting', $_REQUEST['tables_waiting']); + $obj->setVar('tables_online', $_REQUEST['tables_online']); + $obj->setVar('tables_search', $_REQUEST['tables_search']); + $obj->setVar('tables_comments', $_REQUEST['tables_comments']); + + $obj->setVar('tables_nb_fields', $_REQUEST['tables_nb_fields']); + + $tables_fields = ''; + $tables_parameters = ''; + for($i=0; $i<$_REQUEST['tables_nb_fields']; $i++) + { + //Additions of parameters: text: on: off: ... + if ( $i != 0 ) { + $tables_parameters .= ( !empty($_REQUEST['fields_param_elements'][$i]) ) ? "".$_REQUEST['fields_param_elements'][$i].":" : " :"; + $tables_parameters .= ( !empty($_REQUEST['fields_param_display_admin'][$i]) ) ? "1:" : "0:"; + $tables_parameters .= ( !empty($_REQUEST['fields_param_display_user'][$i]) ) ? "1:" : "0:"; + $tables_parameters .= ( !empty($_REQUEST['fields_param_display_blocks'][$i]) ) ? "1:" : "0:"; + $tables_parameters .= ( $i == $_REQUEST['fields_param_main_field']) ? "1:" : "0:"; + $tables_parameters .= ( !empty($_REQUEST['fields_param_search_field'][$i]) ) ? "1:" : "0:"; + $tables_parameters .= ( !empty($_REQUEST['fields_param_required_field'][$i]) ) ? "1" : "0"; + } + + //Additions of fields: test: int: 4: ... + $tables_fields .= (!empty($_REQUEST['fields_name'][$i])) ? "".$_REQUEST['fields_name'][$i].":" : " :"; + $tables_fields .= (!empty($_REQUEST['fields_type'][$i])) ? "".$_REQUEST['fields_type'][$i].":" : " :"; + $tables_fields .= (!empty($_REQUEST['fields_value'][$i])) ? "".$_REQUEST['fields_value'][$i].":" : " :"; + $tables_fields .= (!empty($_REQUEST['fields_attributes'][$i])) ? "".$_REQUEST['fields_attributes'][$i].":" : " :"; + $tables_fields .= (!empty($_REQUEST['fields_null'][$i])) ? "".strtoupper($_REQUEST['fields_null'][$i]).":" : " :"; + $tables_fields .= (!empty($_REQUEST['fields_default'][$i])) ? "".$_REQUEST['fields_default'][$i].":" : " :"; + $tables_fields .= (!empty($_REQUEST['fields_index'][$i])) ? "".$_REQUEST['fields_index'][$i]."" : " "; + + //Break between fields and between the parameters + if ( $i != $_REQUEST['tables_nb_fields'] - 1) { + $tables_fields .= '|'; + if ( $i != 0 ) + $tables_parameters .= '|'; + } else { + $tables_fields .= '|'.strtolower($_REQUEST['tables_name']).'_status:int:10: :NOT NULL:0:|'.strtolower($_REQUEST['tables_name']).'_waiting:int:10: :NOT NULL:0:|'.strtolower($_REQUEST['tables_name']).'_online:tinyint:1: :NOT NULL:0:'; + $tables_parameters .= '|XoopsFormCheckBox:1:1:1:0:0:1|XoopsFormCheckBox:1:1:1:0:0:1|XoopsFormCheckBox:1:1:1:0:0:1'; + } + } + } + $obj->setVar('tables_fields', $tables_fields); + $obj->setVar('tables_parameters', $tables_parameters); + + if ($tablesHandler->insert($obj)) + { + redirect_header('tables.php?op=default', 2, _AM_TDMCREATE_FORMOK); + } + + break; + + case "tables_save1": + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + + if (isset($_REQUEST['tables_id'])) { + $obj =& $tablesHandler->get($_REQUEST['tables_id']); + } else { + $obj =& $tablesHandler->create(); + } + //Module Name + $modules =& $modulesHandler->get($_REQUEST['tables_modules']); + $modules_name = $modules->getVar('modules_name'); + + $tables_blocks = (isset($_REQUEST['tables_blocks'])) ? $_REQUEST['tables_blocks'] : '0'; + $tables_display_admin = (isset($_REQUEST['tables_display_admin'])) ? $_REQUEST['tables_display_admin'] : '0'; + $tables_display_user = (isset($_REQUEST['tables_display_user'])) ? $_REQUEST['tables_display_user'] : '0'; + $tables_status = (isset($_REQUEST['tables_status'])) ? $_REQUEST['tables_status'] : '0'; + $tables_waiting = (isset($_REQUEST['tables_waiting'])) ? $_REQUEST['tables_waiting'] : '0'; + $tables_online = (isset($_REQUEST['tables_online'])) ? $_REQUEST['tables_online'] : '0'; + $tables_search = (isset($_REQUEST['tables_search'])) ? $_REQUEST['tables_search'] : '0'; + $tables_comments = (isset($_REQUEST['tables_comments'])) ? $_REQUEST['tables_comments'] : '0'; + $select = (isset($_REQUEST['select'])) ? $_REQUEST['select'] : '0'; + + //Image + include_once XOOPS_ROOT_PATH.'/class/uploader.php'; + if(is_dir($pathIcon32)){ + $uploaddir = $pathIcon32; + }else{ + $uploaddir = XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/images/uploads/tables/"; + } + $uploader = new XoopsMediaUploader($uploaddir, "gif|jpeg|pjpeg|png", 104857600, null, null); + + if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { + $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["attachedfile"]['name']) ; + $name_img = $_REQUEST['tables_name'].'.'.$extension; + $uploader->setTargetFileName($name_img); + $uploader->fetchMedia($_POST['xoops_upload_file'][0]); + if (!$uploader->upload()) { + $errors = $uploader->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar('tables_img', $uploader->getSavedFileName()); + } + } else { + $obj->setVar('tables_img', $_REQUEST['tables_img']); + } + + + $oldname=$obj->getVar('tables_name'); + + + $obj->setVar('tables_modules', strtolower($_REQUEST['tables_modules'])); + $obj->setVar('tables_module_table', strtolower($modules_name.'_'.$_REQUEST['tables_name'])); + $obj->setVar('tables_name', strtolower($_REQUEST['tables_name'])); + $obj->setVar('tables_blocks', $_REQUEST['tables_blocks']); + $obj->setVar('tables_display_admin', $_REQUEST['tables_display_admin']); + $obj->setVar('tables_display_user', $_REQUEST['tables_display_user']); + $obj->setVar('tables_status', $_REQUEST['tables_status']); + $obj->setVar('tables_waiting', $_REQUEST['tables_waiting']); + $obj->setVar('tables_online', $_REQUEST['tables_online']); + //Setting isset for Search + if ( isset($_REQUEST['tables_search']) ) + $obj->setVar('tables_search', $_REQUEST['tables_search']); + if ( isset($_REQUEST['tables_comments']) ) + $obj->setVar('tables_comments', $_REQUEST['tables_comments']); + $obj->setVar('tables_nb_fields', $_REQUEST['tables_nb_fields']); + + $tables_fields = $obj->getVar('tables_fields'); + $tables_nb_fields=$_REQUEST['tables_nb_fields']; + + $fields_total = explode("|", $tables_fields); + $count_fields = count($fields_total); + + $newname=strtolower($_REQUEST['tables_name']); + //echo $count_parameters; + //fields + for($i=0; $i<$count_fields; $i++) + { +// if ( $i >= $count_fields ) { +// $fields_name[$i] = ''; +// $fields_type[$i] = ''; +// $fields_value[$i] = ''; +// $fields_attributes[$i] = ''; +// $fields_null[$i] = ''; +// $fields_default[$i] = ''; +// $fields_index[$i] = ''; +// } else { + $fields = explode(":", $fields_total[$i]); + + $fields[0] = $newname . substr($fields[0],stripos($fields[0],'_')); +// $fields_type[$i] = $fields[1]; +// $fields_value[$i] = $fields[2]; +// $fields_attributes[$i] = $fields[3]; +// $fields_null[$i] = $fields[4]; +// $fields_default[$i] = $fields[5]; +// $fields_index[$i] = $fields[6]; + $newfields[$i]=implode(":",$fields); + //} + } + +$newTableFields=implode("|",$newfields); + $obj->setVar('tables_fields', $newTableFields); + + + + if ($tablesHandler->insert($obj)) { + redirect_header('tables.php?op=default', 2, _AM_TDMCREATE_FORMOK); + } + break; + + case "edit_tables": + $obj =& $tablesHandler->get($_REQUEST['tables_id']); + $form = $obj->getFormTable(); + break; + + case "edit_fields": + $obj =& $tablesHandler->get($_REQUEST['tables_id']); + $form = $obj->getFormEditFields(false, $_REQUEST['tables_id']); + break; + + case "delete_tables": + $obj =& $tablesHandler->get($_REQUEST['tables_id']); + if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if ($tablesHandler->delete($obj)) { + redirect_header('tables.php', 3, _AM_TDMCREATE_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array('ok' => 1, 'tables_id' => $_REQUEST['tables_id'], 'op' => 'delete_tables'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('tables_name'))); + } + break; + //-------------- MODULE ------------------------- + case "modules_save": + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if (isset($_REQUEST['modules_id'])) { + $obj =& $modulesHandler->get($_REQUEST['modules_id']); + } else { + $obj =& $modulesHandler->create(); + } + + //Image + include_once XOOPS_ROOT_PATH.'/class/uploader.php'; + $uploaddir = XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/images/uploads/modules/"; + $uploader = new XoopsMediaUploader($uploaddir, "gif|jpeg|pjpeg|png", 104857600, null, null); + + if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { + $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["attachedfile"]['name']); + $name_img = $_REQUEST['modules_name'].'_slogo.'.$extension; + $uploader->setTargetFileName($name_img); + $uploader->fetchMedia($_POST['xoops_upload_file'][0]); + if (!$uploader->upload()) { + $errors = $uploader->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar('modules_image', $uploader->getSavedFileName()); + } + } else { + $obj->setVar('modules_image', $_REQUEST['modules_image']); + } + $spacesRemoved = str_replace(' ', '', $_REQUEST['modules_name']); + $obj->setVar('modules_name', $spacesRemoved); + $obj->setVar('modules_version', $_REQUEST['modules_version']); + $obj->setVar('modules_description', $_REQUEST['modules_description']); + $obj->setVar('modules_author', $_REQUEST['modules_author']); + $obj->setVar('modules_author_email', $_REQUEST['modules_author_email']); + $obj->setVar('modules_author_website_url', $_REQUEST['modules_author_website_url']); + $obj->setVar('modules_author_website_name', $_REQUE... [truncated message content] |