|
From: <txm...@us...> - 2014-06-04 17:09:11
|
Revision: 12563
http://sourceforge.net/p/xoops/svn/12563
Author: txmodxoops
Date: 2014-06-04 17:09:08 +0000 (Wed, 04 Jun 2014)
Log Message:
-----------
Modified Paths:
--------------
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/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
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-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -50,11 +50,8 @@
* @param string $module
* @param mixed $table
*/
- public function write($module, $table) {
- $this->setModule($module);
- $this->setFileName($filename);
- $this->tables = $tables;
- $this->fields = $fields;
+ public function write($module) {
+ $this->setModule($module);
}
/*
* @public function render
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -94,7 +94,7 @@
$table_name = $tables[$t]->getVar('table_name');
$table_admin = $tables[$t]->getVar('table_admin');
$table_user = $tables[$t]->getVar('table_user');
- $table_block = $tables[$t]->getVar('table_blocks');
+ $table_blocks = $tables[$t]->getVar('table_blocks');
}
//
$indexFile = $this->path.'/index.html';
@@ -113,7 +113,7 @@
// Creation of "admin" folder and index.html file
$this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
}
- if ( $table_block == 1) {
+ if ( $table_blocks == 1) {
// Creation of "blocks" folder and index.html file
$this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
}
@@ -168,7 +168,7 @@
// Creation of "templates/admin" folder and index.html file
$this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
}
- if ( $table_block == 1 ) {
+ if ( $table_blocks == 1 ) {
// Creation of "templates/blocks" folder and index.html file
$this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
}
@@ -200,7 +200,7 @@
$table_name = $tables[$t]->getVar('table_name');
$table_admin = $tables[$t]->getVar('table_admin');
$table_user = $tables[$t]->getVar('table_user');
- $table_block = $tables[$t]->getVar('table_blocks');
+ $table_blocks = $tables[$t]->getVar('table_blocks');
$table_search = $tables[$t]->getVar('table_search');
$table_comments = $tables[$t]->getVar('table_comments');
$table_notifications = $tables[$t]->getVar('table_notifications');
@@ -211,118 +211,21 @@
$fields = $this->tdmcreate->getHandler('fields')->getAll($criteria_fields);
unset($criteria_fields);
- $table = $this->tdmcreate->getHandler('tables')->get($table_id);
-
+ $table = $this->tdmcreate->getHandler('tables')->get($table_id);
+
// Creation of admin files
- if ( $table_admin == 1) {
- // Admin Aboutr File
- $adminAbout = AdminAbout::getInstance();
- $adminAbout->write($module, 'about.php');
- $ret[] = $adminAbout->render();
- // Admin Footer File
- $adminFooter = AdminFooter::getInstance();
- $adminFooter->write($module, 'footer.php');
- $ret[] = $adminFooter->render();
- // Admin Header File
- $adminHeader = AdminHeader::getInstance();
- $adminHeader->write($module, $table, $tables, 'header.php');
- $ret[] = $adminHeader->render();
- // Admin Index File
- $adminIndex = AdminIndex::getInstance();
- $adminIndex->write($module, $table, $tables, 'index.php');
- $ret[] = $adminIndex->render();
- // Admin Menu File
- $adminMenu = AdminMenu::getInstance();
- $adminMenu->write($module, $table, $tables, 'menu.php');
- $ret[] = $adminMenu->render();
- }
- // Creation of admin permission file
- if (( $table_permissions == 1) && ( $table_admin == 1 )) {
- // Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance();
- $adminPermissions->write($module, $tables, $fields, 'permissions.php');
- $ret[] = $adminPermissions->render();
- }
- // Css Styles File
- $cssStyles = CssStyles::getInstance($module, 'style.css');
- $cssStyles->write($module, 'style.css');
- $ret[] = $cssStyles->render();
- // Include Common File
- $includeCommon = IncludeCommon::getInstance();
- $includeCommon->write($module, 'common.php');
- $ret[] = $includeCommon->render();
- // Include Functions File
- $includeFunctions = IncludeFunctions::getInstance();
- $includeFunctions->write($module, 'functions.php');
- $ret[] = $includeFunctions->render();
- // Include Install File
- $includeInstall = IncludeInstall::getInstance();
- $includeInstall->write($module, $tables, $fields, 'install.php');
- $ret[] = $includeInstall->render();
- // Include Jquery File
- $includeJquery = IncludeJquery::getInstance();
- $includeJquery->write($module, 'functions.js');
- $ret[] = $includeJquery->render();
- // Creation of search file
- if ( $table_search == 1) {
- // Include Search File
- $includeSearch = IncludeSearch::getInstance();
- $includeSearch->write($module, $table, $fields, 'search.php');
- $ret[] = $includeSearch->render();
- }
- // Creation of comments files
- if ( $table_comments == 1) {
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsNew($module, 'comment_new');
- }
- // Creation of notifications files
- if ( $table_notifications == 1 ) {
- // Include Notifications File
- $includeNotifications = IncludeNotifications::getInstance();
- $includeNotifications->write($module, $table, $fields, 'notifications.php');
- $ret[] = $includeNotifications->render();
- }
- // Creation of sql file
- if ( $table_name != null) {
- // Sql File
- $sqlFile = SqlFile::getInstance();
- $sqlFile->write($module, $tables, $fields, 'mysql.sql');
- $ret[] = $sqlFile->render();
- }
- // Creation of admin files
if ( $table_admin == 1) {
// Admin Pages File
$adminPages = AdminPages::getInstance();
- $adminPages->write($module, $table_name, $fields);
- //$ret[] = $adminPages->renderFile($table_name.'.php');
- $ret_admin_page = $adminPages->renderFile($table_name.'.php');
- $ret[] = $ret_admin_page;
- var_dump($ret_admin_page);
+ $adminPages->write($module, $table_name, $fields);
+ $ret[] = $adminPages->renderFile($table_name.'.php');
// Admin Templates File
$adminTemplates = AdminTemplates::getInstance();
- $adminTemplates->write($module, $tables);
+ $adminTemplates->write($module);
$ret[] = $adminTemplates->renderFile($table_name.'.tpl');
}
// Creation of blocks
- if ( $table_block == 1) {
+ if ( $table_blocks == 1) {
// Blocks Files
$blocksFiles = BlocksFiles::getInstance();
$blocksFiles->write($module, $table, $fields);
@@ -344,86 +247,185 @@
// User Pages File
$userPages = UserPages::getInstance();
$userPages->write($module, $table, $fields);
- $ret_user_page = $userPages->renderFile($table_name.'.php');
- $ret[] = $ret_user_page;
- var_dump($ret_user_page);
+ $ret[] = $userPages->renderFile($table_name.'.php');
// User Templates File
$userTemplates = UserTemplates::getInstance();
$userTemplates->write($module, $tables, $fields);
$ret[] = $userTemplates->renderFile($table_name.'.tpl');
}
- var_dump($table_name);
- // Creation of admin language file
- if ( $table_admin == 1) {
- // Language Admin File
- $languageAdmin = LanguageAdmin::getInstance();
- $languageAdmin->write($module, $table, $tables, 'admin.php');
- $ret[] = $languageAdmin->render();
- }
- // Creation of blocks language file
- if ( $table_block == 1) {
- // Language Blocks File
- $languageBlocks = LanguageBlocks::getInstance();
- $languageBlocks->write($module, $table, $tables, $fields, 'blocks.php');
- $ret[] = $languageBlocks->render();
- }
- // Creation of user language file
- if ( $table_user == 1) {
- // Language Main File
- $languageMain = LanguageMain::getInstance();
- $languageMain->write($module, $table, $tables, $fields, 'main.php');
- $ret[] = $languageMain->render();
- }
- // Language Modinfo File
- $languageModinfo = LanguageModinfo::getInstance();
- $languageModinfo->write($module, $table, $tables, $fields, 'modinfo.php');
- $ret[] = $languageModinfo->render();
- // Language Help File
- $languageHelp = LanguageHelp::getInstance();
- $languageHelp->write($module, 'help.html');
- $ret[] = $languageHelp->render();
- // Creation of user files
- if ( $table_user == 1) {
- // Templates Footer File
- $templatesFooter = TemplatesFooter::getInstance();
- $templatesFooter->write($module, $table, 'footer.tpl');
- $ret[] = $templatesFooter->render();
- // Templates Header File
- $templatesHeader = TemplatesHeader::getInstance();
- $templatesHeader->write($module, $tables, 'header.tpl');
- $ret[] = $templatesHeader->render();
- // Templates Index File
- $templatesIndex = TemplatesIndex::getInstance();
- $templatesIndex->write($module, 'index.tpl');
- $ret[] = $templatesIndex->render();
- // User Footer File
- $userFooter = UserFooter::getInstance();
- $userFooter->write($module, 'footer.php');
- $ret[] = $userFooter->render();
- // User Header File
- $userHeader = UserHeader::getInstance();
- $userHeader->write($module, 'header.php');
- $ret[] = $userHeader->render();
- // User Index File
- $userIndex = UserIndex::getInstance();
- $userIndex->write($module, $table, 'index.php');
- $ret[] = $userIndex->render();
- }
- if ( ($table_user == 1) && ($table_notifications == 1)){
- // User Notification Update File
- $userNotificationUpdate = UserNotificationUpdate::getInstance();
- $userNotificationUpdate->write($module, 'notification_update.php');
- $ret[] = $userNotificationUpdate->render();
- }
- // User Xoops Version File
- $userXoopsVersion = UserXoopsVersion::getInstance();
- $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
- $ret[] = $userXoopsVersion->render();
- }
+ var_dump($table_name);
+ }
+ // Creation of admin language file
+ if ( $table_admin == 1) {
+ // Language Admin File
+ $languageAdmin = LanguageAdmin::getInstance();
+ $languageAdmin->write($module, $table, $tables, 'admin.php');
+ $ret[] = $languageAdmin->render();
+ }
+ // Creation of blocks language file
+ if ( $table_blocks == 1) {
+ // Language Blocks File
+ $languageBlocks = LanguageBlocks::getInstance();
+ $languageBlocks->write($module, $table, $tables, $fields, 'blocks.php');
+ $ret[] = $languageBlocks->render();
+ }
+ // Creation of user language file
+ if ( $table_user == 1) {
+ // Language Main File
+ $languageMain = LanguageMain::getInstance();
+ $languageMain->write($module, $table, $tables, $fields, 'main.php');
+ $ret[] = $languageMain->render();
+ }
+ // Language Modinfo File
+ $languageModinfo = LanguageModinfo::getInstance();
+ $languageModinfo->write($module, $table, $tables, $fields, 'modinfo.php');
+ $ret[] = $languageModinfo->render();
+ // Creation of user files
+ if ( $table_user == 1) {
+ // Templates Footer File
+ $templatesFooter = TemplatesFooter::getInstance();
+ $templatesFooter->write($module, $table, 'footer.tpl');
+ $ret[] = $templatesFooter->render();
+ // Templates Header File
+ $templatesHeader = TemplatesHeader::getInstance();
+ $templatesHeader->write($module, $tables, 'header.tpl');
+ $ret[] = $templatesHeader->render();
+ // User Index File
+ $userIndex = UserIndex::getInstance();
+ $userIndex->write($module, $table, 'index.php');
+ $ret[] = $userIndex->render();
+ }
+ // Creation of admin files
+ if ( $table_admin == 1) {
+ // Admin Header File
+ $adminHeader = AdminHeader::getInstance();
+ $adminHeader->write($module, $table, $tables, 'header.php');
+ $ret[] = $adminHeader->render();
+ // Admin Index File
+ $adminIndex = AdminIndex::getInstance();
+ $adminIndex->write($module, $table, $tables, 'index.php');
+ $ret[] = $adminIndex->render();
+ // Admin Menu File
+ $adminMenu = AdminMenu::getInstance();
+ $adminMenu->write($module, $table, $tables, 'menu.php');
+ $ret[] = $adminMenu->render();
+ }
+ // Creation of admin permission file
+ if (( $table_permissions == 1) && ( $table_admin == 1 )) {
+ // Admin Permissions File
+ $adminPermissions = AdminPermissions::getInstance();
+ $adminPermissions->write($module, $tables, $fields, 'permissions.php');
+ $ret[] = $adminPermissions->render();
+ }
+ // Creation of notifications files
+ if ( $table_notifications == 1 ) {
+ // Include Notifications File
+ $includeNotifications = IncludeNotifications::getInstance();
+ $includeNotifications->write($module, $table, $fields, 'notifications.php');
+ $ret[] = $includeNotifications->render();
+ }
+ // Include Install File
+ $includeInstall = IncludeInstall::getInstance();
+ $includeInstall->write($module, $tables, $fields, 'install.php');
+ $ret[] = $includeInstall->render();
+ // Creation of sql file
+ if ( $table_name != null) {
+ // Sql File
+ $sqlFile = SqlFile::getInstance();
+ $sqlFile->write($module, $tables, $fields, 'mysql.sql');
+ $ret[] = $sqlFile->render();
+ }
+ // Creation of search file
+ if ( $table_search == 1) {
+ // Include Search File
+ $includeSearch = IncludeSearch::getInstance();
+ $includeSearch->write($module, $table, $fields, 'search.php');
+ $ret[] = $includeSearch->render();
+ }
+ // Creation of comments files
+ if ( $table->getVar('table_comments') == 1) {
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsNew($module, 'comment_new');
+ }
+ if ( ($table_user == 1) && ($table_notifications == 1)){
+ // User Notification Update File
+ $userNotificationUpdate = UserNotificationUpdate::getInstance();
+ $userNotificationUpdate->write($module, 'notification_update.php');
+ $ret[] = $userNotificationUpdate->render();
+ }
+ // Creation of admin files
+ if ( $table->getVar('table_admin') == 1 ) {
+ // Admin Aboutr File
+ $adminAbout = AdminAbout::getInstance();
+ $adminAbout->write($module, 'about.php');
+ $ret[] = $adminAbout->render();
+ // Admin Footer File
+ $adminFooter = AdminFooter::getInstance();
+ $adminFooter->write($module, 'footer.php');
+ $ret[] = $adminFooter->render();
+ }
+ // Creation of user files
+ if ( $table->getVar('table_user') == 1 ) {
+ // Templates Index File
+ $templatesIndex = TemplatesIndex::getInstance();
+ $templatesIndex->write($module, 'index.tpl');
+ $ret[] = $templatesIndex->render();
+ // User Footer File
+ $userFooter = UserFooter::getInstance();
+ $userFooter->write($module, 'footer.php');
+ $ret[] = $userFooter->render();
+ // User Header File
+ $userHeader = UserHeader::getInstance();
+ $userHeader->write($module, 'header.php');
+ $ret[] = $userHeader->render();
+ }
+ // Css Styles File
+ $cssStyles = CssStyles::getInstance($module, 'style.css');
+ $cssStyles->write($module, 'style.css');
+ $ret[] = $cssStyles->render();
+ // Include Common File
+ $includeCommon = IncludeCommon::getInstance();
+ $includeCommon->write($module, 'common.php');
+ $ret[] = $includeCommon->render();
+ // Include Functions File
+ $includeFunctions = IncludeFunctions::getInstance();
+ $includeFunctions->write($module, 'functions.php');
+ $ret[] = $includeFunctions->render();
// Docs Changelog File
$docsChangelog = DocsChangelog::getInstance();
$docsChangelog->write($module, 'changelog.txt');
- $ret[] = $docsChangelog->render();
+ $ret[] = $docsChangelog->render();
+ // Language Help File
+ $languageHelp = LanguageHelp::getInstance();
+ $languageHelp->write($module, 'help.html');
+ $ret[] = $languageHelp->render();
+ // Include Jquery File
+ $includeJquery = IncludeJquery::getInstance();
+ $includeJquery->write($module, 'functions.js');
+ $ret[] = $includeJquery->render();
+ // User Xoops Version File
+ $userXoopsVersion = UserXoopsVersion::getInstance();
+ $userXoopsVersion->write($module, $table, $tables, $fields, 'xoops_version.php');
+ $ret[] = $userXoopsVersion->render();
+ // Return Array
return $ret;
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -45,11 +45,11 @@
* @static function &getInstance
* @param null
*/
- public static function &getInstance($module, $table, $fields)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields);
+ $instance = new self();
}
return $instance;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -92,7 +92,8 @@
{
$table_name = $this->tables[$t]->getVar('table_name');
foreach (array_keys($this->fields) as $f)
- {
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
if ( ($f > 1) && ($this->tables[$t]->getVar('table_autoincrement') == 1) ) {
$field_element = $this->fields[$f]->getVar('field_element');
}
@@ -109,7 +110,7 @@
if ( $field_element == 9 )
{
$content .= <<<EOT
-\n// Making of "{$structure_fields[0]}" images folder
+\n// Making of "{$field_name}" images folder
\${$table_name} = \${$module_name}.'/images';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
@@ -117,7 +118,7 @@
copy(\$indexFile, \${$table_name}.'/index.html');
copy(\$blankFile, \${$table_name}.'/blank.gif');
-// Making of "{$structure_fields[0]}" images folder
+// Making of "{$field_name}" images folder
\${$table_name} = \${$module_name}.'/images/{$table_name}';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
@@ -127,14 +128,14 @@
EOT;
} elseif ( $field_element == 10 ) {
$content .= <<<EOT
-// Making of "{$structure_fields[0]}" files folder
+// Making of "{$field_name}" files folder
\${$table_name} = \${$module_name}.'/files';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
chmod(\${$table_name}, 0777);
copy(\$indexFile, \${$table_name}.'/index.html');
-// Making of "{$structure_fields[0]}" files folder
+// Making of "{$field_name}" files folder
\${$table_name} = \${$module_name}.'/files/{$table_name}';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -38,11 +38,11 @@
* @static function &getInstance
* @param null
*/
- public static function &getInstance($module, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $filename);
+ $instance = new self();
}
return $instance;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -124,7 +124,7 @@
*/
public function getDatabaseTables($module_name)
{
- $ret = null;
+ $ret = null;
foreach(array_keys($this->tables) as $t)
{
$table_mid = $this->tables[$t]->getVar('table_mid');
@@ -132,7 +132,11 @@
$table_name = $this->tables[$t]->getVar('table_name');
$table_autoincrement = $this->tables[$t]->getVar('table_autoincrement');
$nb_fields = $this->tables[$t]->getVar('table_nbfields');
- $ret .= $this->getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $nb_fields);
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ $ret .= $this->getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $fields_all, $nb_fields);
}
return $ret;
}
@@ -144,14 +148,9 @@
* @param boolean $table_autoincrement
* @param integer $nb_fields
*/
- public function getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $nb_fields)
+ public function getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $fields_all, $nb_fields)
{
- $ret = null; $j = 1; $comma = array();
- $criteria_fields = new CriteriaCompo();
- $criteria_fields->add(new Criteria('field_mid', $table_mid));
- $criteria_fields->add(new Criteria('field_tid', $table_id));
- $fields_all = $this->tdmcreate->getHandler('fields')->getAll($criteria_fields);
- unset($criteria_fields);
+ $ret = null; $j = 1; $comma = array();
foreach(array_keys($fields_all) as $f)
{
// Creation of database table
@@ -187,11 +186,8 @@
$default = "DEFAULT '{$field_default}'";
break;
case 'DATE':
- $type = $field_type;
- $default = "DEFAULT '{$field_default}'";
- break;
case 'DATETIME':
- case 'TIMESTAMP':
+ case 'TIMESTAMP':
$type = $field_type;
$default = "DEFAULT '{$field_default}'";
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -39,6 +39,10 @@
*/
private $tables = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param null
*/
@@ -63,10 +67,11 @@
* @param mixed $table
* @param string $filename
*/
- public function write($module, $table, $fields, $filename) {
+ public function write($module, $table, $tables, $fields, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->table = $table;
+ $this->tables = $tables;
$this->fields = $fields;
}
/*
|