Skip to content

Commit 296d673

Browse files
committed
fixed problem for modules without user pages
1 parent ff4a6a4 commit 296d673

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

class/Files/Language/LanguageAdmin.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,27 @@ public function write($module, $table, $tables, $filename)
9393
*/
9494
public function getLanguageAdminIndex($language, $tables)
9595
{
96+
$thereare = '';
97+
$tableUser = 0;
98+
foreach (\array_keys($tables) as $t) {
99+
if (1 == (int)$tables[$t]->getVar('table_user')) {
100+
$tableUser = 1;
101+
}
102+
$tableName = $tables[$t]->getVar('table_name');
103+
$stuTableName = \mb_strtoupper($tableName);
104+
$stlTableName = \mb_strtolower($tableName);
105+
$thereare .= $this->ld->getDefine($language, "THEREARE_{$stuTableName}", "There are <span class='bold'>%s</span> {$stlTableName} in the database", true);
106+
}
96107
$ret = $this->ld->getBlankLine();
97108
$ret .= $this->pc->getPhpCodeIncludeDir('__DIR__','common', true);
98-
$ret .= $this->pc->getPhpCodeIncludeDir('__DIR__','main', true);
109+
if ($tableUser) {
110+
$ret .= $this->pc->getPhpCodeIncludeDir('__DIR__', 'main', true);
111+
}
99112
$ret .= $this->ld->getBlankLine();
100113
$ret .= $this->ld->getAboveHeadDefines('Admin Index');
101114
$ret .= $this->ld->getDefine($language, 'STATISTICS', 'Statistics');
102115
$ret .= $this->ld->getAboveDefines('There are');
103-
foreach (\array_keys($tables) as $t) {
104-
$tableName = $tables[$t]->getVar('table_name');
105-
$stuTableName = \mb_strtoupper($tableName);
106-
$stlTableName = \mb_strtolower($tableName);
107-
$ret .= $this->ld->getDefine($language, "THEREARE_{$stuTableName}", "There are <span class='bold'>%s</span> {$stlTableName} in the database", true);
108-
}
116+
$ret .= $thereare;
109117

110118
return $ret;
111119
}

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- allow pdf creation for multiple tables (goffy)
2323
- changed pdf output template based (goffy)
2424
- fixed bugs in print output (goffy)
25+
- fixed problem for modules without user pages (goffy)
2526

2627
<h5>3.04 Alpha 1 [2020-06-12]</h5> Dev: XOOPS 2.5.11, PHP 7.4.5
2728
<hr>

0 commit comments

Comments
 (0)