Skip to content

Commit a0f72bc

Browse files
committed
- fixed bug in creation of header.php
1 parent 362de56 commit a0f72bc

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

class/Files/User/UserHeader.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ public function write($module, $table, $tables, $filename)
9797
private function getUserHeader($moduleDirname)
9898
{
9999
$stuModuleDirname = \mb_strtoupper($moduleDirname);
100-
$table = $this->getTable();
101100
$tables = $this->getTables();
102101
$language = $this->getLanguage($moduleDirname, 'MA');
103102

@@ -106,16 +105,24 @@ private function getUserHeader($moduleDirname)
106105
$ret .= $this->xc->getXcEqualsOperator('$moduleDirName', '\basename(__DIR__)');
107106
$ret .= $this->uxc->getUserBreadcrumbsHeaderFile($moduleDirname, $language);
108107
$ret .= $this->xc->getXcHelperGetInstance($moduleDirname);
108+
$permissions = 0;
109+
$ratings = 0;
109110
if (\is_array($tables)) {
110111
foreach (\array_keys($tables) as $i) {
111112
$tableName = $tables[$i]->getVar('table_name');
112113
$ret .= $this->xc->getXcHandlerLine($tableName);
114+
if (1 == $tables[$i]->getVar('table_permissions')) {
115+
$permissions = 1;
116+
}
117+
if (1 == $tables[$i]->getVar('table_rate')) {
118+
$ratings = 1;
119+
}
113120
}
114121
}
115-
if (1 == $table->getVar('table_permissions')) {
122+
if (1 == $permissions) {
116123
$ret .= $this->xc->getXcHandlerLine('permissions');
117124
}
118-
if (1 == $table->getVar('table_rate')) {
125+
if (1 == $ratings) {
119126
$ret .= $this->xc->getXcHandlerLine('ratings');
120127
}
121128
$ret .= $this->pc->getPhpCodeCommentLine();

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- added check for sql creation (goffy)
1616
- delete fields if table is deleted (goffy)
1717
- delete fields, tables, morefiles when deleting module (goffy)
18+
- fixed bug in creation of header.php (goffy)
1819

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

0 commit comments

Comments
 (0)