From: <txm...@us...> - 2015-06-09 17:54:03
|
Revision: 13085 http://sourceforge.net/p/xoops/svn/13085 Author: txmodxoops Date: 2015-06-09 17:53:59 +0000 (Tue, 09 Jun 2015) Log Message: ----------- Added template list Added more fields in database Refactoring Fixed seceral bugs Updated existing files and renamed Neede a fresh installation Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/settings.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/js/sortable.js XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateFile.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPermissions.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/blocks/BlocksFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/css/CssStyles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeCommon.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeFunctions.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeInstall.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageMain.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageModinfo.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/sql/SqlFile.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserBreadcrumbs.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserXoopsVersion.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/logoGenerator.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/settings.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/include/common.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/help/help.html XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/sql/mysql.sql XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/templates/admin/tdmcreate_fields_item.tpl XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/templates/admin/tdmcreate_tables_item.tpl Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserPagesList.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/helper.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/session.php Removed Paths: ------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateHelper.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateSession.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -23,11 +23,11 @@ $mid = XoopsRequest::getInt('mod_id'); $moduleObj = $tdmcreate->getHandler('modules')->get($mid); // Clear cache -$cacheFile1 = TDMC_CLASSES_PATH . '/cache/classpaths.cache'; -$cacheFile2 = TDMC_CLASSES_PATH . '/files/cache/classpaths.cache'; -if (file_exists($cacheFile1) && file_exists($cacheFile2)) { - unlink($cacheFile1); - unlink($cacheFile2); +if (file_exists($cacheFile1 = TDMC_CLASSES_PATH . '/cache/classpaths.cache') && + file_exists($cacheFile2 = TDMC_CLASSES_PATH . '/files/cache/classpaths.cache')) { + if (unlink($cacheFile1) && unlink($cacheFile2)) { + redirect_header('building.php?op=build', 5, _AM_TDMCREATE_BUILDING_DELETED_CACHE_FILES); + } } // Switch option switch ($op) { Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -129,38 +129,41 @@ $fields = $tdmcreate->getHandler('fields'); $fieldOrder = 1; // Set Variables - foreach($_POST['field_id'] as $key => $value) + foreach($_POST['field_id'] as $key => $value) { if(isset($value)){ $fieldsObj =& $fields->get($value); } else { $fieldsObj =& $fields->create(); } - $order = $fieldsObj->isNew() ? $fieldOrder : XoopsRequest::getInt('field_order'); + $order = $fieldsObj->isNew() ? $fieldOrder : $_GET['field_order'][$key]; // Set Data $fieldsObj->setVar( 'field_mid', $fieldMid ); - $fieldsObj->setVar( 'field_tid', $fieldTid ); + $fieldsObj->setVar( 'field_tid', $fieldTid ); $fieldsObj->setVar( 'field_order', $order ); $fieldsObj->setVar( 'field_name', $_POST['field_name'][$key]); - $fieldsObj->setVar( 'field_type', $_POST['field_type'][$key]); + $fieldsObj->setVar( 'field_type', $_POST['field_type'][$key]); $fieldsObj->setVar( 'field_value', $_POST['field_value'][$key]); $fieldsObj->setVar( 'field_attribute', $_POST['field_attribute'][$key]); - $fieldsObj->setVar( 'field_null', $_POST['field_null'][$key]); - $fieldsObj->setVar( 'field_default', $_POST['field_default'][$key]); - $fieldsObj->setVar( 'field_key', $_POST['field_key'][$key]); - $fieldsObj->setVar( 'field_element', $_POST['field_element'][$key]); + $fieldsObj->setVar( 'field_null', $_POST['field_null'][$key]); + $fieldsObj->setVar( 'field_default', $_POST['field_default'][$key]); + $fieldsObj->setVar( 'field_key', $_POST['field_key'][$key]); + $fieldsObj->setVar( 'field_element', $_POST['field_element'][$key]); $fieldsObj->setVar( 'field_parent', (1 == $_REQUEST['field_parent'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 1 : 0); $fieldsObj->setVar( 'field_inlist', (1 == $_REQUEST['field_inlist'][$key]) ? 1 : 0); $fieldsObj->setVar( 'field_inform', (1 == $_REQUEST['field_inform'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_user', (1 == $_REQUEST['field_user'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_block', (1 == $_REQUEST['field_block'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_main', ($key == $_REQUEST['field_main'] ? 1 : 0)); - $fieldsObj->setVar( 'field_search', (1 == $_REQUEST['field_search'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_user', (1 == $_REQUEST['field_user'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_thead', (1 == $_REQUEST['field_thead'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_tbody', (1 == $_REQUEST['field_tbody'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_tfoot', (1 == $_REQUEST['field_tfoot'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_block', (1 == $_REQUEST['field_block'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_main', ($key == $_REQUEST['field_main'] ? 1 : 0)); + $fieldsObj->setVar( 'field_search', (1 == $_REQUEST['field_search'][$key]) ? 1 : 0); $fieldsObj->setVar( 'field_required', (1 == $_REQUEST['field_required'][$key]) ? 1 : 0); // Insert Data $tdmcreate->getHandler('fields')->insert($fieldsObj); - $fieldOrder++; + ++$fieldOrder; } unset($fieldOrder); // Get table name from field table id Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -131,18 +131,19 @@ 'mod_website_url' => $_POST['mod_website_url'], 'mod_website_name' => $_POST['mod_website_name'], 'mod_release' => $_POST['mod_release'], - 'mod_status' => $_POST['mod_status'], - 'mod_admin' => ((1 == $_REQUEST['mod_admin']) ? 1 : 0), - 'mod_user' => ((1 == $_REQUEST['mod_user']) ? 1 : 0), - 'mod_blocks' => ((1 == $_REQUEST['mod_blocks']) ? 1 : 0), - 'mod_search' => ((1 == $_REQUEST['mod_search']) ? 1 : 0), - 'mod_comments' => ((1 == $_REQUEST['mod_comments']) ? 1 : 0), - 'mod_notifications' => ((1 == $_REQUEST['mod_notifications']) ? 1 : 0), - 'mod_permissions' => ((1 == $_REQUEST['mod_permissions']) ? 1 : 0), - 'mod_inroot_copy' => ((1 == $_REQUEST['mod_inroot_copy']) ? 1 : 0), + 'mod_status' => $_POST['mod_status'], 'mod_donations' => $_POST['mod_donations'], 'mod_subversion' => $_POST['mod_subversion']) ); + $moduleOption = XoopsRequest::getArray('module_option', array()); + $modulesObj->setVar('mod_admin', in_array('admin', $moduleOption)); + $modulesObj->setVar('mod_user', in_array('user', $moduleOption)); + $modulesObj->setVar('mod_blocks', in_array('blocks', $moduleOption)); + $modulesObj->setVar('mod_search', in_array('search', $moduleOption)); + $modulesObj->setVar('mod_comments', in_array('comments', $moduleOption)); + $modulesObj->setVar('mod_notifications', in_array('notifications', $moduleOption)); + $modulesObj->setVar('mod_permissions', in_array('permissions', $moduleOption)); + $modulesObj->setVar('mod_inroot_copy', in_array('inroot', $moduleOption)); if ($tdmcreate->getHandler('modules')->insert($modulesObj)) { if ($modulesObj->isNew()) { Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/settings.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/settings.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/settings.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -75,18 +75,19 @@ 'set_website_url' => $_POST['set_website_url'], 'set_website_name' => $_POST['set_website_name'], 'set_release' => $_POST['set_release'], - 'set_status' => $_POST['set_status'], - 'set_admin' => ((1 == $_REQUEST['set_admin']) ? 1 : 0), - 'set_user' => ((1 == $_REQUEST['set_user']) ? 1 : 0), - 'set_blocks' => ((1 == $_REQUEST['set_blocks']) ? 1 : 0), - 'set_search' => ((1 == $_REQUEST['set_search']) ? 1 : 0), - 'set_comments' => ((1 == $_REQUEST['set_comments']) ? 1 : 0), - 'set_notifications' => ((1 == $_REQUEST['set_notifications']) ? 1 : 0), - 'set_permissions' => ((1 == $_REQUEST['set_permissions']) ? 1 : 0), - 'set_inroot_copy' => ((1 == $_REQUEST['set_inroot_copy']) ? 1 : 0), + 'set_status' => $_POST['set_status'], 'set_donations' => $_POST['set_donations'], 'set_subversion' => $_POST['set_subversion']) ); + $settingOption = XoopsRequest::getArray('setting_option', array()); + $settingsObj->setVar('set_admin', in_array('admin', $settingOption)); + $settingsObj->setVar('set_user', in_array('user', $settingOption)); + $settingsObj->setVar('set_blocks', in_array('blocks', $settingOption)); + $settingsObj->setVar('set_search', in_array('search', $settingOption)); + $settingsObj->setVar('set_comments', in_array('comments', $settingOption)); + $settingsObj->setVar('set_notifications', in_array('notifications', $settingOption)); + $settingsObj->setVar('set_permissions', in_array('permissions', $settingOption)); + $settingsObj->setVar('set_inroot_copy', in_array('inroot', $settingOption)); if ($tdmcreate->getHandler('settings')->insert($settingsObj)) { redirect_header('settings.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_UPDATED_OK, $_POST['set_name'])); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -133,7 +133,7 @@ $tablesObj =& $tables->create(); } $tableOrder = XoopsRequest::getInt('table_order'); - $order = $tablesObj->isNew() ? $tableOrder + 1 : $tableOrder; + $order = $tablesObj->isNew() ? $tableOrder + 1: $tableOrder; // Form save tables $tablesObj->setVars(array( 'table_mid' => $tableMid, @@ -159,27 +159,28 @@ } else { $tablesObj->setVar('table_image', $_POST['table_image']); } - $tablesObj->setVars(array( - 'table_autoincrement' => ((1 == $_REQUEST['table_autoincrement']) ? 1 : 0), - 'table_index' => ((1 == $_REQUEST['table_index']) ? 1 : 0), - 'table_blocks' => ((1 == $_REQUEST['table_blocks']) ? 1 : 0), - 'table_admin' => ((1 == $_REQUEST['table_admin']) ? 1 : 0), - 'table_user' => ((1 == $_REQUEST['table_user']) ? 1 : 0), - 'table_submenu' => ((1 == $_REQUEST['table_submenu']) ? 1 : 0), - 'table_submit' => ((1 == $_REQUEST['table_submit']) ? 1 : 0), - 'table_tag' => ((1 == $_REQUEST['table_tag']) ? 1 : 0), - 'table_broken' => ((1 == $_REQUEST['table_broken']) ? 1 : 0), - 'table_search' => ((1 == $_REQUEST['table_search']) ? 1 : 0), - 'table_comments' => ((1 == $_REQUEST['table_comments']) ? 1 : 0), - 'table_notifications' => ((1 == $_REQUEST['table_notifications']) ? 1 : 0), - 'table_permissions' => ((1 == $_REQUEST['table_permissions']) ? 1 : 0), - 'table_rate' => ((1 == $_REQUEST['table_rate']) ? 1 : 0), - 'table_print' => ((1 == $_REQUEST['table_print']) ? 1 : 0), - 'table_pdf' => ((1 == $_REQUEST['table_pdf']) ? 1 : 0), - 'table_rss' => ((1 == $_REQUEST['table_rss']) ? 1 : 0), - 'table_single' => ((1 == $_REQUEST['table_single']) ? 1 : 0), - 'table_visit' => ((1 == $_REQUEST['table_visit']) ? 1 : 0) - )); + $tablesObj->setVar( 'table_autoincrement', (1 == $_REQUEST['table_autoincrement']) ? 1 : 0 ); + // Options + $tableOption = XoopsRequest::getArray('table_option', array()); + $tablesObj->setVar('table_install', in_array('install', $tableOption)); + $tablesObj->setVar('table_index', in_array('index', $tableOption)); + $tablesObj->setVar('table_blocks', in_array('blocks', $tableOption)); + $tablesObj->setVar('table_admin', in_array('admin', $tableOption)); + $tablesObj->setVar('table_user', in_array('user', $tableOption)); + $tablesObj->setVar('table_submenu', in_array('submenu', $tableOption)); + $tablesObj->setVar('table_submit', in_array('submit', $tableOption)); + $tablesObj->setVar('table_tag', in_array('tag', $tableOption)); + $tablesObj->setVar('table_broken', in_array('broken', $tableOption)); + $tablesObj->setVar('table_search', in_array('search', $tableOption)); + $tablesObj->setVar('table_comments', in_array('comments', $tableOption)); + $tablesObj->setVar('table_notifications', in_array('notifications', $tableOption)); + $tablesObj->setVar('table_permissions', in_array('permissions', $tableOption)); + $tablesObj->setVar('table_rate', in_array('rate', $tableOption)); + $tablesObj->setVar('table_print', in_array('print', $tableOption)); + $tablesObj->setVar('table_pdf', in_array('pdf', $tableOption)); + $tablesObj->setVar('table_rss', in_array('rss', $tableOption)); + $tablesObj->setVar('table_single', in_array('single', $tableOption)); + $tablesObj->setVar('table_visit', in_array('visit', $tableOption)); // if ($tables->insert($tablesObj)) { if ($tablesObj->isNew()) { @@ -251,32 +252,32 @@ if ($modId > 0) { $modulesObj = $tdmcreate->getHandler('modules')->get($modId); if (isset($_POST['mod_admin'])) { - $mod_admin = $modulesObj->getVar('mod_admin'); - $modulesObj->setVar('mod_admin', !$mod_admin); + $modAdmin = $modulesObj->getVar('mod_admin'); + $modulesObj->setVar('mod_admin', !$modAdmin); } if (isset($_POST['mod_user'])) { $mod_user = $modulesObj->getVar('mod_user'); $modulesObj->setVar('mod_user', !$mod_user); } if (isset($_POST['mod_blocks'])) { - $mod_blocks = $modulesObj->getVar('mod_blocks'); - $modulesObj->setVar('mod_blocks', !$mod_blocks); + $modBlocks = $modulesObj->getVar('mod_blocks'); + $modulesObj->setVar('mod_blocks', !$modBlocks); } if (isset($_POST['mod_search'])) { - $mod_search = $modulesObj->getVar('mod_search'); - $modulesObj->setVar('mod_search', !$mod_search); + $modSearch = $modulesObj->getVar('mod_search'); + $modulesObj->setVar('mod_search', !$modSearch); } if (isset($_POST['mod_comments'])) { - $mod_comments = $modulesObj->getVar('mod_comments'); - $modulesObj->setVar('mod_comments', !$mod_comments); + $modComments = $modulesObj->getVar('mod_comments'); + $modulesObj->setVar('mod_comments', !$modComments); } if (isset($_POST['mod_notifications'])) { - $mod_notifications = $modulesObj->getVar('mod_notifications'); - $modulesObj->setVar('mod_notifications', !$mod_notifications); + $modNotifications = $modulesObj->getVar('mod_notifications'); + $modulesObj->setVar('mod_notifications', !$modNotifications); } if (isset($_POST['mod_permissions'])) { - $mod_permissions = $modulesObj->getVar('mod_permissions'); - $modulesObj->setVar('mod_permissions', !$mod_permissions); + $modPermissions = $modulesObj->getVar('mod_permissions'); + $modulesObj->setVar('mod_permissions', !$modPermissions); } if ($tdmcreate->getHandler('modules')->insert($modulesObj)) { redirect_header('modules.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS); @@ -288,32 +289,36 @@ if ($tableId > 0) { $tablesObj = $tdmcreate->getHandler('tables')->get($tableId); if (isset($_POST['table_admin'])) { - $table_admin = $tablesObj->getVar('table_admin'); - $tablesObj->setVar('table_admin', !$table_admin); + $tableAdmin = $tablesObj->getVar('table_admin'); + $tablesObj->setVar('table_admin', !$tableAdmin); } if (isset($_POST['table_user'])) { - $table_user = $tablesObj->getVar('table_user'); - $tablesObj->setVar('table_user', !$table_user); + $tableUser = $tablesObj->getVar('table_user'); + $tablesObj->setVar('table_user', !$tableUser); } if (isset($_POST['table_blocks'])) { - $table_blocks = $tablesObj->getVar('table_blocks'); - $tablesObj->setVar('table_blocks', !$table_blocks); + $tableBlocks = $tablesObj->getVar('table_blocks'); + $tablesObj->setVar('table_blocks', !$tableBlocks); } + if (isset($_POST['table_submenu'])) { + $tableSubmenu = $tablesObj->getVar('table_submenu'); + $tablesObj->setVar('table_submenu', !$tableSubmenu); + } if (isset($_POST['table_search'])) { - $table_search = $tablesObj->getVar('table_search'); - $tablesObj->setVar('table_search', !$table_search); + $tableSearch = $tablesObj->getVar('table_search'); + $tablesObj->setVar('table_search', !$tableSearch); } if (isset($_POST['table_comments'])) { - $table_comments = $tablesObj->getVar('table_comments'); - $tablesObj->setVar('table_comments', !$table_comments); + $tableComments = $tablesObj->getVar('table_comments'); + $tablesObj->setVar('table_comments', !$tableComments); } if (isset($_POST['table_notifications'])) { - $table_notifications = $tablesObj->getVar('table_notifications'); - $tablesObj->setVar('table_notifications', !$table_notifications); + $tableNotifications = $tablesObj->getVar('table_notifications'); + $tablesObj->setVar('table_notifications', !$tableNotifications); } if (isset($_POST['table_permissions'])) { - $table_permissions = $tablesObj->getVar('table_permissions'); - $tablesObj->setVar('table_permissions', !$table_permissions); + $tablePermissions = $tablesObj->getVar('table_permissions'); + $tablesObj->setVar('table_permissions', !$tablePermissions); } if ($tdmcreate->getHandler('tables')->insert($tablesObj)) { redirect_header('tables.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/js/sortable.js =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/js/sortable.js 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/js/sortable.js 2015-06-09 17:53:59 UTC (rev 13085) @@ -3,7 +3,7 @@ $(document).ready( function(){ /* Call the container items to reorder tables */ $('.table-list').sortable({ - accept: 'tdmc-tables', + accept: 'tables', opacity: 0.6, handle : '.move', cursor: 'move', @@ -19,8 +19,8 @@ } ).disableSelection(); /* Call the container items to reorder fields */ - $('.field-list').sortable({ - accept: 'tdmc-fields', + $('.field-list').sortable({ + accept: 'fields', opacity: 0.6, handle : '.move', cursor: 'move', Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateHelper.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateHelper.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateHelper.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -1,220 +0,0 @@ -<?php -/* - 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. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author trabis <lus...@gm...> - * @version $Id: TDMCreateHelper.php 12258 2014-04-12 23:45:12Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * Class TDMCreateHelper - */ -class TDMCreateHelper -{ - /** - * @var string - */ - private $dirname; - /** - * @var string - */ - private $module; - /** - * @var string - */ - private $handler; - /** - * @var string - */ - private $config; - /** - * @var string - */ - private $debug; - /** - * @var array - */ - private $debugArray = array(); - - /* - * @protected function constructor class - * @param mixed $debug - */ - /** - * @param $debug - */ - public function __construct($debug) - { - $this->debug = $debug; - $this->dirname = basename(dirname(__DIR__)); - } - - /* - * @static function &getInstance - * @param mixed $debug - */ - /** - * @param bool $debug - * @return TDMCreateHelper - */ - public static function &getInstance($debug = false) - { - static $instance = false; - if (!$instance) { - $instance = new self($debug); - } - - return $instance; - } - - /* - * @static function getModule - * @param null - */ - /** - * @return string - */ - public function &getModule() - { - if ($this->module == null) { - $this->initModule(); - } - - return $this->module; - } - - /* - * @static function getConfig - * @param string $name - */ - /** - * @param null $name - * @return null|string - */ - public function getConfig($name = null) - { - if ($this->config == null) { - $this->initConfig(); - } - if (!$name) { - $this->addLog("Getting all config"); - - return $this->config; - } - if (!isset($this->config[$name])) { - $this->addLog("ERROR :: CONFIG '{$name}' does not exist"); - - return null; - } - $this->addLog("Getting config '{$name}' : " . $this->config[$name]); - - return $this->config[$name]; - } - - /* - * @static function setConfig - * @param string $name - * @param mixed $value - */ - /** - * @param null $name - * @param null $value - * @return mixed - */ - public function setConfig($name = null, $value = null) - { - if ($this->config == null) { - $this->initConfig(); - } - $this->config[$name] = $value; - $this->addLog("Setting config '{$name}' : " . $this->config[$name]); - - return $this->config[$name]; - } - - /* - * @static function getHandler - * @param string $name - */ - /** - * @param $name - * @return mixed - */ - public function &getHandler($name) - { - if (!isset($this->handler[$name . '_handler'])) { - $this->initHandler($name); - } - $this->addLog("Getting handler '{$name}'"); - - return $this->handler[$name . '_handler']; - } - - /* - * @static function initModule - * @param null - */ - public function initModule() - { - global $xoopsModule; - if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $this->dirname) { - $this->module = $xoopsModule; - } else { - $hModule = xoops_gethandler('module'); - $this->module = $hModule->getByDirname($this->dirname); - } - $this->addLog('INIT MODULE'); - } - - /* - * @static function initConfig - * @param null - */ - public function initConfig() - { - $this->addLog('INIT CONFIG'); - $hModConfig = xoops_gethandler('config'); - $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid')); - } - - /* - * @static function initHandler - * @param string $name - */ - /** - * @param $name - */ - public function initHandler($name) - { - $this->addLog('INIT ' . $name . ' HANDLER'); - $this->handler[$name . '_handler'] = xoops_getModuleHandler($name, $this->dirname); - } - - /* - * @static function addLog - * @param string $log - */ - /** - * @param $log - */ - public function addLog($log) - { - if ($this->debug && is_object($GLOBALS['xoopsLogger'])) { - $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log); - } - } -} Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateSession.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateSession.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateSession.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -1,114 +0,0 @@ -<?php -/* - 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. - */ -/** - * TDMCreate class - * - * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package TDMCreate - * @since 1.0 - * @author trabis <lus...@gm...> - * @author Harry Fuecks (PHP Anthology Volume II) - * @version $Id: 1.91 session.php 12453 2014-03-28 18:34:46Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * Class TDMCreateSession - */ -class TDMCreateSession -{ - /** - * Session constructor<br /> - * Starts the session with session_start() - * <strong>Note:</strong> that if the session has already started, - * session_start() does nothing - */ - public function __construct() - { - if (!isset($_SESSION)) { - session_start(); - } - } - - /* - * @static function &getInstance - * @param null - */ - /** - * @return TDMCreateSession - */ - public static function &getInstance() - { - static $_sess = false; - if (!isset($_sess)) { - $_sess = new self(); - } - - return $_sess; - } - - /** - * Sets a session variable - * - * @param string $name name of variable - * @param mixed $value value of variable - * - * @return void - * @access public - */ - public function setSession($name, $value) - { - $_SESSION[$name] = $value; - } - - /** - * Fetches a session variable - * - * @param string $name name of variable - * - * @return mixed value of session variable - * @access public - */ - public function getSession($name) - { - if (isset($_SESSION[$name])) { - return $_SESSION[$name]; - } else { - return false; - } - } - - /** - * Deletes a session variable - * - * @param string $name name of variable - * - * @return void - * @access public - */ - public function deleteSession($name) - { - unset($_SESSION[$name]); - } - - /** - * Destroys the whole session - * - * @return void - * @access public - */ - public function destroySession() - { - $_SESSION = array(); - session_destroy(); - } -} Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -43,11 +43,11 @@ foreach(new RecursiveIteratorIterator($directories) as $file) { if ($file->getFilename() == $classFilename) { $fullPath = $file->getRealPath(); - $pathCache[$class] = $fullPath; - require_once $fullPath; + $pathCache[$class] = $fullPath; + require_once $fullPath; break; } - } + } } $serialized_paths = serialize($pathCache); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -46,6 +46,7 @@ public function __construct() { $this->tdmcreate = TDMCreateHelper::getInstance(); + $this->tdmcreate = TDMCreateHelper::getInstance(); $this->initVar('field_id', XOBJ_DTYPE_INT); $this->initVar('field_mid', XOBJ_DTYPE_INT); $this->initVar('field_tid', XOBJ_DTYPE_INT); @@ -59,10 +60,13 @@ $this->initVar('field_key', XOBJ_DTYPE_TXTBOX); $this->initVar('field_element', XOBJ_DTYPE_TXTBOX); $this->initVar('field_parent', XOBJ_DTYPE_INT); + $this->initVar('field_admin', XOBJ_DTYPE_INT); $this->initVar('field_inlist', XOBJ_DTYPE_INT); $this->initVar('field_inform', XOBJ_DTYPE_INT); - $this->initVar('field_admin', XOBJ_DTYPE_INT); $this->initVar('field_user', XOBJ_DTYPE_INT); + $this->initVar('field_thead', XOBJ_DTYPE_INT); + $this->initVar('field_tbody', XOBJ_DTYPE_INT); + $this->initVar('field_tfoot', XOBJ_DTYPE_INT); $this->initVar('field_block', XOBJ_DTYPE_INT); $this->initVar('field_main', XOBJ_DTYPE_INT); $this->initVar('field_search', XOBJ_DTYPE_INT); @@ -242,7 +246,12 @@ $checkFieldParent = new TDMCreateFormRadio('', 'field_parent', $field_parent); $checkFieldParent->addOption($i, _AM_TDMCREATE_FIELD_PARENT ); $parametersTray->addElement($checkFieldParent);*/ - + + $field_admin = 0; + $checkFieldAdmin = new XoopsFormCheckBox(' ', 'field_admin[' . $i . ']', $field_admin); + $checkFieldAdmin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN); + $parametersTray->addElement($checkFieldAdmin); + $field_inlist = 0; $checkFieldInList = new XoopsFormCheckBox(' ', 'field_inlist[' . $i . ']', $field_inlist); $checkFieldInList->addOption(1, _AM_TDMCREATE_FIELD_INLIST); @@ -253,15 +262,25 @@ $checkFieldInForm->addOption(1, _AM_TDMCREATE_FIELD_INFORM); $parametersTray->addElement($checkFieldInForm); - $field_admin = 0; - $checkFieldAdmin = new XoopsFormCheckBox(' ', 'field_admin[' . $i . ']', $field_admin); - $checkFieldAdmin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN); - $parametersTray->addElement($checkFieldAdmin); - $field_user = 0; $checkFieldUser = new XoopsFormCheckBox(' ', 'field_user[' . $i . ']', $field_user); $checkFieldUser->addOption(1, _AM_TDMCREATE_FIELD_USER); $parametersTray->addElement($checkFieldUser); + + $field_thead = 0; + $checkFieldThead = new XoopsFormCheckBox(' ', 'field_thead[' . $i . ']', $field_thead); + $checkFieldThead->addOption(1, _AM_TDMCREATE_FIELD_THEAD); + $parametersTray->addElement($checkFieldThead); + + $field_tbody = 0; + $checkFieldTbody = new XoopsFormCheckBox(' ', 'field_tbody[' . $i . ']', $field_tbody); + $checkFieldTbody->addOption(1, _AM_TDMCREATE_FIELD_TBODY); + $parametersTray->addElement($checkFieldTbody); + + $field_tfoot = 0; + $checkFieldTfoot = new XoopsFormCheckBox(' ', 'field_tfoot[' . $i . ']', $field_tfoot); + $checkFieldTfoot->addOption(1, _AM_TDMCREATE_FIELD_TFOOT); + $parametersTray->addElement($checkFieldTfoot); $field_block = 0; $checkFieldBlock = new XoopsFormCheckBox('', 'field_block[' . $i . ']', $field_block); @@ -282,6 +301,7 @@ $checkFieldRequired = new XoopsFormCheckBox(' ', 'field_required[' . $i . ']', $field_required); $checkFieldRequired->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED); $parametersTray->addElement($checkFieldRequired); + // $form->addElement(new TDMCreateFormLabel('<td><div class="portlet"><div class="portlet-header">' . _AM_TDMCREATE_FIELD_PARAMETERS_LIST . '</div><div class="portlet-content">' . $parametersTray->render() . '</div></div></td></tr>')); } } @@ -376,28 +396,36 @@ $checkFieldParent = new XoopsFormCheckBox(' ', 'field_parent[' . $id . ']', $field->getVar('field_parent')); $checkFieldParent->addOption(1, _AM_TDMCREATE_FIELD_PARENT); $parametersTray->addElement($checkFieldParent); - /*$field_parent = ($field->getVar('field_parent') == 1) ? $id : 1; - $checkFieldParent = new TDMCreateFormRadio('', 'field_parent', $field_parent); - $checkFieldParent->addOption($id, _AM_TDMCREATE_FIELD_PARENT ); - $parametersTray->addElement($checkFieldParent);*/ - + + $checkFieldAdmin = new XoopsFormCheckBox(' ', 'field_admin[' . $id . ']', $field->getVar('field_admin')); + $checkFieldAdmin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN); + $parametersTray->addElement($checkFieldAdmin); + $checkFieldInList = new XoopsFormCheckBox(' ', 'field_inlist[' . $id . ']', $field->getVar('field_inlist')); $checkFieldInList->addOption(1, _AM_TDMCREATE_FIELD_INLIST); $parametersTray->addElement($checkFieldInList); $checkFieldInForm = new XoopsFormCheckBox(' ', 'field_inform[' . $id . ']', $field->getVar('field_inform')); $checkFieldInForm->addOption(1, _AM_TDMCREATE_FIELD_INFORM); - $parametersTray->addElement($checkFieldInForm); + $parametersTray->addElement($checkFieldInForm); - $checkFieldAdmin = new XoopsFormCheckBox(' ', 'field_admin[' . $id . ']', $field->getVar('field_admin')); - $checkFieldAdmin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN); - $parametersTray->addElement($checkFieldAdmin); - $checkFieldUser = new XoopsFormCheckBox(' ', 'field_user[' . $id . ']', $field->getVar('field_user')); $checkFieldUser->addOption(1, _AM_TDMCREATE_FIELD_USER); $parametersTray->addElement($checkFieldUser); - - $checkFieldBlock = new XoopsFormCheckBox('', 'field_block[' . $id . ']', $field->getVar('field_block')); + + $checkFieldThead = new XoopsFormCheckBox(' ', 'field_thead[' . $id . ']', $field->getVar('field_thead')); + $checkFieldThead->addOption(1, _AM_TDMCREATE_FIELD_THEAD); + $parametersTray->addElement($checkFieldThead); + + $checkFieldTbody = new XoopsFormCheckBox(' ', 'field_tbody[' . $id . ']', $field->getVar('field_tbody')); + $checkFieldTbody->addOption(1, _AM_TDMCREATE_FIELD_TBODY); + $parametersTray->addElement($checkFieldTbody); + + $checkFieldTfoot = new XoopsFormCheckBox(' ', 'field_tfoot[' . $id . ']', $field->getVar('field_tfoot')); + $checkFieldTfoot->addOption(1, _AM_TDMCREATE_FIELD_TFOOT); + $parametersTray->addElement($checkFieldTfoot); + + $checkFieldBlock = new XoopsFormCheckBox('', 'field_block[' . $id . ']', $field->getVar('field_block')); $checkFieldBlock->addOption(1, _AM_TDMCREATE_FIELD_BLOCK); $parametersTray->addElement($checkFieldBlock); @@ -591,7 +619,7 @@ /** * Get All Fields By Module & Table Id */ - public function getAllFieldsByModuleAndTableId($modId, $tabId, $start = 0, $limit = 0, $sort = 'field_id ASC, field_name', $order = 'ASC') + public function getAllFieldsByModuleAndTableId($modId, $tabId, $start = 0, $limit = 0, $sort = 'field_order ASC, field_id, field_name', $order = 'ASC') { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('field_mid', $modId)); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -101,7 +101,7 @@ // Creation of "module" folder in the Directory repository $this->structure->makeDir($uploadPath . '/' . $this->structure->getModuleName()); // Copied of index.html file in "root module" folder - $this->structure->copyFile('', $indexFile, 'index.html'); + //$this->structure->copyFile('', $indexFile, 'index.html'); if (1 == $module->getVar('mod_admin')) { // Creation of "admin" folder and index.html file $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html'); @@ -183,19 +183,20 @@ $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html'); } if ($table->getVar('table_name') != null) { - if (1 == $module->getVar('mod_blocks')) { + if ((1 == $module->getVar('mod_blocks')) && (1 == $table->getVar('table_blocks'))) { // Creation of "templates/blocks" folder and index.html file $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html'); } // Creation of "sql" folder and index.html file $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html'); - if (1 == $table->getVar('table_notifications')) { - // Creation of "language/english/mail_template" folder and index.html file - $this->structure->makeDirAndCopyFile('language/english/mail_template', $indexFile, 'index.html'); + if ((1 == $module->getVar('mod_notifications')) && (1 == $table->getVar('table_notifications'))) { if ($language != 'english') { // Creation of "language/local_language/mail_template" folder and index.html file $this->structure->makeDirAndCopyFile('language/' . $language . '/mail_template', $indexFile, 'index.html'); - } + } else { + // Creation of "language/english/mail_template" folder and index.html file + $this->structure->makeDirAndCopyFile('language/english/mail_template', $indexFile, 'index.html'); + } } } } @@ -277,6 +278,10 @@ $userTemplatesPages = TemplatesUserPages::getInstance(); $userTemplatesPages->write($module, $table); $ret[] = $userTemplatesPages->renderFile($moduleDirname . '_' . $tableName . '.tpl'); + // User List Templates File + $userTemplatesPagesList = TemplatesUserPagesList::getInstance(); + $userTemplatesPagesList->write($module, $table); + $ret[] = $userTemplatesPagesList->renderFile($moduleDirname . '_' . $tableName . '_list' . '.tpl'); } } // Language Modinfo File @@ -331,7 +336,7 @@ $ret[] = $classHelper->render(); // Include Functions File $includeFunctions = IncludeFunctions::getInstance(); - $includeFunctions->write($module, 'functions.php'); + $includeFunctions->write($module, $table, 'functions.php'); $ret[] = $includeFunctions->render(); // Creation of blocks language file if ($table->getVar('table_name') != null) { @@ -417,7 +422,7 @@ if (1 == $module->getVar('mod_admin')) { // Templates Index File $userTemplatesIndex = TemplatesUserIndex::getInstance(); - $userTemplatesIndex->write($module, $moduleDirname . '_index.tpl'); + $userTemplatesIndex->write($module, $table, $moduleDirname . '_index.tpl'); $ret[] = $userTemplatesIndex->render(); // Templates Footer File $userTemplatesFooter = TemplatesUserFooter::getInstance(); @@ -425,7 +430,7 @@ $ret[] = $userTemplatesFooter->render(); // Templates Header File $userTemplatesHeader = TemplatesUserHeader::getInstance(); - $userTemplatesHeader->write($module, $tables, $moduleDirname . '_header.tpl'); + $userTemplatesHeader->write($module, $table, $tables, $moduleDirname . '_header.tpl'); $ret[] = $userTemplatesHeader->render(); } // Creation of user files Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateFile.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateFile.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateFile.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -511,7 +511,7 @@ /** * {$name} module for xoops * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright The XOOPS Project (http://xoops.org) * @license {$license} * @package {$dirname} * @since {$since} Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -16,7 +16,7 @@ * @package tdmcreate * @since 2.5.0 * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: htmlsmartycodes.php 12258 2014-01-02 09:33:29Z timgno $ + * @version $Id: TDMCreateHtmlSmartyCodes.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); @@ -380,7 +380,26 @@ return $ret; } + + /* + * @public function getSmartyIncludeFileList + * @param string $name + */ + /** + * @param $moduleDirname + * @param $tableName + * @param $tableFieldName + * @return string + */ + public function getSmartyIncludeFileList($moduleDirname, $tableName, $tableFieldName) + { + $ret = <<<EOT + <{include file='db:{$moduleDirname}_{$tableName}_list.tpl' {$tableFieldName}=\${$tableFieldName}[i]}> +EOT; + return $ret; + } + /* * @public function getSmartyConditions * @param string $condition Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -33,16 +33,32 @@ $this->tdmcreate = TDMCreateHelper::getInstance(); } + /* + * @static function &getInstance + * + * @return TDMCreateFields + */ + public static function &getInstance() + { + static $instance = false; + if (!$instance) { + $instance = new self(); + } + + return $instance; + } + /** * @public function getTableTables * @param $mId * @return mixed */ - public function getTableTables($mId) + public function getTableTables($mId, $sort = 'table_id ASC, table_name', $order = 'ASC') { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('table_mid', $mId)); // $mId = module Id - $criteria->setSort('table_order'); + $criteria->setSort($sort); + $criteria->setOrder($order); $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria); unset($criteria); @@ -55,15 +71,41 @@ * @param $tId * @return mixed */ - public function getTableFields($mId, $tId) + public function getTableFields($mId, $tId, $sort = 'field_id ASC, field_name', $order = 'ASC') { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('field_mid', $mId)); // $mId = module Id $criteria->add(new Criteria('field_tid', $tId)); // $tId = table Id - $criteria->setSort('field_order'); + $criteria->setSort($sort); + $criteria->setOrder($order); $fields = $this->tdmcreate->getHandler('fields')->getObjects($criteria); unset($criteria); return $fields; } + + /** + * @public function getTableFieldElements + * @param $mId + * @param $tId + * @return mixed + */ + public function getTableFieldElements($mId = null, $tId = null, $sort = 'fieldelement_id ASC, fieldelement_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + if($mId != null) { + $criteria->add(new Criteria('fieldelement_mid', $mId)); // $mId = module Id + $criteria->setSort($sort); + $criteria->setOrder($order); + } + if($tId != null) { + $criteria->add(new Criteria('fieldelement_tid', $tId)); // $tId = table Id + $criteria->setSort($sort); + $criteria->setOrder($order); + } + $fieldElements = $this->tdmcreate->getHandler('fieldelements')->getObjects($criteria); + unset($criteria); + + return $fieldElements; + } } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -162,7 +162,7 @@ { $module = $this->getModule(); $table = $this->getTable(); - $tables = $this->getTables(); + //$tables = $this->getTables(); $filename = $this->getFileName(); $moduleDirname = $module->getVar('mod_dirname'); $language = $this->getLanguage($moduleDirname, 'MI', 'ADMENU'); @@ -170,7 +170,8 @@ $content = $this->getHeaderFilesComments($module, $filename); $content .= $this->getAdminMenuHeader(); $content .= $this->getAdminMenuDashboard($language, $menu); - foreach (array_keys($tables) as $t) { + $tables = $this->getTableTables($module->getVar('mod_id'), 'table_order ASC, table_name'); + foreach (array_keys($tables) as $t) { $tablePermissions = $tables[$t]->getVar('table_permissions'); if (1 == $tables[$t]->getVar('table_admin')) { ++$menu; @@ -185,7 +186,7 @@ EOT; } } - if (is_object($table) && 1 == $table->getVar('table_permissions')) { + if (1 == $table->getVar('table_permissions')) { ++$menu; $content .= <<<EOT \$adminmenu[\$i]['title'] = {$language}{$menu}; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -101,8 +101,9 @@ \${$tableName}Obj->setVar('{$fieldName}', formatUrl(\$_REQUEST['{$fieldName}']));\n // Set Var {$fieldName} include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploader = new XoopsMediaUploader({$stuModuleDirname}_UPLOAD_FILES_PATH . '/{$tableName}', \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); + \$uploader = new XoopsMediaUploader({$stuModuleDirname}_UPLOAD_FILES_PATH . '/{$tableName}', + \${$moduleDirname}->getConfig('mimetypes'), + \${$moduleDirname}->getConfig('maxsize'), null, null); if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); if (!\$uploader->upload()) { @@ -132,9 +133,9 @@ \$uploaddir = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32'; \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][1])) { + if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { //\$uploader->setPrefix('{$fieldName}_'); - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][1]); + //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); if (!\$uploader->upload()) { \$errors = \$uploader->getErrors(); redirect_header('javascript:history.go(-1)', 3, \$errors); @@ -161,14 +162,14 @@ $ret = <<<EOT // Set Var {$fieldName} include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][2])) { + \$uploader = new XoopsMediaUploader({$stuModuleDirname}_UPLOAD_IMAGE_PATH.'/{$tableName}', + \${$moduleDirname}->getConfig('mimetypes'), + \${$moduleDirname}->getConfig('maxsize'), null, null); + if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { \$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '' , \$_FILES['attachedfile']['name']); \$imgName = str_replace(' ', '', \$_POST['{$fieldMain}']).'.'.\$extension; \$uploader->setPrefix(\$imgName); - \$uploader->fetchMedia(\$_POST['xoops_upload_file'][2]); + \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); if (!\$uploader->upload()) { \$errors = \$uploader->getErrors(); redirect_header('javascript:history.go(-1)', 3, \$errors); @@ -195,12 +196,12 @@ $ret = <<<EOT // Set Var {$fieldName} include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][3])) { + \$uploader = new XoopsMediaUploader({$stuModuleDirname}_UPLOAD_FILES_PATH.'/{$tableName}', + \${$moduleDirname}->getConfig('mimetypes'), + \${$moduleDirname}->getConfig('maxsize'), null, null); + if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { //\$uploader->setPrefix('{$fieldName}_') ; - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][3]); + //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); if (!\$uploader->upload()) { \$errors = \$uploader->getErrors(); redirect_header('javascript:history.go(-1)', 3, \$errors); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -221,7 +221,7 @@ case 6: $ret .= $this->adminobjects->getCheckBoxOrRadioYNSetVar($tableName, $fieldName); break; - case 11: + case 10: $ret .= $this->adminobjects->getImageListSetVar($moduleDirname, $tableName, $fieldName); break; case 12: Modifie... [truncated message content] |