|
From: <txm...@us...> - 2014-06-14 13:04:14
|
Revision: 12591
http://sourceforge.net/p/xoops/svn/12591
Author: txmodxoops
Date: 2014-06-14 13:04:04 +0000 (Sat, 14 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- 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/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/index.html
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-06-14 12:33:34 UTC (rev 12590)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-06-14 13:04:04 UTC (rev 12591)
@@ -19,16 +19,16 @@
* @version $Id: building.php 12258 2014-01-02 09:33:29Z timgno $
*/
include 'header.php';
-$op = TDMCreateRequest::getString('op', 'default');
-$mid = TDMCreateRequest::getInt('mod_id');
-$repObj = $tdmcreate->getHandler('modules')->get( $mid );
+$op = XoopsRequest::getString('op', 'default');
+$mid = XoopsRequest::getInt('mod_id');
+$moduleObj = $tdmcreate->getHandler('modules')->get( $mid );
//
switch ($op) {
case 'build':
$template_main = 'building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Get var module name
- $mod_name = $repObj->getVar('mod_name');
+ $mod_name = $moduleObj->getVar('mod_name');
// Directories for copy from to
$from_dir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($mod_name);
$to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_name);
@@ -48,7 +48,7 @@
$handler->getPath( TDMC_PATH );
$handler->getUploadPath( TDMC_UPLOAD_PATH );
// Creation of the structure of folders and files
- $base_architecture = $handler->createBaseFoldersFiles( $repObj );
+ $base_architecture = $handler->createBaseFoldersFiles( $moduleObj );
if($base_architecture !== false) {
$GLOBALS['xoopsTpl']->assign('base_architecture', true);
} else {
@@ -56,7 +56,7 @@
}
// Get files
$build = array();
- $files = $handler->createFilesToBuilding( $repObj );
+ $files = $handler->createFilesToBuilding( $moduleObj );
foreach($files as $file) {
if($file) {
$build['list'] = $file;
@@ -67,7 +67,7 @@
// 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 ( $repObj->getVar('mod_inroot_copy') == 1 ) {
+ if ( $moduleObj->getVar('mod_inroot_copy') == 1 ) {
TDMCreate_copyr($from_dir, $to_dir);
}
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-06-14 12:33:34 UTC (rev 12590)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-06-14 13:04:04 UTC (rev 12591)
@@ -22,8 +22,6 @@
// Recovered value of arguments op in the URL $
$op = XoopsRequest::getString('op', 'list');
// Get fields Variables
-/*$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');*/
-$table_name = TDMCreate_CleanVars($_REQUEST, 'table_name', '', 'string');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
@@ -37,12 +35,12 @@
$field_tid = $session_field->getSession('table_id');
$field_mid = $session_field->getSession('table_mid');
$field_name = $session_field->getSession('table_fieldname');
-$field_numb = $session_field->getSession('table_nbfields');
-$field_tid = $_SESSION['table_id'];
-$field_mid = $_SESSION['table_mid'];
-$table_name = $_SESSION['table_name'];
-$field_name = $_SESSION['table_fieldname'];
-$field_numb = $_SESSION['table_nbfields'];*/
+$field_numb = $session_field->getSession('table_nbfields');*/
+if(isset($_SESSION['session_table_name']) && !empty($_SESSION['session_table_name'])) {
+ $table_name = $_SESSION['session_table_name'];
+} else {
+ $table_name = TDMCreate_CleanVars($_REQUEST, 'table_name', '', 'string');
+}
//
switch ($op)
{
@@ -146,7 +144,12 @@
}
} else {
$GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
- }
+ }
+ var_dump($table_name);
+ var_dump($field_mid);
+ var_dump($field_tid);
+ var_dump($field_numb);
+ var_dump($field_name);
break;
case 'new':
@@ -163,6 +166,7 @@
$form = $fieldsObj->getForm($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
+ var_dump($table_name);
var_dump($field_mid);
var_dump($field_tid);
var_dump($field_numb);
@@ -226,14 +230,16 @@
}
//
if ($fieldsObj->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', $fieldsObj->getHtmlErrors());
$form = $fieldsObj->getForm($field_mid, $field_tid, $field_numb);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
+
+ unset($_SESSION['session_table_name']);
break;
case 'edit':
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-06-14 12:33:34 UTC (rev 12590)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-06-14 13:04:04 UTC (rev 12591)
@@ -206,8 +206,10 @@
} else {
redirect_header('tables.php', 5, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name']));
}
- }
+ }
+ $_SESSION['session_table_name'] = $_POST['table_name'];
+
$GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-14 12:33:34 UTC (rev 12590)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-14 13:04:04 UTC (rev 12591)
@@ -162,7 +162,7 @@
* @param object $form
* @param string $type
* @param integer $id
- * @param string $field_name
+ * @param string $f_name
* @param string $field_mid
* @param string $field_tid
* @param object $field
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-14 12:33:34 UTC (rev 12590)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-14 13:04:04 UTC (rev 12591)
@@ -109,18 +109,20 @@
$this->structure->makeDir($targetDirectory);
// Copied of index.html file in "root module" folder
$this->structure->copyFile('', $indexFile, 'index.html');
- if ( $table_admin == 1) {
- // Creation of "admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
+ if(is_object($tables)) {
+ if ( $table_admin == 1) {
+ // Creation of "admin" folder and index.html file
+ $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
+ }
+ if ( $table_blocks == 1) {
+ // Creation of "blocks" folder and index.html file
+ $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
+ }
+ if ( $table_name != null) {
+ // Creation of "class" folder and index.html file
+ $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
+ }
}
- if ( $table_blocks == 1) {
- // Creation of "blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
- }
- if ( $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
@@ -160,22 +162,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_user == 1) || ( $table_admin == 1 )) {
- // Creation of "templates" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
+ if(is_object($tables)) {
+ if (( $table_user == 1) || ( $table_admin == 1 )) {
+ // Creation of "templates" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
+ }
+ if ( $table_admin == 1 ) {
+ // Creation of "templates/admin" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
+ }
+ if ( $table_blocks == 1 ) {
+ // Creation of "templates/blocks" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
+ }
+ if ( $table_name != null ) {
+ // Creation of "sql" folder and index.html file
+ $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
+ }
}
- if ( $table_admin == 1 ) {
- // Creation of "templates/admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
- }
- if ( $table_blocks == 1 ) {
- // Creation of "templates/blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
- }
- if ( $table_name != null ) {
- // Creation of "sql" folder and index.html file
- $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
- }
}
/*
@@ -192,7 +196,7 @@
$tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria_tables);
unset($criteria_tables);
$ret = array();
- //
+ //
foreach (array_keys($tables) as $t)
{
$table_mid = $tables[$t]->getVar('table_mid');
@@ -250,136 +254,156 @@
}
/*var_dump($table_name); */
}
- // Creation of blocks language file
- if ( $table_blocks == 1) {
- // Language Blocks File
- $languageBlocks = LanguageBlocks::getInstance();
- $languageBlocks->write($module, $tables, 'blocks.php');
- $ret[] = $languageBlocks->render();
- }
+ if(is_object($tables)) {
+ // Creation of blocks language file
+ if ( $table_blocks == 1) {
+ // Language Blocks File
+ $languageBlocks = LanguageBlocks::getInstance();
+ $languageBlocks->write($module, $tables, 'blocks.php');
+ $ret[] = $languageBlocks->render();
+ }
+ }
+ if(is_object($tables)) {
+ // Language Modinfo File
+ $languageModinfo = LanguageModinfo::getInstance();
+ $languageModinfo->write($module, $table, $tables, 'modinfo.php');
+ $ret[] = $languageModinfo->render();
+ } else {
+ $table = null; $tables = array();
+ // Language Modinfo File
+ $languageModinfo = LanguageModinfo::getInstance();
+ $languageModinfo->write($module, $table, $tables, 'modinfo.php');
+ $ret[] = $languageModinfo->render();
+ }
// Language Modinfo File
$languageModinfo = LanguageModinfo::getInstance();
$languageModinfo->write($module, $table, $tables, 'modinfo.php');
- $ret[] = $languageModinfo->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, $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_permissions == 1)) {
- // Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance();
- $adminPermissions->write($module, $tables, 'permissions.php');
- $ret[] = $adminPermissions->render();
+ $ret[] = $languageModinfo->render();
+ if(is_object($tables)) {
+ // 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, $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_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();
+ }
+ // Creation of notifications files
+ if ( $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();
- }
- // Creation of notifications files
- if ( $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_name != null) {
- // Sql File
- $sqlFile = SqlFile::getInstance();
- $sqlFile->write($module, $tables, 'mysql.sql');
- $ret[] = $sqlFile->render();
+ if(is_object($tables)) {
+ // Creation of sql file
+ if ( $table_name != null) {
+ // Sql File
+ $sqlFile = SqlFile::getInstance();
+ $sqlFile->write($module, $tables, 'mysql.sql');
+ $ret[] = $sqlFile->render();
+ }
+ // Creation of search file
+ if ( $table_search == 1) {
+ // Include Search File
+ $includeSearch = IncludeSearch::getInstance();
+ $includeSearch->write($module, $table, 'search.php');
+ $ret[] = $includeSearch->render();
+ }
}
- // Creation of search file
- if ( $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');
+ if(is_object($tables)) {
+ 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_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();
+ // User Notification Update File
+ if ( ($table_notifications == 1 )){
+ $userNotificationUpdate = UserNotificationUpdate::getInstance();
+ $userNotificationUpdate->write($module, 'notification_update.php');
+ $ret[] = $userNotificationUpdate->render();
+ }
+ // 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, 'index.php');
+ $ret[] = $userIndex->render();
+ // Language Main File
+ $languageMain = LanguageMain::getInstance();
+ $languageMain->write($module, $table, $tables, 'main.php');
+ $ret[] = $languageMain->render();
+ }
}
- // Creation of user files
- if ( ($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();
- // User Notification Update File
- if ( ($table_notifications == 1 )){
- $userNotificationUpdate = UserNotificationUpdate::getInstance();
- $userNotificationUpdate->write($module, 'notification_update.php');
- $ret[] = $userNotificationUpdate->render();
- }
- // 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, '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');
@@ -408,10 +432,18 @@
$includeJquery = IncludeJquery::getInstance();
$includeJquery->write($module, 'functions.js');
$ret[] = $includeJquery->render();
- // User Xoops Version File
- $userXoopsVersion = UserXoopsVersion::getInstance();
- $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
- $ret[] = $userXoopsVersion->render();
+ if(is_object($tables)) {
+ // User Xoops Version File
+ $userXoopsVersion = UserXoopsVersion::getInstance();
+ $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
+ $ret[] = $userXoopsVersion->render();
+ } else {
+ $table = null; $tables = array();
+ // User Xoops Version File
+ $userXoopsVersion = UserXoopsVersion::getInstance();
+ $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
+ $ret[] = $userXoopsVersion->render();
+ }
// Return Array
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-14 12:33:34 UTC (rev 12590)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-14 13:04:04 UTC (rev 12591)
@@ -56,39 +56,37 @@
$this->setTables($tables);
}
/*
- * @public function render
- * @param null
+ * @public function getHead
+ * @param string $language
+ * @param string $module
*/
- public function render() {
- $module = $this->getModule();
- $table = $this->getTable();
- $tables = $this->getTables();
- $filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $module_description = $module->getVar('mod_description');
- $table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- $table_nbfields = $table->getVar('table_nbfields');
- $table_image = $table->getVar('table_image');
- $table_permissions = $table->getVar('table_permissions');
- $language = $this->getLanguage($module_name, 'MI');
- $content = $this->getHeaderFilesComments($module, $filename);
+ public function getHead($language, $module) {
+ $ret = <<<EOT
+// Head
+define('{$language}NAME', "{$module->getVar('module_name')}");
+define('{$language}DESC', "{$module->getVar('mod_description')}");\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getMenu
+ * @param string $language
+ * @param array $tables
+ */
+ public function getMenu($language, $tables) {
$menu = 1;
- $content .= <<<EOT
-\n// Admin
-define('{$language}NAME', "{$module_name}");
-define('{$language}DESC', "{$module_description}");
+ $ret = <<<EOT
//Menu
-define('{$language}ADMENU{$menu}', "Home");\n
+define('{$language}ADMENU{$menu}', "Dashboard");\n
EOT;
foreach (array_keys($tables) as $i)
{
$menu++;
- $table_name = str_replace('_', ' ', $tables[$i]->getVar('table_name'));
- $table_name = ucfirst($table_name);
+ $ucf_table_name = ucfirst(str_replace('_', ' ', $tables[$i]->getVar('table_name')));
+ $table_permissions = $tables[$i]->getVar('table_permissions');
$content .= <<<EOT
-define('{$language}ADMENU{$menu}', "{$table_name}");\n
+define('{$language}ADMENU{$menu}', "{$ucf_table_name}");\n
EOT;
}
if ( $table_permissions != 0 ) {
@@ -102,45 +100,77 @@
define('{$language}ADMENU{$menu}', "About");\n
EOT;
unset( $menu );
- $content .= <<<EOT
+ return $ret;
+ }
+ /*
+ * @public function getAdmin
+ * @param string $language
+ */
+ public function getAdmin($language) {
+ $ret = <<<EOT
+// Admin
+define('{$language}ADMINPAGER', "Admin pager");
+define('{$language}ADMINPAGER_DESC', "Admin per page list");\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getBlocks
+ * @param string $language
+ * @param array $tables
+ */
+ public function getBlocks($language, $tables) {
+ $ret = <<<EOT
//Blocks\n
EOT;
foreach (array_keys($tables) as $i)
{
$table_name = $tables[$i]->getVar('table_name');
- $language1 = $language.'_'.strtoupper($table_name).'';
+ $language1 = $language.'_'.strtoupper($table_name);
$table_name = str_replace("_", " ", ucfirst($table_name));
if ( $tables[$i]->getVar('table_blocks') == 1 ) {
- $content .= <<<EOT
+ $ret .= <<<EOT
define('{$language1}BLOCK', "{$table_name} block");\n
EOT;
}
}
- $content .= <<<EOT
+ return $ret;
+ }
+ /*
+ * @public function getUser
+ * @param string $language
+ */
+ public function getUser($language) {
+ $ret = <<<EOT
+// User
+define('{$language}USERPAGER', "User pager");
+define('{$language}USERPAGER_DESC', "User per page list");\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getConfig
+ * @param string $language
+ * @param string $table_image
+ */
+ public function getConfig($language, $table) {
+ $ret = <<<EOT
//Config
define('{$language}EDITOR', "Editor");
define('{$language}EDITOR_DESC', "Select the Editor to use");
define('{$language}KEYWORDS', "Keywords");
define('{$language}KEYWORDS_DESC', "Insert here the keywords (separate by comma)");\n
EOT;
- if ( $table_name != '' ) {
- $content .= <<<EOT
-define('{$language}ADMINPAGER', "Admin pager");
-define('{$language}ADMINPAGER_DESC', "Admin per page list");
-define('{$language}USERPAGER', "User pager");
-define('{$language}USERPAGER_DESC', "User per page list");\n
-EOT;
- }
- if ( $table_image != '' )
+ if ( $table->getVar('table_image') != '' )
{
- $content .= <<<EOT
+ $ret .= <<<EOT
define('{$language}MAXSIZE', "Max size");
define('{$language}MAXSIZE_DESC', "Set a number of max size uploads file in byte");
define('{$language}MIMETYPES', "Mime Types");
define('{$language}MIMETYPES_DESC', "Set the mime types selected");\n
EOT;
}
- $content .= <<<EOT
+ $ret .= <<<EOT
define('{$language}IDPAYPAL', "Paypal ID");
define('{$language}IDPAYPAL_DESC', "Insert here your PayPal ID for donactions.");
define('{$language}ADVERTISE', "Advertisement Code");
@@ -150,9 +180,15 @@
define('{$language}FBCOMMENTS', "Facebook comments");
define('{$language}FBCOMMENTS_DESC', "Allow Facebook comments in the form");\n
EOT;
- if ( $table->getVar('table_notifications') == 1 )
- {
- $content .= <<<EOT
+ return $ret;
+ }
+ /*
+ * @public function getNotifications
+ * @param string $language
+ * @param mixed $table
+ */
+ public function getNotifications($language) {
+ $ret = <<<EOT
// Notifications
define('{$language}GLOBAL_NOTIFY', "Allow Facebook comments in the form");
define('{$language}GLOBAL_NOTIFY_DESC', "Allow Facebook comments in the form");
@@ -193,16 +229,52 @@
define('{$language}FILE_APPROVE_NOTIFY_DESC', "Allow Facebook comments in the form");
define('{$language}FILE_APPROVE_NOTIFY_SUBJECT', "Allow Facebook comments in the form");\n
EOT;
- }
- if ( $table_permissions != 0 ) {
- $content .= <<<EOT
+ return $ret;
+ }
+ /*
+ * @public function getPermissions
+ * @param string $language
+ */
+ public function getPermissions($language) {
+ $ret = <<<EOT
// Permissions Groups
define('{$language}GROUPS', "Groups access");
define('{$language}GROUPS_DESC', "Select general access permission for groups.");
define('{$language}ADMINGROUPS', "Admin Group Permissions");
define('{$language}ADMINGROUPS_DESC', "Which groups have access to tools and permissions page");
EOT;
+ return $ret;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $table = $this->getTable();
+ $tables = $this->getTables();
+ $filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $language = $this->getLanguage($module_name, 'MI');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getHead($language, $module);
+ $content .= $this->getAdmin($language);
+ $content .= $this->getUser($language);
+ if(is_object($tables)) {
+ $content .= $this->getMenu($language, $tables);
+ $content .= $this->getBlocks($language, $tables);
+ }
+ if(is_object($table)) {
+ $content .= $this->getConfig($language, $table);
+ if ( $table->getVar('table_notifications') == 1 )
+ {
+ $content .= $this->getNotifications($language);
+ }
+ if ( $table->getVar('table_permissions') != 0 ) {
+ $content .= $this->getPermissions($language);
+ }
}
+ //
$this->tdmcfile->create($module_name, 'language/'.$GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/index.html 2014-06-14 13:04:04 UTC (rev 12591)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/index.html 2014-06-14 13:04:04 UTC (rev 12591)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/index.html 2014-06-14 13:04:04 UTC (rev 12591)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
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-14 12:33:34 UTC (rev 12590)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-14 13:04:04 UTC (rev 12591)
@@ -85,7 +85,7 @@
* @private function getXoopsVersionHeader
* @param string $language
*/
- private function getXoopsVersionHeader($module, $language)
+ private function getXoopsVersionHeader($module, $table, $language)
{
$date = date('D Y/m/d G:i:s');
$ret = <<<EOT
@@ -133,12 +133,19 @@
'module_website_url' => "{$module->getVar('mod_website_url')}",
'module_website_name' => "{$module->getVar('mod_website_name')}",
'release' => "{$module->getVar('mod_release')}",
- 'module_status' => "{$module->getVar('mod_status')}",\n
+ 'module_status' => "{$module->getVar('mod_status')}",
+ // Admin system menu
+ 'system_menu' => 1,\n
EOT;
- if ( $module->getVar('mod_admin') == 1 ) {
+ if(is_object($table)) {
+ $table_admin = $table->getVar('table_admin');
+ $table_user = $table->getVar('table_user');
+ } else {
+ $table_admin = null;
+ $table_user = null;
+ }
+ if ( $module->getVar('mod_admin') == 1 && $table_admin == 1 ) {
$ret .= <<<EOT
- // Admin system menu
- 'system_menu' => 1,
// Admin things
'hasAdmin' => 1,
'adminindex' => "admin/index.php",
@@ -152,7 +159,7 @@
'hasAdmin' => 0,\n
EOT;
}
- if ( $module->getVar('mod_user') == 1 ) {
+ if ( $module->getVar('mod_user') == 1 && $table_user == 1 ) {
$ret .= <<<EOT
// Menu
'hasMain' => 1,
@@ -174,9 +181,8 @@
* @private function getXoopsVersionMySQL
* @param string $module_name
*/
- private function getXoopsVersionMySQL($module_name)
+ private function getXoopsVersionMySQL($module_name, $table)
{
- $table = $this->getTable();
$table_name = $table->getVar('table_name');
$stl_mod_name = strtolower($module_name);
$j = 1;
@@ -271,10 +277,9 @@
* @param string $module_name
* @param string $language
*/
- private function getXoopsVersionBlocks($module_name, $language)
+ private function getXoopsVersionBlocks($module_name, $table, $language)
{
$stl_mod_name = strtolower($module_name);
- $tables = $this->getTables();
$ret = '';
$ret .= <<<EOT
\n//Blocks
@@ -303,11 +308,10 @@
* @param string $module_name
* @param string $language
*/
- private function getXoopsVersionConfig($module, $language)
+ private function getXoopsVersionConfig($module, $table, $language)
{
$module_name = $module->getVar('mod_name');
- $stl_mod_name = strtolower($module_name);
- $table = $this->getTable();
+ $stl_mod_name = strtolower($module_name);
$ret = <<<EOT
\n// Config
xoops_load('xoopseditorhandler');
@@ -589,23 +593,28 @@
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$language = $this->getLanguage($module_name, 'MI');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getXoopsVersionHeader($module, $language);
- $content .= $this->getXoopsVersionMySQL($module_name);
- if ($table->getVar('table_search') == 1) {
- $content .= $this->getXoopsVersionSearch($module);
+ $content = $this->getHeaderFilesComments($module, $filename);
+ if(is_object($table)) {
+ $content .= $this->getXoopsVersionHeader($module, $table, $language);
+ $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);
+ }
+ $content .= $this->getXoopsVersionTemplates($module_name);
+ if ($table->getVar('table_blocks') == 1) {
+ $content .= $this->getXoopsVersionBlocks($module_name, $table, $language);
+ }
+ $content .= $this->getXoopsVersionConfig($module, $table, $language);
+ if ($table->getVar('table_notifications') == 1) {
+ $content .= $this->getXoopsVersionNotifications($module, $language, $filename);
+ }
+ } else {
+ $table = null;
+ $content .= $this->getXoopsVersionHeader($module, $table, $language);
}
- if ($table->getVar('table_comments') == 1) {
- $content .= $this->getXoopsVersionComments($module);
- }
- $content .= $this->getXoopsVersionTemplates($module_name);
- if ($table->getVar('table_blocks') == 1) {
- $content .= $this->getXoopsVersionBlocks($module_name, $language);
- }
- $content .= $this->getXoopsVersionConfig($module, $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();
}
|