|
From: <txm...@us...> - 2014-05-19 18:53:29
|
Revision: 12539
http://sourceforge.net/p/xoops/svn/12539
Author: txmodxoops
Date: 2014-05-19 18:53:24 +0000 (Mon, 19 May 2014)
Log Message:
-----------
Fix bug
Possibilities to create same files
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldattributes.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldkey.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldnull.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldtype.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/building.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_file.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -32,7 +32,28 @@
} else {
$tables =& $tablesHandler;
}
+//
+$mod_id = $modules->getVar('mod_id');
$mod_name = $modules->getVar('mod_name');
+//Name of tables
+$criteria = new CriteriaCompo();
+if (isset($mod_id)) {
+ $criteria->add(new Criteria('table_mid', $mod_id));
+} else {
+ $criteria->add(new Criteria('table_mid', $mod_name));
+}
+$tables_arr = $tablesHandler->getAll($criteria);
+
+$table_id = $tables->getVar('table_id');
+$table_name = $tables->getVar('table_name');
+$criteria_fields = new CriteriaCompo();
+if (isset($table_id)) {
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+} else {
+ $criteria_fields->add(new Criteria('field_tid', $table_name));
+}
+$fields = $fieldsHandler->getAll($criteria_fields);
+//
$from_dir = TDMC_UPLOAD_MODULES_PATH.'/'.strtolower($mod_name);
$to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_name);
switch ($op) {
@@ -43,29 +64,32 @@
TDMCreate_clearDir($from_dir);
// Clear repertory of new module if there are in root/modules
TDMCreate_clearDir($to_dir);
- // Debut
- /************************************************/
- /*Structure*/
- /************************************************/
+ // Structure
include_once TDMC_PATH . '/class/files/architecture.php';
$handler = TDMCreateArchitecture::getInstance();
$handler->getPath( TDMC_PATH );
$handler->getUploadPath( TDMC_UPLOAD_PATH );
+ // Creation of the structure of folders and files
$base_architecture = $handler->createBaseFoldersFiles( $modules );
if($base_architecture !== false) {
$GLOBALS['xoopsTpl']->assign('base_architecture', true);
} else {
$GLOBALS['xoopsTpl']->assign('base_architecture', false);
- }/**/
- //$builds = array();
- $building_files = $handler->createBuildingFiles( $modules, $tables );
- /*foreach($building_files as $key => $value) {$builds
- $builds['list'] = $key;*/
- $GLOBALS['xoopsTpl']->assign('builds', $building_files);
- //}
- $mod_name = 'uploads/tdmcreate/modules/' . str_replace(' ', '', strtolower($mod_name));
- // Creation of the structure of folders and files
- $GLOBALS['xoopsTpl']->assign('build_list', '<b>Under new construction</b> - Temporary build only folders of this selected module "'.$mod_name.'/"');
+ }
+ // Get files
+ $builds = array();
+ $files = $handler->createBuildingFiles( $modules, $tables, $tables_arr, $fields );
+ foreach($files as $file) {
+ if($file) {
+ $builds['created'] = $file;
+ } else {
+ $builds['notcreated'] = $file;
+ }
+ $GLOBALS['xoopsTpl']->append('builds', $builds);
+ }
+ // Directory to saved all files
+ $GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, str_replace(' ', '', strtolower($mod_name))));
+ // Copy this module in root modules
if ( $modules->getVar('mod_inroot_copy') == 1 ) {
TDMCreate_copyr($from_dir, $to_dir);
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -46,7 +46,8 @@
case 'list':
default:
$start = TDMCreateRequest::getInt('start', 0);
- $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('fields_adminpager'));
+ $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
+ //$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('fields_adminpager'));
// Define main template
$template_main = 'fields.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
@@ -59,6 +60,7 @@
$GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+ $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
// Redirect if there aren't modules
$nb_modules = $modulesHandler->getCount();
if ( $nb_modules == 0 ) {
@@ -160,7 +162,7 @@
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- $fieldelement_fid = $field_id = TDMCreateRequest::getInt('fieldelement_fid');
+ $fieldelement_fid = TDMCreateRequest::getInt('fieldelement_fid');
//
if (isset($field_id)) {
$obj =& $fieldsHandler->get($field_id);
@@ -171,12 +173,13 @@
$obj =& $fieldsHandler->create();
$objfieldelement =& $fieldelementsHandler->create();
}
+ //
if ($field_numb > 0) {
for( $i = 1; $i <= $field_numb; $i++ ) {
//
$obj->setVar( 'field_mid', $field_mid );
$obj->setVar( 'field_tid', $field_tid );
- $obj->setVar( 'field_numb', $field_numb );
+ $obj->setVar( 'field_numb', (isset($_POST['field_numb'][$i]) ? $_POST['field_numb'][$i] : 0) );
$obj->setVar( 'field_name', (isset($_POST['field_name'][$i]) ? $_POST['field_name'][$i] : '') );
$obj->setVar( 'field_type', (isset($_POST['field_type'][$i]) ? $_POST['field_type'][$i] : '') );
$obj->setVar( 'field_value', (isset($_POST['field_value'][$i]) ? $_POST['field_value'][$i] : '') );
@@ -198,15 +201,19 @@
$fieldsHandler->insert($obj);
}
}
- $objfieldelement->setVar( 'fieldelement_name', 'Table : '.$_REQUEST['table_name'] );
- $objfieldelement->setVar( 'fieldelement_value', 'XoopsFormTables-'.$_REQUEST['table_name'] );
+ $objfieldelement->setVar( 'fieldelement_mid', $field_mid );
+ $objfieldelement->setVar( 'fieldelement_tid', $field_tid );
+ $objfieldelement->setVar( 'fieldelement_name', 'Table : '.ucfirst($table_name) );
+ $objfieldelement->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($table_name) );
// Insert new table name
- $fieldelementsHandler->insert($objfieldelement);
+ if (!$fieldelementsHandler->insert($objfieldelement) ) {
+ $GLOBALS['xoopsTpl']->assign('error', $objfieldelement->getHtmlErrors() . ' Field element');
+ }
//
if ($obj->isNew()) {
- redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $_REQUEST['table_name']));
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $table_name));
} else {
- redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_UPDATED_OK, $_REQUEST['table_name']));
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_UPDATED_OK, $table_name));
}
//
$GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
@@ -251,7 +258,7 @@
case 'drag':
$side = TDMCreate_CleanVars( $_POST, 'field_id', 0, 'int' );
- if ( $block_id > 0 ) {
+ if ( $field_id > 0 ) {
$fieldsObj = $fieldsHandler->get( $field_id );
$fieldsObj->setVar('field_id', $side);
if (!$fieldsHandler->insert( $fieldsObj )) {
@@ -278,7 +285,7 @@
exit;
break;
- case 'toggle':
+ case 'display':
if (isset($_GET['field_tid'])) {
if (isset($_GET['field_parent'])) {
$fld_parent = intval($_GET['field_parent']);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -39,6 +39,8 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
+ $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+ $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
@@ -195,45 +197,35 @@
}
break;
- case 'toggle':
- if (isset($_GET['mod_id'])) {
- if (isset($_GET['mod_admin'])) {
- $madmin = intval($_GET['mod_admin']);
- $mod_admin = ($madmin == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($mod_id);
+ case 'display':
+ $mod_admin = TDMCreateRequest::getInt('mod_admin');
+ $mod_user = TDMCreateRequest::getInt('mod_user');
+ $mod_search = TDMCreateRequest::getInt('mod_search');
+ $mod_comments = TDMCreateRequest::getInt('mod_comments');
+ $mod_notifications = TDMCreateRequest::getInt('mod_notifications');
+ $mod_permissions = TDMCreateRequest::getInt('mod_permissions');
+
+ if ( $mod_id > 0 ) {
+ $obj =& $modulesHandler->get($mod_id);
+ if(isset($mod_adminm)) {
$obj->setVar('mod_admin', $mod_admin);
- } elseif (isset($_GET['mod_user'])) {
- $muser = intval($_GET['mod_user']);
- $mod_user = ($muser == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($mod_id);
+ } elseif(isset($mod_user)) {
$obj->setVar('mod_user', $mod_user);
- } elseif (isset($_GET['mod_search'])) {
- $msearch = intval($_GET['mod_search']);
- $mod_search = ($msearch == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($mod_id);
+ } elseif(isset($mod_search)) {
$obj->setVar('mod_search', $mod_search);
- } elseif (isset($_GET['mod_comments'])) {
- $mcomments = intval($_GET['mod_comments']);
- $mod_comments = ($mcomments == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($mod_id);
+ } elseif(isset($mod_comments)) {
$obj->setVar('mod_comments', $mod_comments);
- } elseif (isset($_GET['mod_notifications'])) {
- $mnotifications = intval($_GET['mod_notifications']);
- $mod_notifications = ($mnotifications == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($mod_id);
+ } elseif(isset($mod_notifications)) {
$obj->setVar('mod_notifications', $mod_notifications);
- } elseif (isset($_GET['mod_permissions'])) {
- $mpermissions = intval($_GET['mod_permissions']);
- $mod_permissions = ($mpermissions == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($mod_id);
+ } elseif(isset($mod_permissions)) {
$obj->setVar('mod_permissions', $mod_permissions);
- }
+ }
if ($modulesHandler->insert($obj, true)) {
redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
} else {
redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
}
- }
+ }
break;
}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -34,7 +34,8 @@
case 'list':
default:
$start = TDMCreateRequest::getInt('start', 0);
- $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
+ $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
+ //$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
// Define main template
$template_main = 'tables.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
@@ -97,7 +98,7 @@
$table['id'] = $t;
$table['lid'] = $lid;
$table['mid'] = $tables_arr[$t]->getVar('table_mid');
- $table['name'] = $tables_arr[$t]->getVar('table_name');
+ $table['name'] = ucfirst($tables_arr[$t]->getVar('table_name'));
$table['image'] = $tables_arr[$t]->getVar('table_image');
$table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
$table['blocks'] = $tables_arr[$t]->getVar('table_blocks');
@@ -236,55 +237,41 @@
}
break;
- case 'toggle':
- if (isset($_GET['table_id'])) {
- if (isset($_GET['table_blocks'])) {
- $tbl_blocks = intval($_GET['table_blocks']);
- $table_blocks = ($tbl_blocks == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
+ case 'display':
+ $table_blocks = TDMCreateRequest::getInt('table_blocks');
+ $table_admin = TDMCreateRequest::getInt('table_admin');
+ $table_user = TDMCreateRequest::getInt('table_user');
+ $table_submenu = TDMCreateRequest::getInt('table_submenu');
+ $table_search = TDMCreateRequest::getInt('table_search');
+ $table_comments = TDMCreateRequest::getInt('table_comments');
+ $table_notifications = TDMCreateRequest::getInt('table_notifications');
+ $table_permissions = TDMCreateRequest::getInt('table_permissions');
+
+ if ( $table_id > 0 ) {
+ $obj =& $tablesHandler->get($table_id);
+ if(isset($table_blocks)) {
$obj->setVar('table_blocks', $table_blocks);
- } elseif (isset($_GET['table_admin'])) {
- $tbl_admin = intval($_GET['table_admin']);
- $table_admin = ($tbl_admin == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
+ } elseif(isset($table_adminm)) {
$obj->setVar('table_admin', $table_admin);
- } elseif (isset($_GET['table_user'])) {
- $tbl_user = intval($_GET['table_user']);
- $table_user = ($tbl_user == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
+ } elseif(isset($table_user)) {
$obj->setVar('table_user', $table_user);
- } elseif (isset($_GET['table_submenu'])) {
- $tbl_submenu = intval($_GET['table_submenu']);
- $table_submenu = ($tbl_submenu == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
+ } elseif(isset($table_submenu)) {
$obj->setVar('table_submenu', $table_submenu);
- } elseif (isset($_GET['table_search'])) {
- $tbl_search = intval($_GET['table_search']);
- $table_search = ($tbl_search == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
+ } elseif(isset($table_search)) {
$obj->setVar('table_search', $table_search);
- } elseif (isset($_GET['table_comments'])) {
- $tbl_comments = intval($_GET['table_comments']);
- $table_comments = ($tbl_comments == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
+ } elseif(isset($table_comments)) {
$obj->setVar('table_comments', $table_comments);
- } elseif (isset($_GET['table_notifications'])) {
- $tbl_notifications = intval($_GET['table_notifications']);
- $table_notifications = ($tbl_notifications == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
+ } elseif(isset($table_notifications)) {
$obj->setVar('table_notifications', $table_notifications);
- } elseif (isset($_GET['table_permissions'])) {
- $tbl_permissions = intval($_GET['table_permissions']);
- $table_permissions = ($tbl_permissions == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
+ } elseif(isset($table_permissions)) {
$obj->setVar('table_permissions', $table_permissions);
- }
+ }
if ($tablesHandler->insert($obj, true)) {
- redirect_header('tables.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
+ redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
} else {
- redirect_header('tables.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
+ redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
}
- }
+ }
break;
}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -65,7 +65,7 @@
$form->addElement($mod_select, true);
$form->addElement(new XoopsFormHidden('op', 'build'));
- $form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
+ $form->addElement(new XoopsFormButton(_REQUIRED.' <sup class="red bold">*</sup>', 'submit', _SUBMIT, 'submit'));
return $form;
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldattributes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldattributes.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldattributes.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -16,31 +16,34 @@
* @package tdmcreate
* @since 2.5.5
* @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 fieldattributes.php 11297 2013-03-24 10:58:10Z timgno $
+ * @version $Id: 1.91 fieldattributes.php 11297 2014-05-14 10:58:10Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
-
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+/*
+* @Class TDMCreateFieldattributes
+* @extends XoopsObject
+*/
class TDMCreateFieldattributes extends XoopsObject
{
- //Constructor
- function __construct()
+ /*
+ * @public function constructor class
+ * @param null
+ */
+ public function __construct()
{
- $this->XoopsObject();
- $this->initVar('fieldattribute_value', XOBJ_DTYPE_TXTBOX);
- $this->initVar('fieldattribute_name', XOBJ_DTYPE_TXTBOX);
+ $this->XoopsObject();
+ $this->initVar('fieldattribute_name', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldattribute_value', XOBJ_DTYPE_TXTBOX);
}
-
- //Constructor
- function TDMCreateFieldattributes()
- {
- $this->__construct();
- }
}
-
+/*
+* @Class TDMCreateFieldattributesHandler
+* @extends XoopsPersistableObjectHandler
+*/
class TDMCreateFieldattributesHandler extends XoopsPersistableObjectHandler
{
function __construct(&$db)
{
- parent::__construct($db, 'mod_tdmcreate_fieldattributes', 'tdmcreatefieldattributes', 'fieldattribute_value', 'fieldattribute_name');
+ parent::__construct($db, 'mod_tdmcreate_fieldattributes', 'tdmcreatefieldattributes', 'fieldattribute_name', 'fieldattribute_value');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -17,10 +17,8 @@
* @since 2.5.5
* @author Txmod Xoops <su...@tx...>
* @version $Id: 1.91 fieldelements.php 11297 2014-03-24 09:11:10Z timgno $
- */
-
+ */
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
/*
* @Class TDMCreateFieldElements
* @extends XoopsObject
@@ -33,7 +31,10 @@
*/
public function __construct()
{
- $this->initVar('fieldelement_fid', XOBJ_DTYPE_INT);
+ $this->XoopsObject();
+ $this->initVar('fieldelement_id', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_mid', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_tid', XOBJ_DTYPE_INT);
$this->initVar('fieldelement_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldelement_value', XOBJ_DTYPE_TXTBOX);
}
@@ -75,6 +76,6 @@
*/
public function __construct(&$db)
{
- parent::__construct($db, 'mod_tdmcreate_fieldelements', 'tdmcreatefieldelements', 'fieldelement_fid', 'fieldelement_name');
+ parent::__construct($db, 'mod_tdmcreate_fieldelements', 'tdmcreatefieldelements', 'fieldelement_id', 'fieldelement_name');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldkey.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldkey.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldkey.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -16,30 +16,34 @@
* @package tdmcreate
* @since 2.5.5
* @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 fieldkey.php 11297 2013-03-24 10:58:10Z timgno $
+ * @version $Id: 1.91 fieldkey.php 11297 2014-05-14 10:58:10Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
-
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+/*
+* @Class TDMCreateFieldkey
+* @extends XoopsObject
+*/
class TDMCreateFieldkey extends XoopsObject
{
- //Constructor
- function __construct()
+ /*
+ * @public function constructor class
+ * @param null
+ */
+ public function __construct()
{
$this->XoopsObject();
- $this->initVar('fieldkey_value', XOBJ_DTYPE_TXTBOX);
- $this->initVar('fieldkey_name', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldkey_name', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldkey_value', XOBJ_DTYPE_TXTBOX);
}
-
- //Constructor
- function TDMCreateFieldkey()
- {
- $this->__construct();
- }
}
+/*
+* @Class TDMCreateFieldkeyHandler
+* @extends XoopsPersistableObjectHandler
+*/
class TDMCreateFieldkeyHandler extends XoopsPersistableObjectHandler
{
function __construct(&$db)
{
- parent::__construct($db, 'mod_tdmcreate_fieldkey', 'tdmcreatefieldkey', 'fieldkey_value', 'fieldkey_name');
+ parent::__construct($db, 'mod_tdmcreate_fieldkey', 'tdmcreatefieldkey', 'fieldkey_name', 'fieldkey_value');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldnull.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldnull.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldnull.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -16,31 +16,34 @@
* @package tdmcreate
* @since 2.5.5
* @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 fieldnull.php 11297 2013-03-24 10:58:10Z timgno $
+ * @version $Id: 1.91 fieldnull.php 11297 2014-05-14 10:58:10Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
-
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+/*
+* @Class TDMCreateFieldnull
+* @extends XoopsObject
+*/
class TDMCreateFieldnull extends XoopsObject
{
- //Constructor
- function __construct()
+ /*
+ * @public function constructor class
+ * @param null
+ */
+ public function __construct()
{
- $this->XoopsObject();
+ $this->XoopsObject();
+ $this->initVar('fieldnull_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldnull_value', XOBJ_DTYPE_TXTBOX);
- $this->initVar('fieldnull_name', XOBJ_DTYPE_TXTBOX);
}
-
- //Constructor
- function TDMCreateFieldnull()
- {
- $this->__construct();
- }
}
-
+/*
+* @Class TDMCreateFieldnullHandler
+* @extends XoopsPersistableObjectHandler
+*/
class TDMCreateFieldnullHandler extends XoopsPersistableObjectHandler
{
function __construct(&$db)
{
- parent::__construct($db, 'mod_tdmcreate_fieldnull', 'tdmcreatefieldnull', 'fieldnull_value', 'fieldnull_name');
+ parent::__construct($db, 'mod_tdmcreate_fieldnull', 'tdmcreatefieldnull', 'fieldnull_name', 'fieldnull_value');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -140,17 +140,8 @@
$form->addElement(new TDMCreateFormLabel('</tr></thead>'));
$form->addElement(new TDMCreateFormLabel('<tbody>'));
- $obj = $fieldsHandler->getObjects(null);
-
- // Get the list of fields
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_mid', $field_mid));
- $criteria->add(new Criteria('field_tid', $field_tid));
- $criteria->setSort('field_id ASC, field_name');
- $criteria->setOrder('ASC');
- $fields_arr = $fieldsHandler->getAll($criteria);
- unset($criteria);
-
+ $obj = $fieldsHandler->getObjects(null);
+
$class = '';
for($i = 1; $i <= $field_numb; $i++)
{
@@ -190,27 +181,20 @@
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
// Field Void
$table_autoincrement = $this->tdmcreate->getHandler('tables')->get($f_tid);
- if( ($i == 1) && ($table_autoincrement->getVar('table_autoincrement') == 1)/**/) {
+ if( ($i == 1) && ($table_autoincrement->getVar('table_autoincrement') == 1)) {
$form->addElement(new TDMCreateFormLabel('<td> </td></tr>'));
} else {
// Box header row
$parameters_tray = new XoopsFormElementTray('', '<br />');
- // Field Elements
+ // Field Elements
+ $criteria_element = new CriteriaCompo();
+ $criteria_element->add(new Criteria('fieldelement_tid', 0));
+ $criteria_table = new CriteriaCompo();
+ $criteria_table->add(new Criteria('fieldelement_mid', $field_mid));
$field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']', $this->getVar('field_element'));
- $field_elements_select->addOptionArray($fieldelementsHandler->getList());
- $criteria = new CriteriaCompo(new Criteria('table_id', $f_tid));
- $criteria->add(new Criteria('table_mid', $f_mid));
- $criteria->setSort('table_name');
- $criteria->setOrder('ASC');
- $table_arr = $tablesHandler->getAll($criteria);
- unset($criteria);
- foreach (array_keys($table_arr) as $xft_other)
- {
- $form_table_name = $table_arr[$xft_other]->getVar('table_name');
- if ( $xft_other[$i] == 'XoopsFormTables-'.$form_table_name ) {
- $field_elements_select->addOption('XoopsFormTables-'.$form_table_name, 'Table : '.$form_table_name);
- }
- }
+ $field_elements_select->addOptionArray($fieldelementsHandler->getList($criteria_element));
+ $field_elements_select->addOptionArray($fieldelementsHandler->getList($criteria_table));
+ unset($criteria_element); unset($criteria_table);
$parameters_tray->addElement($field_elements_select);
$field_parent = $isNew ? ( $i == 1 ? 1 : 0 ) : $this->getVar('field_parent');
@@ -330,9 +314,9 @@
*
* @return mixed reference to the {@link TDMCreateFields} object
*/
- public function &get($id)
+ public function &get($id = null, $fields = null)
{
- return parent::get($id);
+ return parent::get($id, $fields);
}
/**
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldtype.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldtype.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldtype.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -16,30 +16,34 @@
* @package tdmcreate
* @since 2.5.5
* @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 fieldtype.php 11297 2013-03-24 10:58:10Z timgno $
+ * @version $Id: 1.91 fieldtype.php 11297 2014-05-14 10:58:10Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
-
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+/*
+* @Class TDMCreateFieldtype
+* @extends XoopsObject
+*/
class TDMCreateFieldtype extends XoopsObject
{
- //Constructor
- function __construct()
+ /*
+ * @public function constructor class
+ * @param null
+ */
+ public function __construct()
{
- $this->XoopsObject();
- $this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX);
- $this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX);
+ $this->XoopsObject();
+ $this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX);
}
-
- //Constructor
- function TDMCreateFieldtype()
- {
- $this->__construct();
- }
}
+/*
+* @Class TDMCreateFieldtypeHandler
+* @extends XoopsPersistableObjectHandler
+*/
class TDMCreateFieldtypeHandler extends XoopsPersistableObjectHandler
{
function __construct(&$db)
{
- parent::__construct($db, 'mod_tdmcreate_fieldtype', 'tdmcreatefieldtype', 'fieldtype_value', 'fieldtype_name');
+ parent::__construct($db, 'mod_tdmcreate_fieldtype', 'tdmcreatefieldtype', 'fieldtype_name', 'fieldtype_value');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -29,7 +29,7 @@
/*
* @public function constructor
- * @param string $modules
+ * @param string $module
* @param string $filename
*/
public function __construct($module, $filename) {
@@ -39,7 +39,8 @@
}
/*
* @static function &getInstance
- * @param null
+ * @param string $module
+ * @param string $filename
*/
public static function &getInstance($module, $filename)
{
@@ -65,7 +66,7 @@
echo \$adminMenu->renderAbout('$module_donations', false);
include 'footer.php';
EOT;
- $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -39,7 +39,8 @@
}
/*
* @static function &getInstance
- * @param null
+ * @param string $module
+ * @param string $filename
*/
public static function &getInstance($module, $filename)
{
@@ -69,7 +70,7 @@
<a href='{$support_url}' title='Visit {$support_name}' class='tooltip' rel='external'>{$support_name}</a></div>";
xoops_cp_footer();
EOT;
- $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -27,25 +27,38 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $tables = null;
+ /*
* @public function constructor
* @param string $module
- * @param string $file_name
+ * @param mixed $table
+ * @param string $filename
*/
- public function __construct($module, $table, $file_name) {
+ public function __construct($module, $table, $tables, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
- $this->setFileName($file_name);
+ //$this->setTable($table);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->tables = $tables;
}
/*
* @static function &getInstance
- * @param null
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
*/
- public static function &getInstance($module, $table, $file_name)
+ public static function &getInstance($module, $table, $tables, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $file_name);
+ $instance = new self($module, $table, $tables, $filename);
}
return $instance;
}
@@ -57,7 +70,7 @@
$module = $this->getModule();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
- $table = $this->getTable();
+ //$table = $this->getTable();
$stl_mod_name = strtolower($module_name);
$ucfmod_name = ucfirst($module_name);
$language = $this->getLanguage('AM');
@@ -68,7 +81,7 @@
include_once \$thisPath.'/include/common.php';
include_once \$thisPath.'/include/functions.php';
EOT;
- if ( $table->getVar('table_name') != '' ) {
+ if ( $this->table->getVar('table_name') != '' ) {
$content .= <<<EOT
\ninclude_once \$thisPath.'/class/helper.php';
// Get instance
@@ -85,9 +98,9 @@
\$modPathIcon16 = \$xoopsModule->getInfo('modicons16');
\$modPathIcon32 = \$xoopsModule->getInfo('modicons32');\n
EOT;
- foreach (array_keys($table) as $i)
+ foreach (array_keys($this->tables) as $i)
{
- $table_name = $table[$i]->getVar('table_name');
+ $table_name = $this->tables[$i]->getVar('table_name');
$content .= '$'.$table_name.'Handler =& xoops_getModuleHandler(\''.$table_name. '\', $thisModule);'.PHP_EOL;
}
$content .=<<<EOT
@@ -116,7 +129,7 @@
xoops_cp_header();
\$adminMenu = new ModuleAdmin();
EOT;
- $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -27,26 +27,34 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $tables = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
- * @param string $file_name
+ * @param string $filename
*/
- public function __construct($module, $table, $file_name) {
+ public function __construct($module, $table, $tables, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
- $this->setFileName($file_name);
+ //$this->setTable($table);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->tables = $tables;
}
/*
* @static function &getInstance
- * @param null
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
*/
- public static function &getInstance($module, $table, $file_name)
+ public static function &getInstance($module, $table, $tables, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $file_name);
+ $instance = new self($module, $table, $tables, $filename);
}
return $instance;
}
@@ -55,20 +63,19 @@
* @param null
*/
public function render() {
- $path = $this->getLocalPath('admin');
- $module = $this->getModule();
- $table = $this->getTable();
+ $module = $this->getModule();
$filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $language = $this->getLanguage('AM');
+ //$table = $this->getTable();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $language = $this->getLanguage($module_name, 'AM');
$language_thereare = $this->getLanguage('AM', 'THEREARE_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\ninclude_once 'header.php';
EOT;
- foreach (array_keys($table) as $i)
+ foreach (array_keys($this->tables) as $i)
{
- $table_name = $table[$i]->getVar('table_name');
+ $table_name = $this->tables[$i]->getVar('table_name');
$content .= <<<EOT
\n//count "total {$table_name}"
\$total_{$table_name} = \${$table_name}Handler->getCount();
@@ -78,9 +85,9 @@
\n// InfoBox Statistics
\$adminMenu->addInfoBox({$language}STATISTICS);
EOT;
- foreach (array_keys($table) as $i)
+ foreach (array_keys($this->tables) as $i)
{
- $table_name = $table[$i]->getVar('table_name');
+ $table_name = $this->tables[$i]->getVar('table_name');
$ta_stutable_name = $language_thereare.strtoupper($table_name);
$content .= <<<EOT
\n// InfoBox {$table_name}
@@ -94,7 +101,7 @@
echo \$adminMenu->renderIndex();
include_once 'footer.php';
EOT;
- $this->tdmcfile->create($path, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -27,31 +27,50 @@
*/
private $tdmcfile = null;
/*
- * @var bool
+ * @var string
*/
- private $permissions = false;
+ private $table = null;
/*
+ * @var string
+ */
+ private $tables = null;
+ /*
* @public function constructor
* @param string $module
* @param string $file_name
*/
- public function __construct($module, $table, $file_name, $permissions = false) {
+ public function __construct($module, $table, $tables, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
- $this->setFileName($file_name);
- $this->permissions = $permissions;
- }
+ //$this->setTable($table);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->tables = $tables;
+ }
+ /*
+ * @static function &getInstance
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public static function &getInstance($module, $table, $tables, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $table, $tables, $filename);
+ }
+ return $instance;
+ }
/*
* @public function render
* @param null
*/
public function render() {
- $path = $this->getLocalPath('admin');
$module = $this->getModule();
- $table = $this->getTable();
+ $module_name = $module->getVar('mod_name');
+ //$table = $this->getTable();
$filename = $this->getFileName();
- $language = $this->getLanguage('MI', 'ADMENU');
+ $language = $this->getLanguage($module_name, 'MI', 'ADMENU');
$menu = 1;
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
@@ -59,28 +78,28 @@
\$module_handler =& xoops_gethandler('module');
\$xoopsModule =& XoopsModule::getByDirname(\$dirname);
\$moduleInfo =& \$module_handler->get(\$xoopsModule->getVar('mid'));
-\$pathIcon32 = \$moduleInfo->getInfo('sysicons32');
+\$sysPathIcon32 = \$moduleInfo->getInfo('sysicons32');
\$adminmenu = array();
\$i = 1;
\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/index.php';
-\$adminmenu[\$i]['icon'] = \$pathIcon32.'/home.png';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/home.png';
\$i++;
EOT;
- foreach (array_keys($table) as $i)
+ foreach (array_keys($this->tables) as $i)
{
- if ( $table[$i]->getVar('table_admin') == 1 )
+ if ( $this->tables[$i]->getVar('table_admin') == 1 )
{
$menu++;
$content .= <<<EOT
\n\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/{$table[$i]->getVar('table_name')}.php';
-\$adminmenu[\$i]['icon'] = \$pathIcon32.'/{$table[$i]->getVar('table_image')}';
+\$adminmenu[\$i]['link'] = 'admin/{$this->tables[$i]->getVar('table_name')}.php';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$this->tables[$i]->getVar('table_image')}';
\$i++;
EOT;
}
}
- if( $this->permissions != false ) {
+ if( $this->table->getVar('table_permissions') == 1 ) {
$menu++;
$content .= <<<EOT
\n\$adminmenu[\$i]['title'] = {$language}{$menu};
@@ -98,7 +117,7 @@
EOT;
unset( $menu );
- $this->tdmcfile->create($path, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -29,13 +29,13 @@
/*
* @public function constructor
* @param string $module
- * @param string $file_name
+ * @param string $filename
*/
- public function __construct($module, $table, $file_name) {
+ public function __construct($module, $table, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
$this->setTable($table);
- $this->setFileName($file_name);
+ $this->setFileName($filename);
}
/*
@@ -229,12 +229,11 @@
* @param null
*/
public function render() {
- $path = $this->getLocalPath('admin');
$module = $this->getModule();
$module_name = $module->getVar('mod_name');
$table_name = $this->getTable()->getVar('table_name');
$filename = $this->getFileName();
- $language = $this->getLanguage('AM');
+ $language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getAdminPagesHeader($module_name, $table_name);
$content .= $this->getAdminPagesNew($table_name, $language);
@@ -242,7 +241,7 @@
$content .= $this->getAdminPagesEdit($table_name, $language);
$content .= $this->getAdminPagesDelete($table_name, $language);
$content .= $this->getAdminPagesFooter();
- $this->tdmcfile->create($path, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -27,27 +27,49 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $tables = null;
+ /*
* @public function constructor
* @param string $module
- * @param string $file_name
+ * @param string $filename
*/
- public function __construct($module, $table, $file_name) {
+ public function __construct($module, $table, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
- $this->setFileName($file_name);
- }
+ //$this->setTable($table);
+ $this->setFileName($filename);
+ $this->table = $table;
+ }
/*
+ * @static function &getInstance
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public static function &getInstance($module, $table, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $table, $filename);
+ }
+ return $instance;
+ }
+ /*
* @public function render
* @param null
*/
public function render() {
- $path = $this->getLocalPath('admin');
$module = $this->getModule();
- $table = $this->getTable();
+ //$table = $this->getTable();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
- $language = $this->getLanguage('AM');
+ $language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\ninclude_once 'header.php';
@@ -135,7 +157,7 @@
unset(\$permform);
include_once 'footer.php';
EOT;
- $this->tdmcfile->create($path, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -19,7 +19,7 @@
* @version $Id: admin_templates.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
+require_once 'htmlsmartycodes.php';
class AdminTemplates extends HtmlSmartyCodes
{
/*
@@ -30,23 +30,39 @@
* @public function constructor
* @param string $module
* @param mixed $table
- * @param string $file_name
+ * @param string $filename
*/
- public function __construct($module, $table, $file_name) {
+ public function __construct($module, $table, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
$this->setTable($table);
- $this->setFileName($file_name);
- }
+ $this->setFileName($filename);
+ }
/*
+ * @static function &getInstance
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public static function &getInstance($module, $table, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $table, $filename);
+ }
+ return $instance;
+ }
+ /*
* @public function render
* @param null
*/
public function render() {
- $path = $this->getLocalPath('admin');
+ $module = $this->getModule();
$filename = $this->getFileName();
- $language = $this->getLanguage('AM');
- $this->tdmcfile->create($path, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $module_name = $module->getVar('mod_name');
+ $language = $this->getLanguage($module_name, 'AM');
+ $content = 'Under Construction';
+ $this->tdmcfile->create($module_name, 'templates/', 'admin' $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-19 15:22:07 UTC (rev 12538)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-19 18:53:24 UTC (rev 12539)
@@ -20,15 +20,10 @@
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'structure.php';
-require_once 'file.php';
-require_once 'admin_about.php';
-require_once 'admin_footer.php';
-require_once 'admin_header.php';
-require_once 'admin_index.php';
-require_once 'admin_menu.php';
-require_once 'css_styles.php';
-require_once 'include_functions.php';/**/
-class TDMCreateArchitecture
+include_once TDMC_PATH . '/include/functions.php';
+spl_autoload_register('TDMCreate_autoload');
+
+class TDMCreateArchitecture extends TDMCreateStructure
{
/*
* @var mixed
@@ -53,20 +48,8 @@
public function __construct() {
$this->tdmcreate = TDMCreate::getInstance();
$this->structure = TDMCreateStructure::getInstance();
- }
+ }
/*
- * @private 'magic method' function __autoload classes
- * @param string $class_name
- */
- protected function __autoload($class_name) {
- $filename = $class_name . '.php';
- if (is_readable($filename)) {
- include_once $filename;
- return true;
- }
- return false;
- }
- /*
* @static function &getInstance
* @param null
*/
@@ -175,44 +158,56 @@
* @param string $module
* @param string $table
*/
- public function createBuildingFiles( $module, $table )
+ public function createBuildingFiles( $module, $table, $tables, $fields )
{
- $ret = '';
+ $ret = array();
// Admin Aboutr File
- $adminAbout = AdminAbout::getInstance($module, 'about.php');
- $admin_about = $adminAbout->render();
+ $adminAbout = AdminAbout::getInstance($module, 'about.php');
// Admin Footer File
- $adminFooter = AdminFooter::getInstance($module, 'footer.php');
- $admin_footer = $adminFooter->render();
+ $adminFooter = AdminFooter::getInstance($module, 'footer.php');
// Admin Header File
- //$adminHeader = AdminHeader::getInstance($module, $table, 'header.php');
+ $adminHeader = AdminHeader::getInstance($module, $table, $tables, 'header.php');
// Admin Index File
- //$adminIndex = AdminIndex::getInstance($module, $table, 'index.php');
+ $adminIndex = AdminIndex::getInstance($module, $table, $tables, 'index.php');
// Admin Menu File
- //$adminMenu = AdminMenu::getInstance($module, $table, 'menu.php');
+ $adminMenu = AdminMenu::getInstance($module, $table, $tables, 'menu.php');
+ // Admin Permissions File
+ $adminPermissions = AdminPermissions::getInstance($module, $tables, 'permissions.php');
// Admin Styles File
- $cssStyles = CssStyles::getInstance($module, 'style.css');
+ $cssStyles = CssStyles::getInstance($module, 'style.css');
+ // Admin Common File
+ $includeCommon = IncludeCommon::getInstance($module, 'common.php');
// Admin Functions File
$includeFunctions = IncludeFunctions::getInstance($module, 'functions.php');
+ // Admin Install File
+ $includeInstall = IncludeInstall::getInstance($module, $table, $tables, $fields, 'install.php');
- /*foreach (array_keys($tables_arr) as $i)
+ foreach (array_keys($tables) as $i)
{
-
- }*/
- return array('admin_about' => $admin_about, 'admin_footer' => $admin_footer,//return $ret;
- //'admin_header' => $adminHeader->render(), 'admin_index' => $adminIndex->render(),
- //'admin_menu' => $adminMenu->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- //'admin_footer' => $adminFooter->render(), 'admin_footer' => $adminFooter->render(),
- 'css_style' => $cssStyles->render()/* , 'include_functions' => $includeFunctions->render()*/);
+ $table_name = $tables[$i]->getVar('table_name');
+ // Admin Pages File
+ $adminPages = AdminPages::getInstance($module, $tables, $table_name.'.php');
+ $ret[] = $adminPages->render();
+ // Admin Templates File
+ $adminTemplates = AdminTemplates::getInstance($module, $tables, $table_name.'.tpl');
+ $ret[] = $adminTemplates->render();
+ // User Pages File
+ $userPages = UserPag...
[truncated message content] |