|
From: <txm...@us...> - 2014-05-19 23:23:54
|
Revision: 12540
http://sourceforge.net/p/xoops/svn/12540
Author: txmodxoops
Date: 2014-05-19 23:23:50 +0000 (Mon, 19 May 2014)
Log Message:
-----------
Fix bugs
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.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/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -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 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -182,8 +182,18 @@
// 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();
+
foreach (array_keys($tables) as $i)
- {
+ {
$table_name = $tables[$i]->getVar('table_name');
// Admin Pages File
$adminPages = AdminPages::getInstance($module, $tables, $table_name.'.php');
@@ -192,22 +202,14 @@
$adminTemplates = AdminTemplates::getInstance($module, $tables, $table_name.'.tpl');
$ret[] = $adminTemplates->render();
// User Pages File
- $userPages = UserPages::getInstance($module, $tables, $table_name.'.php');
+ $userPages = UserPages::getInstance($module, $table, $table_name.'.php');
$ret[] = $userPages->render();
// User Templates File
- $adminTemplates = AdminTemplates::getInstance($module, $tables, $table_name.'.tpl');
- $ret[] = $adminTemplates->render();
+ $userTemplates = UserTemplates::getInstance($module, $table, $table_name.'.tpl');
+ $ret[] = $userTemplates->render();
}
+ //$ret[] = array($admin_pages, $admin_templates, $user_pages, $user_templates);
- $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();
return $ret;
}
}
\ 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 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -146,7 +146,7 @@
$this->setSubDir($subdir);
}
if((!empty($subsubdir) || $subsubdir != null) && is_string($subsubdir)) {
- $this->setSubSubDir($subdir);
+ $this->setSubSubDir($subsubdir);
}
}
@@ -338,12 +338,12 @@
/*
* @public function getUploadPath
- * @param mixed $subdir
+ * @param null
*/
private function getUploadPath() {
if ($this->getSubDir() != null) {
$ret = $this->getModulePath() . DIRECTORY_SEPARATOR . $this->getSubDir();
- } elseif (strrpos($this->getSubDir(), '/') ) {
+ } elseif ($this->getSubSubDir() != null) {
$ret = $this->getModulePath() . DIRECTORY_SEPARATOR . $this->getSubDir() . DIRECTORY_SEPARATOR . $this->getSubSubDir();
} else {
$ret = $this->getModulePath();
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 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -65,7 +65,7 @@
$module_name = $module->getVar('module_name');
$table_name = $table->getVar('table_name');
- $language = $this->getLanguage('AM', '_');
+ $language = $this->getLanguage($module_name, 'AM', '_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n//Admin
@@ -80,7 +80,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 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -56,7 +56,6 @@
* @param null
*/
public function render() {
- $path = $this->getLocalPath('language');
$module = $this->getModule();
$table = $this->getTable();
$fields = $this->getFields();
@@ -96,7 +95,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 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -56,7 +56,6 @@
* @param null
*/
public function render() {
- $path = $this->getLocalPath('language');
$module = $this->getModule();
$table = $this->getTable();
$fields = $this->getFields();
@@ -65,7 +64,7 @@
$table_name = $table->getVar('table_name');
$table_fieldname = $table->getVar('table_fieldname');
$table_nbfields = $table->getVar('table_nbfields');
- $language = $this->getLanguage('MI', '_');
+ $language = $this->getLanguage($module_name, 'MI', '_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n// Main
@@ -80,7 +79,7 @@
$table_fieldname = $table[$i]->getVar('table_fieldname');
$nb_caracteres = strlen($table_fieldname);
$table_blocks = $table[$i]->getVar('table_blocks');
- $lng_stu_table_name = $language.'_'.strtoupper($table_name);
+ $lng_stu_table_name = $language.strtoupper($table_name);
$ucf_table_name = UcFirstAndToLower($table_name);
$content .= <<<EOT
\n\ndefine('{$lng_stu_table_name}', "{$ucf_table_name}");
@@ -103,7 +102,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 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -57,7 +57,6 @@
* @param null
*/
public function render() {
- $path = $this->getLocalPath('language');
$module = $this->getModule();
$table = $this->getTable();
$fields = $this->getFields();
@@ -67,7 +66,7 @@
$table_fieldname = $table->getVar('table_fieldname');
$table_nbfields = $table->getVar('table_nbfields');
$table_notifications = $table->getVar('table_notifications');
- $language = $this->getLanguage('MI', '_');
+ $language = $this->getLanguage($module_name, 'MI', '_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n// Admin
@@ -198,7 +197,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_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/user_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -27,6 +27,10 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
* @public function constructor
* @param string $module
* @param string $file_name
@@ -34,8 +38,10 @@
public function __construct($module, $table, $file_name) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$this->setTable($table);
$this->setFileName($file_name);
+ $this->table = $table;
+ //$this->tables = $tables;
}
/*
* @static function &getInstance
@@ -56,14 +62,13 @@
* @param null
*/
public function render() {
- $path = $this->getLocalPath();
$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_nbfields = $table->getVar('table_nbfields');
+ $table_name = $this->table->getVar('table_name');
+ $table_nbfields = $this->table->getVar('table_nbfields');
$stu_mod_name = strtoupper($module_name);
$language = $this->getLanguage($module_name, 'MA', '_');
$content = $this->getHeaderFilesComments($module, $filename);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -27,6 +27,10 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
* @public function constructor
* @param string $module
* @param string $file_name
@@ -34,8 +38,10 @@
public function __construct($module, $table, $file_name) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$this->setTable($table);
$this->setFileName($file_name);
+ $this->table = $table;
+ //$this->tables = $tables;
}
/*
* @static function &getInstance
@@ -57,13 +63,13 @@
*/
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_name = $this->table->getVar('table_name');
+ $table_fieldname = $this->table->getVar('table_fieldname');
+ $table_nbfields = $this->table->getVar('table_nbfields');
$stu_module_name = strtoupper($module_name);
$language = $this->getLanguage($module_name, 'MA', '_');
$content = $this->getHeaderFilesComments($module, $filename);
@@ -118,7 +124,7 @@
$content .= <<<EOT
<{include file="db:{$module_name}_footer.html"}>
EOT;
- $this->tdmcfile->create($module_name, null, null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'templates', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
|