|
From: <txm...@us...> - 2014-05-20 18:20:27
|
Revision: 12541
http://sourceforge.net/p/xoops/svn/12541
Author: txmodxoops
Date: 2014-05-20 18:20:21 +0000 (Tue, 20 May 2014)
Log Message:
-----------
Modified Paths:
--------------
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/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/sql_files.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/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
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 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -66,7 +66,7 @@
echo \$adminMenu->renderAbout('$module_donations', false);
include 'footer.php';
EOT;
- $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, '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/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -70,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', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, '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/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -129,7 +129,7 @@
xoops_cp_header();
\$adminMenu = new ModuleAdmin();
EOT;
- $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, '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/admin_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -29,6 +29,10 @@
/*
* @var string
*/
+ private $table = null;
+ /*
+ * @var string
+ */
private $tables = null;
/*
* @public function constructor
@@ -101,7 +105,7 @@
echo \$adminMenu->renderIndex();
include_once 'footer.php';
EOT;
- $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, '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/admin_menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -117,7 +117,7 @@
EOT;
unset( $menu );
- $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, '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/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -27,16 +27,41 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $tables = null;
+ /*
* @public function constructor
* @param string $module
+ * @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $filename) {
+ public function __construct($module, $table, $tables, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$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 getAdminPagesHeader
@@ -45,7 +70,7 @@
*/
public function getAdminPagesHeader($mod_name, $table_name) {
- $ret .= <<<EOT
+ $ret = <<<EOT
\ninclude_once 'header.php';
//It recovered the value of argument op in URL$
\$op = {$mod_name}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
@@ -64,7 +89,7 @@
*/
public function getAdminPagesList($table_name, $language) {
$stu_table_name = strtoupper($table_name);
- $ret .= <<<EOT
+ $ret = <<<EOT
case 'list':
default:
\$limit = xoops_getModuleOption('adminpager');
@@ -98,7 +123,7 @@
*/
public function getAdminPagesNew($table_name, $language) {
$stu_table_name = strtoupper($table_name);
- $ret .= <<<EOT
+ $ret = <<<EOT
case 'new':
\$adminMenu->addItemButton({$language}_{$stu_table_name}_LIST, '{$table_name}.php', 'list');
echo \$adminMenu->renderButton();
@@ -118,7 +143,7 @@
*/
public function getAdminPagesSave($table_name, $language) {
$stu_table_name = strtoupper($table_name);
- $ret .= <<<EOT
+ $ret = <<<EOT
case 'save':
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('{$table_name}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
@@ -172,7 +197,7 @@
*/
public function getAdminPagesEdit($table_name, $language) {
$stu_table_name = strtoupper($table_name);
- $ret .= <<<EOT
+ $ret = <<<EOT
case 'edit':
\$adminMenu->addItemButton({$language}_ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
\$adminMenu->addItemButton({$language}_{$stu_table_name}_LIST, '{$table_name}.php', 'list');
@@ -192,7 +217,7 @@
*/
public function getAdminPagesDelete($table_name, $language) {
- $ret .= <<<EOT
+ $ret = <<<EOT
case 'delete':
\${$table_name}_obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
if (isset(\$_REQUEST['ok']) && \$_REQUEST['ok'] == 1) {
@@ -217,7 +242,7 @@
* @param null
*/
public function getAdminPagesFooter() {
- $ret .= <<<EOT
+ $ret = <<<EOT
\n}
include_once 'footer.php';
EOT;
@@ -231,7 +256,7 @@
public function render() {
$module = $this->getModule();
$module_name = $module->getVar('mod_name');
- $table_name = $this->getTable()->getVar('table_name');
+ $table_name = $this->table->getVar('table_name');
$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
@@ -241,7 +266,8 @@
$content .= $this->getAdminPagesEdit($table_name, $language);
$content .= $this->getAdminPagesDelete($table_name, $language);
$content .= $this->getAdminPagesFooter();
- $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ //
+ $this->tdmcfile->create($module_name, '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/admin_permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -31,10 +31,6 @@
*/
private $table = null;
/*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param string $module
* @param string $filename
@@ -68,7 +64,8 @@
$module = $this->getModule();
//$table = $this->getTable();
$filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
$language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
@@ -157,7 +154,7 @@
unset(\$permform);
include_once 'footer.php';
EOT;
- $this->tdmcfile->create($module_name, 'admin', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, '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/admin_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -62,7 +62,7 @@
$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);
+ $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 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -160,56 +160,89 @@
*/
public function createBuildingFiles( $module, $table, $tables, $fields )
{
+ $upload_module_folder = $this->upload_path.'/'.strtolower($module->geVar('mod_name'));
$ret = array();
// Admin Aboutr File
- $adminAbout = AdminAbout::getInstance($module, 'about.php');
+ $adminAbout = AdminAbout::getInstance($module, 'about.php');
+ $ret[] = $adminAbout->render();
// Admin Footer File
- $adminFooter = AdminFooter::getInstance($module, 'footer.php');
+ $adminFooter = AdminFooter::getInstance($module, 'footer.php');
+ $ret[] = $adminFooter->render();
// Admin Header File
$adminHeader = AdminHeader::getInstance($module, $table, $tables, 'header.php');
+ $ret[] = $adminHeader->render();
// Admin Index File
$adminIndex = AdminIndex::getInstance($module, $table, $tables, 'index.php');
+ $ret[] = $adminIndex->render();
// Admin Menu File
$adminMenu = AdminMenu::getInstance($module, $table, $tables, 'menu.php');
+ $ret[] = $adminMenu->render();
// Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance($module, $tables, 'permissions.php');
+ $adminPermissions = AdminPermissions::getInstance($module, $table, 'permissions.php');
+ $ret[] = $adminPermissions->render();
// Admin Styles File
- $cssStyles = CssStyles::getInstance($module, 'style.css');
+ $cssStyles = CssStyles::getInstance($module, 'style.css');
+ $ret[] = $cssStyles->render();
// Admin Common File
$includeCommon = IncludeCommon::getInstance($module, 'common.php');
+ $ret[] = $includeCommon->render();
// Admin Functions File
$includeFunctions = IncludeFunctions::getInstance($module, 'functions.php');
+ $ret[] = $includeFunctions->render();
// Admin Install File
$includeInstall = IncludeInstall::getInstance($module, $table, $tables, $fields, 'install.php');
-
- $ret[] = $adminAbout->render();
- $ret[] = $adminFooter->render();
- $ret[] = $adminHeader->render();
- $ret[] = $adminIndex->render();
- $ret[] = $adminMenu->render();
- $ret[] = $cssStyles->render();
- $ret[] = $includeCommon->render();
- $ret[] = $includeFunctions->render();
- $ret[] = $includeInstall->render();
-
+ $ret[] = $includeInstall->render();
+ // Multiple files
foreach (array_keys($tables) as $i)
{
$table_name = $tables[$i]->getVar('table_name');
// Admin Pages File
- $adminPages = AdminPages::getInstance($module, $tables, $table_name.'.php');
+ $adminPages = AdminPages::getInstance($module, $table, $tables, $table_name.'.php');
$ret[] = $adminPages->render();
// Admin Templates File
$adminTemplates = AdminTemplates::getInstance($module, $tables, $table_name.'.tpl');
$ret[] = $adminTemplates->render();
+ // Blocks Files
+ $blocksFiles = BlocksFiles::getInstance($module, $table, $table_name.'.php');
+ $ret[] = $blocksFiles->render();
+ // Blocks Templates File
+ $blocksTemplates = BlocksTemplates::getInstance($module, $table, $tables, $table_name.'.tpl');
+ $ret[] = $blocksTemplates->render();
+ // Class Files
+ $classFiles = ClassFiles::getInstance($module, $table, $tables, $table_name.'.php');
+ $ret[] = $classFiles->render();
// User Pages File
$userPages = UserPages::getInstance($module, $table, $table_name.'.php');
$ret[] = $userPages->render();
// User Templates File
$userTemplates = UserTemplates::getInstance($module, $table, $table_name.'.tpl');
$ret[] = $userTemplates->render();
- }
- //$ret[] = array($admin_pages, $admin_templates, $user_pages, $user_templates);
-
+ }
+ // Language Admin File
+ $languageAdmin = LanguageAdmin::getInstance($module, $table, $tables, 'admin.php');
+ $ret[] = $languageAdmin->render();
+ // Language Blocks File
+ $languageBlocks = LanguageBlocks::getInstance($module, $table, $tables, 'blocks.php');
+ $ret[] = $languageBlocks->render();
+ // Language Main File
+ $languageMain = LanguageMain::getInstance($module, $table, $tables, 'main.php');
+ $ret[] = $languageMain->render();
+ // Language Modinfo File
+ $languageModinfo = LanguageModinfo::getInstance($module, $table, $tables, 'modinfo.php');
+ $ret[] = $languageModinfo->render();
+ // User Footer File
+ $userFooter = UserFooter::getInstance($module, 'footer.php');
+ $ret[] = $userFooter->render();
+ // User Header File
+ $userHeader = UserHeader::getInstance($module, 'header.php');
+ $ret[] = $userHeader->render();
+ // User Index File
+ $userIndex = UserIndex::getInstance($module, $table, 'index.php');
+ $ret[] = $userIndex->render();
+ // User Xoops Version File
+ $userXoopsVersion = UserXoopsVersion::getInstance($module, $table, $tables, 'xoops_version.php');
+ $ret[] = $userXoopsVersion->render();
+
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-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: blocks_files.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: blocks_pages.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
@@ -27,16 +27,22 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = 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, $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
@@ -55,7 +61,11 @@
* @public function getBlocksShow
* @param null
*/
- public function getBlocksShow() {
+ public function getBlocksShow($module) {
+ $mod_name = $module->getVar('mod_name');
+ $mod_name_lowercase = strtolower($mod_name);
+ $table_name = $this->table->getVar('table_name');
+ $table_fieldname = $this->table->getVar('table_fieldname');
$ret = <<<EOT
\ninclude_once XOOPS_ROOT_PATH.'/modules/{$mod_name}/include/functions.php';
function b_{$mod_name_lowercase}_{$table_name}_show(\$options)
@@ -74,7 +84,7 @@
array_shift(\$options);
array_shift(\$options);
EOT;
- if ( $table_category == 1 ) {
+ if ( $this->table->getVar('table_category') == 1 ) {
$ret .= <<<EOT
\n\tif (!(count(\$options) == 1 && \$options[0] == 0)) {
\$criteria->add(new Criteria('{$table_fieldname}_category', {$mod_name}_block_addCatSelect(\$options), 'IN'));
@@ -122,7 +132,12 @@
* @public function getBlocksEdit
* @param null
*/
- public function getBlocksEdit() {
+ public function getBlocksEdit($module) {
+ $mod_name = $module->getVar('mod_name');
+ $mod_name_lowercase = strtolower($mod_name);
+ $table_name = $this->table->getVar('table_name');
+ $table_fieldname = $this->table->getVar('table_fieldname');
+
for ($i = 0; $i < $nb_fields; $i++)
{
$structure_fields = explode(':', $fields[$i]);
@@ -141,7 +156,7 @@
{
EOT;
- if ( $table_category == 1 ) {
+ if ( $this->table->getVar('table_category') == 1 ) {
$ret .=<<<EOT
\ninclude_once XOOPS_ROOT_PATH.'/modules/{$mod_name}/class/category.php';
@@ -191,9 +206,9 @@
$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'MB');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getBlocksShow();
- $content .= $this->getBlocksEdit();
- $this->tdmcfile->create($module_name, 'blocks', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $content .= $this->getBlocksShow($module);
+ $content .= $this->getBlocksEdit($module);
+ $this->tdmcfile->create($module_name, 'blocks', $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/blocks_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -20,30 +20,55 @@
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-class Blocks extends HtmlSmartyCodes
+class BlocksTemplates extends HtmlSmartyCodes
{
/*
* @var string
*/
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 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() {
$module = $this->getModule();
- $table_nbfields = $this->getTable()->getVar('table_nbfields');
+ $table_nbfields = $this->table->getVar('table_nbfields');
$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
@@ -79,7 +104,7 @@
<{/foreach}>
</table>
EOT;
- $this->tdmcfile->create($module_name, 'templates/', 'blocks', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'templates/blocks', $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/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -27,17 +27,27 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $tables = null;
+ /*
* @public function constructor
* @param string $module
- * @param string $table
- * @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 string $module
@@ -150,9 +160,9 @@
* @public function getHeadFunctionForm
* @param string $form
*/
- public function getHeadFunctionForm($elements_form) {
- $lang_add = $this->getLanguage('AM', 'ADD');
- $lang_edit = $this->getLanguage('AM', 'EDIT');
+ public function getHeadFunctionForm($module_name, $elements_form) {
+ $lang_add = $this->getLanguage($module_name, 'AM', 'ADD');
+ $lang_edit = $this->getLanguage($module_name, 'AM', 'EDIT');
$ret = <<<EOT
/*
* Get form
@@ -180,9 +190,9 @@
* @param string $fpif
*/
public function getPermissionsInFunctionForm($module_name, $fpif) {
- $perm_approve = $this->getLanguage('AM', 'PERMISSIONS_APPROVE');
- $perm_submit = $this->getLanguage('AM', 'PERMISSIONS_SUBMIT');
- $perm_view = $this->getLanguage('AM', 'PERMISSIONS_VIEW');
+ $perm_approve = $this->getLanguage($module_name, 'AM', 'PERMISSIONS_APPROVE');
+ $perm_submit = $this->getLanguage($module_name, 'AM', 'PERMISSIONS_SUBMIT');
+ $perm_view = $this->getLanguage($module_name, 'AM', 'PERMISSIONS_VIEW');
$ret = <<<EOT
\n//permissions
\$member_handler = & xoops_gethandler ( 'member' );
@@ -267,11 +277,11 @@
*/
public function render() {
$module = $this->getModule();
- $table_nbfields = $this->getTable()->getVar('table_nbfields');
- $table_name = $this->getTable()->getVar('table_name');
+ $table_nbfields = $this->table->getVar('table_nbfields');
+ $table_name = $this->table->getVar('table_name');
$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('module_name');
+ $module_name = $module->getVar('mod_name');
$initvar = $this->getInitVars($table_nbfields, $fields);
for ($i = 0; $i < $table_nbfields; $i++) {
@@ -284,13 +294,16 @@
}
}
+ $elements_form = '/* ------------- Here function elements form ---------------------- */';
+
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getHeadClass($module_name, $table_name, $initvar);
- $content .= $this->getHeadFunctionForm(/*$form*/);
+ $content .= $this->getHeadFunctionForm($module_name, $elements_form);
$content .= $this->getPermissionsInFunctionForm($module_name, $fpif);
$content .= $this->getFootFunctionForm();
$content .= $this->getClassHandler($module_name, $table_name, $fpif, $fpmf);
- $this->tdmcfile->create($module_name, 'class', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+
+ $this->tdmcfile->create($module_name, 'class', $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/css_styles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -88,7 +88,7 @@
list-style-image: none;
}
EOT;
- $this->tdmcfile->create($module_name, 'css', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'css', $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/docs_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -152,7 +152,7 @@
$content = $this->getLangDiffFile($mod_version);
break;
}
- $this->tdmcfile->create($module_name, 'docs', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'docs', $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/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -22,7 +22,8 @@
require_once 'abstractfiles.php';
xoops_load('XoopsFile');
-class TDMCreateFile extends TDMCreateAbstractFiles {
+class TDMCreateFile extends TDMCreateAbstractFiles
+{
/*
* @var string
*/
@@ -71,19 +72,12 @@
private $upload_path = null;
/**
- * "subdir" attribute of the files
+ * "folder_name" attribute of the files
*
* @var string
*/
- private $subdir = null;
-
- /**
- * "subsubdir" attribute of the files
- *
- * @var string
- */
- private $subsubdir = null;
-
+ private $folder_name = null;
+
/*
* @var string
*/
@@ -133,7 +127,7 @@
* @param mixed $notcreated
* @param string $mode
*/
- public function create($module_name, $subdir = null, $subsubdir = null, $filename, $content = '', $created = false, $notcreated = false, $mode = 'w+') {
+ public function create($module_name, $subdir = null, $filename, $content = '', $created = false, $notcreated = false, $mode = 'w+') {
$this->setFileName($filename);
$this->created = $created;
$this->notcreated = $notcreated;
@@ -142,12 +136,9 @@
if(!empty($content) && is_string($content)) {
$this->setContent($content);
}
- if((!empty($subdir) || $subdir != null) && is_string($subdir)) {
+ if(isset($subdir) && is_string($subdir)) {
$this->setSubDir($subdir);
- }
- if((!empty($subsubdir) || $subsubdir != null) && is_string($subsubdir)) {
- $this->setSubSubDir($subsubdir);
- }
+ }
}
/*
@@ -168,10 +159,10 @@
/*
* @private function setModulePath
- * @param string $folder_name
+ * @param string $module_name
*/
- private function setModulePath($folder_name) {
- $this->upload_path = TDMC_UPLOAD_MODULES_PATH . DIRECTORY_SEPARATOR . $folder_name;
+ private function setModulePath($module_name) {
+ $this->upload_path = TDMC_UPLOAD_MODULES_PATH . DIRECTORY_SEPARATOR . strtolower($module_name);
}
/*
@@ -196,23 +187,7 @@
*/
private function getSubDir() {
return $this->subdir;
- }
-
- /*
- * @private function setSubSubDir
- * @param string $subdir
- */
- private function setSubSubDir($subsubdir) {
- $this->subsubdir = $subsubdir;
- }
-
- /*
- * @private function getSubSubDir
- * @param null
- */
- private function getSubSubDir() {
- return $this->subsubdir;
- }
+ }
/**
* public function setFileName
@@ -237,8 +212,8 @@
*/
public function setTable($table) {
$this->table = null;
- if (is_object($table)) {
- $this->table = $table;
+ if (!is_object($table) || ($table instanceof TDMCreateTables)) {
+ $this->table = (object)$table;
} elseif (is_array($table)) {
$this->table[] = $table;
}
@@ -251,12 +226,12 @@
public function getTable() {
if (is_array($this->table)) {
$ret = array();
- foreach ($this->table as $table) {
+ foreach($this->table as $table) {
$ret[] = $table;
}
return $ret;
- } else {
- return $this->table;
+ } elseif (!is_object($this->table)) {
+ return (object)$this->table;
}
}
@@ -266,7 +241,7 @@
*/
public function setFields($fields) {
$this->fields = null;
- if (is_object($fields)) {
+ if (is_object($fields) || ($fields instanceof TDMCreateFields)) {
$this->fields = $fields;
} elseif (is_array($fields)) {
$this->fields[] = $fields;
@@ -340,17 +315,15 @@
* @public function getUploadPath
* @param null
*/
- private function getUploadPath() {
+ private function getUploadPath() {
if ($this->getSubDir() != null) {
$ret = $this->getModulePath() . DIRECTORY_SEPARATOR . $this->getSubDir();
- } elseif ($this->getSubSubDir() != null) {
- $ret = $this->getModulePath() . DIRECTORY_SEPARATOR . $this->getSubDir() . DIRECTORY_SEPARATOR . $this->getSubSubDir();
- } else {
+ } else {
$ret = $this->getModulePath();
- }
+ }
return $ret;
- }
-
+ }
+
/*
* @private function getCreated
* @param null
@@ -390,7 +363,7 @@
* @param string $postfix
*/
public function getLanguage($module_name, $prefix = '', $postfix = '') {
- $lang = '_' . $prefix . '_' . $module_name;
+ $lang = '_' . $prefix . '_' . strtoupper($module_name);
if(!empty($postfix) || $postfix != '_') {
$ret = $lang . '_' . $postfix;
} elseif($postfix == '_') {
@@ -457,13 +430,14 @@
$created = $this->getCreated();
$notcreated = $this->getNotCreated();
$folder_name = $this->getFolderName();
+ $mode = $this->getMode();
$ret = '';
if(!$this->xoopsfile->__construct($path, true)) {
// Force to create file if not exist
- if($this->xoopsfile->open($this->getMode(), true)) {
+ if($this->xoopsfile->open($mode, true)) {
if($this->xoopsfile->writable($path)) {
// Integration of the content in the file
- if (!$this->xoopsfile->write($this->getContent(), $this->getMode(), true)) {
+ if (!$this->xoopsfile->write($this->getContent(), $mode, true)) {
$ret .= sprintf($notcreated, $filename, $folder_name);
//$GLOBALS['xoopsTpl']->assign('notcreated', sprintf($notcreated, $filename, $folder_name));
exit();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -117,7 +117,7 @@
$content .= $this->getCommentsNew($module_name, $table_name, $fpmf);
break;
}
- $this->tdmcfile->create($module_name, 'include', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'include', $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/include_common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -98,7 +98,7 @@
$filename = $this->getFileName();
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getCommonCode($module);
- $this->tdmcfile->create($module_name, 'include', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'include', $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/include_functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -154,7 +154,7 @@
$content .= $this->getFunctionMetaKeywords($module_name);
$content .= $this->getFunctionMetaDescription($module_name);
- $this->tdmcfile->create($module_name, 'include', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'include', $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/include_install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -146,7 +146,7 @@
}
}
}
- $this->tdmcfile->create($module_name, 'include', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'include', $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/include_jquery.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -59,7 +59,7 @@
$path = $this->getLocalPath();
$module = $this->getModule();
$filename = $this->getFileName();
- $module_name = $module->getVar('module_name');
+ $module_name = $module->getVar('mod_name');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
$(document).ready(function(){
@@ -69,7 +69,7 @@
$( ".toolbar" ).css("color","#000").buttonset();
});
EOT;
- $this->tdmcfile->create($module_name, 'include', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'include', $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/include_notifications.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -63,7 +63,7 @@
$table = $this->getTable();
$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('module_name');
+ $module_name = $module->getVar('mod_name');
$table_name = $table->getVar('table_name');
$table_nbfields = $table->getVar('table_nbfields');
@@ -128,7 +128,7 @@
}
}
EOT;
- $this->tdmcfile->create($module_name, 'include', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'include', $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/include_search.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -62,7 +62,7 @@
$table = $this->getTable();
$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('module_name');
+ $module_name = $module->getVar('mod_name');
$table_name = $table->getVar('table_name');
$table_fieldname = $table->getVar('table_fieldname');
$table_nbfields = $table->getVar('table_nbfields');
@@ -122,7 +122,7 @@
\$i++;
}
EOT;
- $this->tdmcfile->create($module_name, 'include', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'include', $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/language_admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -27,52 +27,61 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $tables = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $filename) {
+ public function __construct($module, $table, $tables, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$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, $filename)
+ public static function &getInstance($module, $table, $tables, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table, $tables, $filename);
}
return $instance;
- }
+ }
/*
* @public function render
* @param null
*/
public function render() {
$module = $this->getModule();
- $table = $this->getTable();
+ //$table = $this->getTable();
$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('module_name');
- $table_name = $table->getVar('table_name');
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
$language = $this->getLanguage($module_name, 'AM', '_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n//Admin
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');
$stu_table_name = strtoupper($table_name);
$table_name_nohs = strtolower($table_name);
$content .= <<<EOT
@@ -80,7 +89,7 @@
\ndefine('{$language}{$stu_table_name}', "There are <span class='bold'>%s</span> {$table_name_nohs} in the database");
EOT;
}
- $this->tdmcfile->create($module_name, 'language', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'language/'.$GLOBALS['xoopsConfig']['language'], $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/language_blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -27,15 +27,26 @@
*/
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
@@ -43,28 +54,28 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $table, $tables, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table, $tables, $filename);
}
return $instance;
- }
+ }
/*
* @public function render
* @param null
*/
public function render() {
$module = $this->getModule();
- $table = $this->getTable();
+ //$table = $this->getTable();
$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('module_name');
- $table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- $table_nbfields = $table->getVar('table_nbfields');
- $language = $this->getLanguage('MB', '_');
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
+ $table_fieldname = $this->table->getVar('table_fieldname');
+ $table_nbfields = $this->table->getVar('table_nbfields');
+ $language = $this->getLanguage($module_name, 'MB', '_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n// Main
@@ -73,12 +84,12 @@
define('{$language}CATTODISPLAY', "Categories to Display");
define('{$language}ALLCAT', "All Categories");
EOT;
- foreach (array_keys($table) as $i)
+ foreach (array_keys($this->tables) as $i)
{
- $table_name = $table[$i]->getVar('table_name');
- $table_fieldname = $table[$i]->getVar('table_fieldname');
+ $table_name = $this->tables[$i]->getVar('table_name');
+ $table_fieldname = $this->tables[$i]->getVar('table_fieldname');
$nb_caracteres = strlen($table_fieldname);
- $table_blocks = $table[$i]->getVar('table_blocks');
+ $table_blocks = $this->tables[$i]->getVar('table_blocks');
$language1 = $language.strtoupper($table_fieldname);
for($j = 0; $j < $table_nbfields; $j++)
@@ -95,7 +106,7 @@
EOT;
}
}
- $this->tdmcfile->create($module_name, 'language', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'language/'.$GLOBALS['xoopsConfig']['language'], $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/language_main.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -27,27 +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 string $module
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $table, $tables, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table, $tables, $filename);
}
return $instance;
}
@@ -57,28 +68,30 @@
*/
public function render() {
$module = $this->getModule();
- $table = $this->getTable();
+ //$table = $this->getTable();
$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('module_name');
- $table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- $table_nbfields = $table->getVar('table_nbfields');
+ $module_name = $module->getVar('mod_name');
+ $module_description = $module->getVar('mod_description');
+ $table_name = $this->table->getVar('table_name');
+ $table_fieldname = $this->table->getVar('table_fieldname');
+ $table_nbfields = $this->table->getVar('table_nbfields');
+ $ucf_mod_name = ucfirst($module_name);
$language = $this->getLanguage($module_name, 'MI', '_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n// Main
define('{$language}INDEX', "Home");
define('{$language}TITLE', "{$ucf_mod_name}");
-define('{$language}DESC', "{$mod_desc}");
-define('{$language}INDEX_DESC', "{$mod_desc}");
+define('{$language}DESC', "{$module_description}");
+define('{$language}INDEX_DESC', "{$module_description}");
EOT;
- foreach (array_keys($table) as $i)
+ foreach (array_keys($this->tables) as $i)
{
- $table_name = $table[$i]->getVar('table_name');
- $table_fieldname = $table[$i]->getVar('table_fieldname');
+ $table_name = $this->tables[$i]->getVar('table_name');
+ $table_fieldname = $this->tables[$i]->getVar('table_fieldname');
$nb_caracteres = strlen($table_fieldname);
- $table_blocks = $table[$i]->getVar('table_blocks');
+ $table_blocks = $this->tables[$i]->getVar('table_blocks');
$lng_stu_table_name = $language.strtoupper($table_name);
$ucf_table_name = UcFirstAndToLower($table_name);
$content .= <<<EOT
@@ -102,7 +115,7 @@
$content .= <<<EOT
\n\ndefine('{$language}ADMIN', "Admin");
EOT;
- $this->tdmcfile->create($module_name, 'language', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'language/'.$GLOBALS['xoopsConfig']['language'], $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/language_modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-05-19 23:23:50 UTC (rev 12540)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-05-20 18:20:21 UTC (rev 12541)
@@ -26,17 +26,27 @@
* @var string
*/
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
@@ -44,11 +54,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $table, $tables, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table, $tables, $filename);
}
return $instance;
}
@@ -58,34 +68,37 @@
*/
public function render() {
$module = $this->getModule();
- $table = $this->getTable();
+ //$table = $this->getTable();
$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('module_name');
- $table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- $table_nbfields = $table->getVar('table_nbfields');
- $table_notifications = $table->getVar('table_notifications');
+ $module_name = $module->getVar('mod_name');
+ $module_description = $module->getVar('mod_description');
+ $table_name = $this->table->getVar('table_name');
+ $table_fieldname = $this->table->getVar('table_fieldname');
+ $table_nbfields = $this->table->getVar('table_nbfields');
+ $table_image = $this->table->getVar('table_image');
+ $table_permissions = $this->table->getVar('table_permissions');
$language = $this->getLanguage($module_name, 'MI', '_');
$content = $this->getHeaderFilesComments($module, $filename);
+ $menu = 1;
$content .= <<<EOT
\n// Admin
define('{$language}NAME', "{$module_name}");
-define('{$language}DESC', "{$description}");
+define('{$language}DESC', "{$module_description}");
//Menu
define('{$language}ADMENU{$menu}', "Home");
EOT;
- $menu = 0;
- foreach (array_keys($table) as $i)
+
+ foreach (array_keys($this->tables) as $i)
{
$menu++;
- $table_name = str_replace('_', ' ', $table[$i]->getVar('table_name'));
+ $table_name = str_replace('_', ' ', $this->tables[$i]->getVar('table_name'));
$table_name = ucfirst($table_name);
$content .= <<<EOT
\ndefine('{$language}ADMENU{$menu}', "{$table_name}");
EOT;
}
- if ( $this->permissions != false ) {
+ if ( $table_permissions != 0 ) {
$menu++;
$content .= <<<EOT
\ndefine('{$language}ADMENU{$menu}', "Permissions");
@@ -99,12 +112,12 @@
$content .= <<<EOT
\n//Blocks
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');
$language1 = $language.strtoupper($table_name).'';
$table_name = str_replace("_", " ", ucfirst($table_name));
- if ( $table[$i]->getVar('table_blocks') == 1 ) {
+ if ( $this->tables[$i]->getVar('table_blocks') == 1 ) {
$content .= <<<EOT
\ndefine('{$language1}BLOCK', "{$table_name} block");
EOT;
@@ -144,7 +157,7 @@
define('{$language}FBCOMMENTS', "Facebook comments");
define('{$language}FBCOMMENTS_DESC', "Allow Facebook comments in the form");
EOT;
- if ( $table_notifications == 1 )
+ if ( $this->table->getVar('table_notifications') == 1 )
{
$content .= <<<EOT
\n// Notifications
@@ -188,7 +201,7 @@
define('{$language}FILE_APPROVE_NOTIFY_SUBJECT', "Allow Facebook comments in the form");
EOT;
}
- if ( $this->permissions != false ) {
+ if ( $table_permissions != 0 ) {
$content .= <<<EOT
\n// Permissions Groups
define('{$language}GROUPS', "Groups access");
@@ -197,7 +210,7 @@
define('{$language}ADMINGROUPS_DESC', "Which groups have access to tools and permissions page");
EOT;
}
- $this->tdmcfile->create($module_name, 'language', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CR...
[truncated message content] |