|
From: <txm...@us...> - 2014-06-24 22:36:23
|
Revision: 12645
http://sourceforge.net/p/xoops/svn/12645
Author: txmodxoops
Date: 2014-06-24 22:36:12 +0000 (Tue, 24 Jun 2014)
Log Message:
-----------
- solved issues for modules without tables
- fixed bugs
- still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
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-24 21:35:40 UTC (rev 12644)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-24 22:36:12 UTC (rev 12645)
@@ -89,6 +89,7 @@
$tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria_tables);
unset($criteria_tables);
//
+ $table = null;
foreach (array_keys($tables) as $t)
{
$table_id = $tables[$t]->getVar('table_id');
@@ -113,18 +114,20 @@
$this->structure->makeDir($targetDirectory);
// Copied of index.html file in "root module" folder
$this->structure->copyFile('', $indexFile, 'index.html');
- if ( $table->getVar('table_admin') == 1) {
- // Creation of "admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
+ if (is_object($table)) {
+ if ( $table->getVar('table_admin') == 1) {
+ // Creation of "admin" folder and index.html file
+ $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
+ }
+ if ( $table->getVar('table_blocks') == 1) {
+ // Creation of "blocks" folder and index.html file
+ $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
+ }
+ if ( $table->getVar('table_name') != null) {
+ // Creation of "class" folder and index.html file
+ $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
+ }
}
- if ( $table->getVar('table_blocks') == 1) {
- // Creation of "blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
- }
- if ( $table->getVar('table_name') != null) {
- // Creation of "class" folder and index.html file
- $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
- }
// Creation of "assets" folder and index.html file
$this->structure->makeDirAndCopyFile('assets', $indexFile, 'index.html');
// Creation of "css" folder and index.html file
@@ -164,22 +167,24 @@
$this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language'], $indexFile, 'index.html');
// Creation of "language/local_language/help" folder and index.html file
$this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/help', $indexFile, 'index.html');
- if (( $table->getVar('table_user') == 1) || ( $table->getVar('table_admin') == 1 )) {
- // Creation of "templates" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
+ if (is_object($table)) {
+ if (( $table->getVar('table_user') == 1) || ( $table->getVar('table_admin') == 1 )) {
+ // Creation of "templates" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
+ }
+ if ( $table->getVar('table_admin') == 1 ) {
+ // Creation of "templates/admin" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
+ }
+ if ( $table->getVar('table_blocks') == 1 ) {
+ // Creation of "templates/blocks" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
+ }
+ if ( $table->getVar('table_name') != null ) {
+ // Creation of "sql" folder and index.html file
+ $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
+ }
}
- if ( $table->getVar('table_admin') == 1 ) {
- // Creation of "templates/admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
- }
- if ( $table->getVar('table_blocks') == 1 ) {
- // Creation of "templates/blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
- }
- if ( $table->getVar('table_name') != null ) {
- // Creation of "sql" folder and index.html file
- $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
- }
}
/*
@@ -199,6 +204,7 @@
unset($criteria_tables);
$ret = array();
//
+ $table = null;
foreach (array_keys($tables) as $t)
{
$table_mid = $tables[$t]->getVar('table_mid');
@@ -261,151 +267,153 @@
/*var_dump($table_name); */
}
// Creation of blocks language file
- if ( $table->getVar('table_blocks') == 1) {
- // Language Blocks File
- $languageBlocks = LanguageBlocks::getInstance();
- $languageBlocks->write($module, $tables, 'blocks.php');
- $ret[] = $languageBlocks->render();
- }
- // Language Modinfo File
- $languageModinfo = LanguageModinfo::getInstance();
- $languageModinfo->write($module, $table, $tables, 'modinfo.php');
- $ret[] = $languageModinfo->render();
- // Creation of admin files
- if ( $table->getVar('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, $tables, 'index.php');
- $ret[] = $adminIndex->render();
- // Admin Menu File
- $adminMenu = AdminMenu::getInstance();
- $adminMenu->write($module, $tables, 'menu.php');
- $ret[] = $adminMenu->render();
- // Creation of admin permission file
- if (( $table->getVar('table_permissions') == 1)) {
- // Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance();
- $adminPermissions->write($module, $tables, 'permissions.php');
- $ret[] = $adminPermissions->render();
+ if (is_object($table)) {
+ if ( $table->getVar('table_blocks') == 1) {
+ // Language Blocks File
+ $languageBlocks = LanguageBlocks::getInstance();
+ $languageBlocks->write($module, $tables, 'blocks.php');
+ $ret[] = $languageBlocks->render();
+ }
+ // Language Modinfo File
+ $languageModinfo = LanguageModinfo::getInstance();
+ $languageModinfo->write($module, $table, $tables, 'modinfo.php');
+ $ret[] = $languageModinfo->render();
+ // Creation of admin files
+ if ( $table->getVar('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, $tables, 'index.php');
+ $ret[] = $adminIndex->render();
+ // Admin Menu File
+ $adminMenu = AdminMenu::getInstance();
+ $adminMenu->write($module, $tables, 'menu.php');
+ $ret[] = $adminMenu->render();
+ // Creation of admin permission file
+ if (( $table->getVar('table_permissions') == 1)) {
+ // Admin Permissions File
+ $adminPermissions = AdminPermissions::getInstance();
+ $adminPermissions->write($module, $tables, 'permissions.php');
+ $ret[] = $adminPermissions->render();
+ }
+ // 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();
+ // Language Admin File
+ $languageAdmin = LanguageAdmin::getInstance();
+ $languageAdmin->write($module, $tables, 'admin.php');
+ $ret[] = $languageAdmin->render();
+ // Templates Index File
+ $adminTemplatesAbout = TemplatesAdminAbout::getInstance();
+ $adminTemplatesAbout->write($module, $stl_mod_name.'_about.tpl');
+ $ret[] = $adminTemplatesAbout->render();
+ // Templates Index File
+ $adminTemplatesIndex = TemplatesAdminIndex::getInstance();
+ $adminTemplatesIndex->write($module, $stl_mod_name.'_index.tpl');
+ $ret[] = $adminTemplatesIndex->render();
+ // Templates Footer File
+ $adminTemplatesFooter = TemplatesAdminFooter::getInstance();
+ $adminTemplatesFooter->write($module, $stl_mod_name.'_footer.tpl');
+ $ret[] = $adminTemplatesFooter->render();
+ // Templates Header File
+ $adminTemplatesHeader = TemplatesAdminHeader::getInstance();
+ $adminTemplatesHeader->write($module, $stl_mod_name.'_header.tpl');
+ $ret[] = $adminTemplatesHeader->render();
+ }
+ // Creation of notifications files
+ if ( $table->getVar('table_notifications') == 1 ) {
+ // Include Notifications File
+ $includeNotifications = IncludeNotifications::getInstance();
+ $includeNotifications->write($module, $table, 'notifications.php');
+ $ret[] = $includeNotifications->render();
}
- // 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();
- // Language Admin File
- $languageAdmin = LanguageAdmin::getInstance();
- $languageAdmin->write($module, $tables, 'admin.php');
- $ret[] = $languageAdmin->render();
- // Templates Index File
- $adminTemplatesAbout = TemplatesAdminAbout::getInstance();
- $adminTemplatesAbout->write($module, $stl_mod_name.'_about.tpl');
- $ret[] = $adminTemplatesAbout->render();
- // Templates Index File
- $adminTemplatesIndex = TemplatesAdminIndex::getInstance();
- $adminTemplatesIndex->write($module, $stl_mod_name.'_index.tpl');
- $ret[] = $adminTemplatesIndex->render();
- // Templates Footer File
- $adminTemplatesFooter = TemplatesAdminFooter::getInstance();
- $adminTemplatesFooter->write($module, $stl_mod_name.'_footer.tpl');
- $ret[] = $adminTemplatesFooter->render();
- // Templates Header File
- $adminTemplatesHeader = TemplatesAdminHeader::getInstance();
- $adminTemplatesHeader->write($module, $stl_mod_name.'_header.tpl');
- $ret[] = $adminTemplatesHeader->render();
- }
- // Creation of notifications files
- if ( $table->getVar('table_notifications') == 1 ) {
- // Include Notifications File
- $includeNotifications = IncludeNotifications::getInstance();
- $includeNotifications->write($module, $table, 'notifications.php');
- $ret[] = $includeNotifications->render();
- }
- // Include Install File
- $includeInstall = IncludeInstall::getInstance();
- $includeInstall->write($module, $tables, 'install.php');
- $ret[] = $includeInstall->render();
- // Creation of sql file
- if ( $table->getVar('table_name') != null) {
- // Sql File
- $sqlFile = SqlFile::getInstance();
- $sqlFile->write($module, $tables, 'mysql.sql');
- $ret[] = $sqlFile->render();
- }
- // Creation of search file
- if ( $table->getVar('table_search') == 1) {
- // Include Search File
- $includeSearch = IncludeSearch::getInstance();
- $includeSearch->write($module, $table, '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);
- $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_edit');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table);
- $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_delete');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table);
- $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_post');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table);
- $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_reply');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table);
- $ret[] = $includeComments->renderCommentsNew($module, 'comment_new');
- }
- // Creation of user files
- if ( ($table->getVar('table_user') == 1)) {
- // Templates Index File
- $userTemplatesIndex = TemplatesUserIndex::getInstance();
- $userTemplatesIndex->write($module, $stl_mod_name.'_index.tpl');
- $ret[] = $userTemplatesIndex->render();
- // Templates Footer File
- $userTemplatesFooter = TemplatesUserFooter::getInstance();
- $userTemplatesFooter->write($module, $table, $stl_mod_name.'_footer.tpl');
- $ret[] = $userTemplatesFooter->render();
- // Templates Header File
- $userTemplatesHeader = TemplatesUserHeader::getInstance();
- $userTemplatesHeader->write($module, $tables, $stl_mod_name.'_header.tpl');
- $ret[] = $userTemplatesHeader->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 Notification Update File
- if ( ($table->getVar('table_notifications') == 1 )) {
- $userNotificationUpdate = UserNotificationUpdate::getInstance();
- $userNotificationUpdate->write($module, 'notification_update.php');
- $ret[] = $userNotificationUpdate->render();
- }
- // User Index File
- $userIndex = UserIndex::getInstance();
- $userIndex->write($module, 'index.php');
- $ret[] = $userIndex->render();
- // Language Main File
- $languageMain = LanguageMain::getInstance();
- $languageMain->write($module, $table, $tables, 'main.php');
- $ret[] = $languageMain->render();
- }
+ // Include Install File
+ $includeInstall = IncludeInstall::getInstance();
+ $includeInstall->write($module, $tables, 'install.php');
+ $ret[] = $includeInstall->render();
+ // Creation of sql file
+ if ( $table->getVar('table_name') != null) {
+ // Sql File
+ $sqlFile = SqlFile::getInstance();
+ $sqlFile->write($module, $tables, 'mysql.sql');
+ $ret[] = $sqlFile->render();
+ }
+ // Creation of search file
+ if ( $table->getVar('table_search') == 1) {
+ // Include Search File
+ $includeSearch = IncludeSearch::getInstance();
+ $includeSearch->write($module, $table, '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);
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_edit');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table);
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_delete');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table);
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_post');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table);
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_reply');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table);
+ $ret[] = $includeComments->renderCommentsNew($module, 'comment_new');
+ }
+ // Creation of user files
+ if ( ($table->getVar('table_user') == 1)) {
+ // Templates Index File
+ $userTemplatesIndex = TemplatesUserIndex::getInstance();
+ $userTemplatesIndex->write($module, $stl_mod_name.'_index.tpl');
+ $ret[] = $userTemplatesIndex->render();
+ // Templates Footer File
+ $userTemplatesFooter = TemplatesUserFooter::getInstance();
+ $userTemplatesFooter->write($module, $table, $stl_mod_name.'_footer.tpl');
+ $ret[] = $userTemplatesFooter->render();
+ // Templates Header File
+ $userTemplatesHeader = TemplatesUserHeader::getInstance();
+ $userTemplatesHeader->write($module, $tables, $stl_mod_name.'_header.tpl');
+ $ret[] = $userTemplatesHeader->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 Notification Update File
+ if ( ($table->getVar('table_notifications') == 1 )) {
+ $userNotificationUpdate = UserNotificationUpdate::getInstance();
+ $userNotificationUpdate->write($module, 'notification_update.php');
+ $ret[] = $userNotificationUpdate->render();
+ }
+ // User Index File
+ $userIndex = UserIndex::getInstance();
+ $userIndex->write($module, 'index.php');
+ $ret[] = $userIndex->render();
+ // Language Main File
+ $languageMain = LanguageMain::getInstance();
+ $languageMain->write($module, $table, $tables, 'main.php');
+ $ret[] = $languageMain->render();
+ }
+ }
// Class Helper File
$classHelper = ClassHelper::getInstance();
$classHelper->write($module, 'helper.php');
@@ -422,7 +430,7 @@
$includeFunctions = IncludeFunctions::getInstance();
$includeFunctions->write($module, 'functions.php');
$ret[] = $includeFunctions->render();
- // Docs Changelog File
+ // Docs Changelog File
$docsChangelog = DocsChangelog::getInstance();
$docsChangelog->write($module, 'changelog.txt');
$ret[] = $docsChangelog->render();
@@ -433,7 +441,7 @@
// Include Jquery File
$includeJquery = IncludeJquery::getInstance();
$includeJquery->write($module, 'functions.js');
- $ret[] = $includeJquery->render();
+ $ret[] = $includeJquery->render();
// User Xoops Version File
$userXoopsVersion = UserXoopsVersion::getInstance();
$userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
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-24 21:35:40 UTC (rev 12644)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-24 22:36:12 UTC (rev 12645)
@@ -645,30 +645,32 @@
$module_name = $module->getVar('mod_name');
$language = $this->getLanguage($module_name, 'MI');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getXoopsVersionHeader($module, $table, $language);
- $content .= $this->getXoopsVersionMySQL($module_name, $table);
- if ($table->getVar('table_search') == 1) {
- $content .= $this->getXoopsVersionSearch($module);
+ $content .= $this->getXoopsVersionHeader($module, $table, $language);
+ if (is_object($table)) {
+ $content .= $this->getXoopsVersionMySQL($module_name, $table);
+ if ($table->getVar('table_search') == 1) {
+ $content .= $this->getXoopsVersionSearch($module);
+ }
+ if ($table->getVar('table_comments') == 1) {
+ $content .= $this->getXoopsVersionComments($module);
+ }
+ if($table->getVar('table_admin') == 1) {
+ $content .= $this->getXoopsVersionTemplatesAdmin($module_name);
+ }
+ if($table->getVar('table_user') == 1) {
+ $content .= $this->getXoopsVersionTemplatesUser($module_name);
+ }
+ if ($table->getVar('table_submenu') == 1) {
+ $content .= $this->getXoopsVersionSubmenu($language);
+ }
+ if ($table->getVar('table_blocks') == 1) {
+ $content .= $this->getXoopsVersionBlocks($module_name, $language);
+ }
+ $content .= $this->getXoopsVersionConfig($module, $table, $language);
+ if ($table->getVar('table_notifications') == 1) {
+ $content .= $this->getXoopsVersionNotifications($module, $language, $filename);
+ }
}
- if ($table->getVar('table_comments') == 1) {
- $content .= $this->getXoopsVersionComments($module);
- }
- if($table->getVar('table_admin') == 1) {
- $content .= $this->getXoopsVersionTemplatesAdmin($module_name);
- }
- if($table->getVar('table_user') == 1) {
- $content .= $this->getXoopsVersionTemplatesUser($module_name);
- }
- if ($table->getVar('table_submenu') == 1) {
- $content .= $this->getXoopsVersionSubmenu($language);
- }
- if ($table->getVar('table_blocks') == 1) {
- $content .= $this->getXoopsVersionBlocks($module_name, $language);
- }
- $content .= $this->getXoopsVersionConfig($module, $table, $language);
- if ($table->getVar('table_notifications') == 1) {
- $content .= $this->getXoopsVersionNotifications($module, $language, $filename);
- }
$this->tdmcfile->create($module_name, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-06-24 21:35:40 UTC (rev 12644)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-06-24 22:36:12 UTC (rev 12645)
@@ -166,7 +166,7 @@
$this_image = $this->getVar('mod_image');
$mod_image = $this_image ? $this_image : 'empty.png';
- $uploadirectory = 'uploads/'.$GLOBALS['xoopsModule']->dirname().'/images/modules';
+ $uploadirectory = 'uploads/'.$GLOBALS['xoopsModule']->dirname().'/images/repository';
$imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULE_IMAGE, '<br />');
$imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './' . strtolower($uploadirectory) . '/');
$imageselect= new XoopsFormSelect($imgpath, 'mod_image', $mod_image);
|