|
From: <txm...@us...> - 2014-06-22 13:04:01
|
Revision: 12633
http://sourceforge.net/p/xoops/svn/12633
Author: txmodxoops
Date: 2014-06-22 13:03:57 +0000 (Sun, 22 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
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-22 12:26:45 UTC (rev 12632)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-22 13:03:57 UTC (rev 12633)
@@ -76,7 +76,7 @@
public function getMenu($language, $tables) {
$menu = 1;
$ret = <<<EOT
-// Menu
+// Admin Menu
define('{$language}ADMENU{$menu}', "Dashboard");\n
EOT;
@@ -115,6 +115,29 @@
return $ret;
}
/*
+ * @public function getSubmenu
+ * @param string $language
+ * @param array $tables
+ */
+ public function getSubmenu($language, $tables) {
+ $ret = <<<EOT
+// Blocks\n
+EOT;
+ $i = 1;
+ foreach (array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+ if ( $tables[$t]->getVar('table_submenu') == 1 ) {
+ $ret .= <<<EOT
+define('{$language}SMNAME{$i}', "{$table_name}");\n
+EOT;
+ }
+ $i++;
+ }
+ unset($i);
+ return $ret;
+ }
+ /*
* @public function getBlocks
* @param string $language
* @param array $tables
@@ -259,21 +282,20 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getMain($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);
- }
+ $content .= $this->getUser($language);
+ $content .= $this->getMenu($language, $tables);
+ $content .= $this->getBlocks($language, $tables);
+ if ( $table->getVar('table_submenu') == 1 ) {
+ $content .= $this->getSubmenu($language, $tables);
}
+ $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();
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-22 12:26:45 UTC (rev 12632)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-22 13:03:57 UTC (rev 12633)
@@ -301,6 +301,32 @@
return $ret;
}
/*
+ * @private function getXoopsVersionSubmenu
+ * @param string $language
+ */
+ private function getXoopsVersionSubmenu($language)
+ {
+ $ret = <<<EOT
+// Submenu list\n
+EOT;
+ $tables = $this->getTables();
+ $i = 1;
+ foreach (array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+ if ( $tables[$t]->getVar('table_submenu') == 1 ) {
+ $ret .= <<<EOT
+// Sub {$table_name}
+\$modversion['sub'][{$i}]['name'] = {$language}SMNAME{$i};
+\$modversion['sub'][{$i}]['url'] = "{$table_name}.php";\n
+EOT;
+ }
+ $i++;
+ }
+ unset($i);
+ return $ret;
+ }
+ /*
* @private function getXoopsVersionBlocks
* @param string $module_name
* @param string $language
@@ -633,6 +659,9 @@
if($table->getVar('table_user') == 1) {
$content .= $this->getXoopsVersionTemplatesUser($module_name);
}
+ if ($table->getVar('table_submenu') == 1) {
+ $content .= $this->getXoopsVersionSubmenu($language);
+ }
if ($table->getVar('table_blocks') == 1) {
$content .= $this->getXoopsVersionBlocks($module_name, $language);
}
|