Skip to content

Commit 85be4bf

Browse files
committed
corrections coderabbitai 3
1 parent a11a782 commit 85be4bf

6 files changed

Lines changed: 19 additions & 14 deletions

File tree

class/Common/DirectoryChecker.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ public static function dirExists($dir_path)
150150
if (!\Xmf\Request::hasVar('path', 'POST') || !\Xmf\Request::hasVar('redirect', 'POST') || !\Xmf\Request::hasVar('mode', 'POST')) {
151151
break;
152152
}
153-
$path = \Xmf\Request::getString('path', 'POST');
154-
$redirect = \Xmf\Request::getString('redirect', 'POST');
155-
$mode = \Xmf\Request::getInt('mode', 'POST');
153+
$path = \Xmf\Request::getString('path');
154+
$redirect = \Xmf\Request::getString('redirect');
155+
$mode = \Xmf\Request::getInt('mode');
156156
$msg = DirectoryChecker::setDirectoryPermissions($path, $mode) ? \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_PERMSET') : \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_PERMNOTSET');
157157

158158
\redirect_header($redirect, 2, $msg . ': ' . $path);

class/Files/CreateXoopsCode.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,12 @@ public function getXcGetItemIds(string $var = '', string $anchor = '', $param1 =
177177
* @param $tableName
178178
* @param $tableSoleName
179179
* @param $fieldName
180-
* @param string $t
181180
* @param string $language
181+
* @param string $t
182+
*
182183
* @return string
183184
*/
184-
public function getXcSetVarTextDateSelect($tableName, $tableSoleName, $fieldName, string $t = '', string $language = ''): string
185+
public function getXcSetVarTextDateSelect($tableName, $tableSoleName, $fieldName, string $language, string $t = ''): string
185186
{
186187
$cf = Modulebuilder\Files\CreateFile::getInstance();
187188
$pc = Modulebuilder\Files\CreatePhpCode::getInstance();
@@ -622,10 +623,10 @@ public function getXcUserSaveElements($moduleDirname, $tableName, $tableSoleName
622623
$ret .= $axc->getAxcSetVarUploadImage($moduleDirname, $tableName, $fieldName, $fieldMain, '', $countUploader);
623624
$countUploader++;
624625
} elseif (14 == $fieldElement) {
625-
$ret .= $axc->getAxcSetVarUploadFile($moduleDirname, $tableName, $fieldName, '', '', $countUploader);
626+
$ret .= $axc->getAxcSetVarUploadFile($moduleDirname, $tableName, $fieldName, false, '', $countUploader);
626627
$countUploader++;
627628
} elseif (15 == $fieldElement) {
628-
$ret .= $this->getXcSetVarTextDateSelect($tableName, $tableSoleName, $fieldName, '', $language);
629+
$ret .= $this->getXcSetVarTextDateSelect($tableName, $tableSoleName, $fieldName, $language);
629630
} else {
630631
$ret .= $this->getXcSetVarObj($tableName, $fieldName, "\$_POST['{$fieldName}']");
631632
}
@@ -947,11 +948,11 @@ public function getXcSetVarsObjects($moduleDirname, $tableName, $tableSoleName,
947948
$countUploader++;
948949
break;
949950
case 14:
950-
$ret .= $axc->getAxcSetVarUploadFile($moduleDirname, $tableName, $fieldName, false, $countUploader, $fieldMain);
951+
$ret .= $axc->getAxcSetVarUploadFile($moduleDirname, $tableName, $fieldName, false, '', $countUploader, $fieldMain);
951952
$countUploader++;
952953
break;
953954
case 15:
954-
$ret .= $this->getXcSetVarTextDateSelect($tableName, $tableSoleName, $fieldName, '', $language);
955+
$ret .= $this->getXcSetVarTextDateSelect($tableName, $tableSoleName, $fieldName, $language);
955956
break;
956957
default:
957958
$ret .= $this->getXcSetVarObj($tableName, $fieldName, "\$_POST['{$fieldName}']");
@@ -1222,7 +1223,7 @@ public function getXcSaveElements($moduleDirname, $tableName, $tableSoleName, $f
12221223
$countUploader++;
12231224
break;
12241225
case 15:
1225-
$fieldLines .= $this->getXcSetVarTextDateSelect($tableName, $tableSoleName, $fieldName, $t, $language);
1226+
$fieldLines .= $this->getXcSetVarTextDateSelect($tableName, $tableSoleName, $fieldName, $language, $t);
12261227
break;
12271228
case 17:
12281229
$fieldLines .= $axc->getAxcSetVarPassword($tableName, $fieldName, $t);

class/Files/Language/LanguageHelp.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static function getInstance()
6060
* @param $module
6161
* @param string $filename
6262
*/
63-
public function write($module, string $filename): void
63+
public function write(Modulebuilder\Modules $module, string $filename): void
6464
{
6565
$this->setModule($module);
6666
$this->setFileName($filename);
@@ -109,6 +109,9 @@ public function render()
109109
EOT;
110110
if ('english' !== $language) {
111111
$this->create($moduleDirname, 'language/' . $language . '/help', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED);
112+
if (!$this->renderFile()) {
113+
throw new \RuntimeException("The help.tpl file in 'language/" . $language . "/help' could not be created.");
114+
}
112115
}
113116
$this->create($moduleDirname, 'language/english/help', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED);
114117

class/Files/Templates/User/Defstyle/Breadcrumbs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function write($module, string $filename): void
8686
*
8787
* @return string
8888
*/
89-
public function render()
89+
public function render(): string
9090
{
9191
$module = $this->getModule();
9292
$filename = $this->getFileName();

class/Files/User/UserPdf.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ public function getUserPdfTcpdf($moduleDirname, $tableName, $tableSolename, $fie
145145
$ccFieldId = $this->getCamelCase($fieldId, false, true);
146146
$fieldMain = $this->xc->getXcTableFieldMain($fields);
147147

148+
$ret = '';
148149
if (1 === $tablePermissions) {
149-
$ret = $this->pc->getPhpCodeCommentLine('Check permissions');
150+
$ret .= $this->pc->getPhpCodeCommentLine('Check permissions');
150151
$ret .= $this->getSimpleString('$currentuid = 0;');
151152
$condIf = $this->getSimpleString('$currentuid = $xoopsUser->uid();', "\t");
152153
$ret .= $this->pc->getPhpCodeConditions('isset($xoopsUser) && \is_object($xoopsUser)', '', '', $condIf);

class/Files/admin/AdminPages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ private function getAdminPagesSave($moduleDirname, $tableName, $tableSoleName, $
328328
$countUploader++;
329329
break;
330330
case Constants::FIELD_ELE_TEXTDATESELECT:
331-
$fieldLines .= $this->xc->getXcSetVarTextDateSelect($tableName, $tableSoleName, $fieldName, $t, $language);
331+
$fieldLines .= $this->xc->getXcSetVarTextDateSelect($tableName, $tableSoleName, $fieldName, $language, $t);
332332
break;
333333
case Constants::FIELD_ELE_PASSWORD:
334334
$fieldLines .= $this->axc->getAxcSetVarPassword($tableName, $fieldName, $t);

0 commit comments

Comments
 (0)