Skip to content

Commit 2ab3056

Browse files
committed
fixed bug in block links
1 parent 25f9276 commit 2ab3056

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

class/Files/Blocks/BlocksFiles.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ private function getBlocksShow($moduleDirname, $tableName, $tableFieldname, $tab
9595
{
9696
$ucfTableName = \ucfirst($tableName);
9797
$critName = 'cr' . $ucfTableName;
98+
$stuModuleDirname = \mb_strtoupper($moduleDirname);
9899

99100
$ret = $this->pc->getPhpCodeCommentMultiLine(['Function' => 'show block', '@param $options' => '', '@return' => 'array']);
100101

@@ -252,6 +253,8 @@ private function getBlocksShow($moduleDirname, $tableName, $tableFieldname, $tab
252253

253254
$func .= $this->pc->getPhpCodeConditions("\count(\${$tableName}All)", ' > ', '0', $foreach, false, "\t");
254255
$func .= $this->pc->getPhpCodeBlankLine();
256+
$func .= $this->xc->getXcXoopsTplAssign("{$moduleDirname}_url", "\\{$stuModuleDirname}_URL", true ,"\t");
257+
$func .= $this->pc->getPhpCodeBlankLine();
255258
$func .= $this->getSimpleString('return $block;',"\t");
256259
$func .= $this->pc->getPhpCodeBlankLine();
257260

class/Files/Blocks/BlocksFilesSpotlight.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ private function getBlocksShow($moduleDirname, $tableName, $tablePermissions, $f
9696
{
9797
$ucfTableName = \ucfirst($tableName);
9898
$critName = 'cr' . $ucfTableName;
99+
$stuModuleDirname = \mb_strtoupper($moduleDirname);
99100

100101
$ret = $this->pc->getPhpCodeCommentMultiLine(['Function' => 'show block', '@param $options' => '', '@return' => 'array']);
101102

@@ -185,6 +186,8 @@ private function getBlocksShow($moduleDirname, $tableName, $tablePermissions, $f
185186

186187
$func .= $this->pc->getPhpCodeConditions("\count(\${$tableName}All)", ' > ', '0', $foreach, false, "\t");
187188
$func .= $this->pc->getPhpCodeBlankLine();
189+
$func .= $this->xc->getXcXoopsTplAssign("{$moduleDirname}_url", "\\{$stuModuleDirname}_URL", true ,"\t");
190+
$func .= $this->pc->getPhpCodeBlankLine();
188191
$func .= $this->getSimpleString('return $block;',"\t");
189192
$func .= $this->pc->getPhpCodeBlankLine();
190193

class/Files/Templates/Blocks/Defstyle/TemplatesBlocks.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ private function getTemplatesBlocksTableTbody($moduleDirname, $tableId, $tableMi
165165
break;
166166
case Constants::FIELD_ELE_SELECTSTATUS:
167167
case Constants::FIELD_ELE_RADIOYN:
168+
case Constants::FIELD_ELE_RADIO_ONOFFLINE:
168169
case Constants::FIELD_ELE_SELECTUSER:
169170
case Constants::FIELD_ELE_DATETIME:
170171
case Constants::FIELD_ELE_TEXTDATESELECT:
@@ -195,7 +196,8 @@ private function getTemplatesBlocksTableTbody($moduleDirname, $tableId, $tableMi
195196
// $td .= $this->hc->getHtmlTag('td', ['class' => 'center'], "\n" . $anchor . "\t\t\t", false, "\t\t\t");
196197
$double = $this->sc->getSmartyDoubleVar($tableSoleName, 'id');
197198
$lang = $this->sc->getSmartyConst($language, $stuTableSoleName . '_GOTO');
198-
$anchor = $this->hc->getHtmlAnchor($tableName . ".php?op=show&{$fieldId}=" . $double, $lang, $lang);
199+
$single = $this->sc->getSmartySingleVar($moduleDirname . '_url');
200+
$anchor = $this->hc->getHtmlAnchor($single . '/' . $tableName . ".php?op=show&{$fieldId}=" . $double, $lang, $lang);
199201
$td .= $this->hc->getHtmlTableData($anchor, 'center', '', "\t\t\t");
200202
$cycle = $this->sc->getSmartyNoSimbol('cycle values="odd, even"');
201203
$tr = $this->hc->getHtmlTableRow($td, $cycle, "\t\t");

class/Files/Templates/Blocks/Defstyle/TemplatesBlocksSpotlight.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ private function getTemplatesBlocksTableTbody($moduleDirname, $tableId, $tableMi
197197
// $td .= $this->hc->getHtmlTag('td', ['class' => 'center'], "\n" . $anchor . "\t\t\t", false, "\t\t\t");
198198
$double = $this->sc->getSmartyDoubleVar($tableSoleName, 'id');
199199
$lang = $this->sc->getSmartyConst($language, $stuTableSoleName . '_GOTO');
200-
$anchor = $this->hc->getHtmlAnchor($tableName . ".php?op=show&{$fieldId}=" . $double, $lang, $lang);
200+
$single = $this->sc->getSmartySingleVar($moduleDirname . '_url');
201+
$anchor = $this->hc->getHtmlAnchor($single . '/' . $tableName . ".php?op=show&{$fieldId}=" . $double, $lang, $lang);
201202
$td .= $this->hc->getHtmlTableData($anchor, 'center', '', "\t\t\t");
202203
$cycle = $this->sc->getSmartyNoSimbol('cycle values="odd, even"');
203204
$tr = $this->hc->getHtmlTableRow($td, $cycle, "\t\t");

docs/changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66
- fixed bugs with foreach in tpl caused by singular table names (goffy)
77
- added devtool for removing prefix from table field names (mamba/goffy)
88
- moved meta description from language file to module config (goffy)
9+
- added include autoloader to xoopsversion (goffy)
910
- added new fieldelement 'RadioOnoffline' (goffy)
11+
- implemented constants for radio on-/offline (goffy)
1012
- moved meta description/path assignments to footer.php (goffy)
13+
- fixed duplicated blank file (goffy)
14+
- fixed bug for truncated text (goffy)
15+
- added field prefix again (goffy)
16+
- fixed bug in block links (goffy)
1117

1218
<h5>3.7.0 Alpha [2023-07-06]</h5> Dev: XOOPS 2.5.11 RC2, PHP 8.0
1319
- implemented smarty 3 (zivXP/goffy)

0 commit comments

Comments
 (0)