Skip to content

Commit efb8df6

Browse files
committed
code cosmetics
1 parent 529310b commit efb8df6

File tree

5 files changed

+17
-26
lines changed

5 files changed

+17
-26
lines changed

class/Files/Blocks/BlocksFiles.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ private function getBlocksShow($moduleDirname, $tableName, $tableFieldname, $fie
143143
$critStatus .= $this->xc->getXcCriteriaAdd($critName, $crit, "\t\t\t");
144144
}
145145

146+
$case1 = [];
147+
$case2 = [];
148+
$case3 = [];
149+
$case4 = [];
150+
$case5 = [];
151+
146152
$case1[] = $this->pc->getPhpCodeCommentLine("For the block: {$tableName} last",'',"\t\t\t");
147153
if ('' !== $fieldStatus) {
148154
$case1[] = $critStatus;

class/Files/CreateArchitecture.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ public function setCommonFiles($module)
751751
$patValues = array_values($patterns);
752752

753753
/* clone complete missing folders */
754+
$cloneFolders = [];
754755
$cloneFolders[] = [
755756
'src' => TDMC_PATH . '/files/commonfiles',
756757
'dst' => $upl_path,

class/Files/CreateXoopsCode.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ public function getXcSecurity($tableName, $t = '')
963963
$pc = Modulebuilder\Files\CreatePhpCode::getInstance();
964964
$securityError = $this->getXcXoopsSecurityErrors();
965965
$implode = $pc->getPhpCodeImplode(',', $securityError);
966-
$content = "{$t}\t" . $this->getXcRedirectHeader($tableName, '', 3, $implode, $t);
966+
$content = "{$t}\t" . $this->getXcRedirectHeader($tableName, '', 3, $implode, false, $t);
967967
$securityCheck = $this->getXcXoopsSecurityCheck();
968968

969969
return $pc->getPhpCodeConditions('!' . $securityCheck, '', '', $content, $t);
@@ -992,7 +992,6 @@ public function getXcInsertData($tableName, $language, $t = '')
992992
* @param $numb
993993
* @param $var
994994
* @param bool $isString
995-
*
996995
* @param string $t
997996
* @return string
998997
*/

class/Files/Sql/SqlFile.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -354,34 +354,19 @@ private function getDatabaseFields($moduleDirname, $tableMid, $tableId, $tableNa
354354
*/
355355
private function getTableRatings($moduleDirname)
356356
{
357-
$ret = null;
358-
$j = 0;
359-
$comma = [];
360-
$row = [];
361357

362-
$ret = $this->getHeadDatabaseTable($moduleDirname, 'ratings', 6);
358+
$row = [];
359+
$ret = $this->getHeadDatabaseTable($moduleDirname, 'ratings', 6);
363360
$row[] = $this->getFieldRow('rate_id', 'INT(8)', 'UNSIGNED', 'NOT NULL', null, 'AUTO_INCREMENT');
364-
$comma[$j] = $this->getKey(2, 'rate_id');
365-
++$j;
366361
$row[] = $this->getFieldRow('rate_itemid', 'INT(8)', null, 'NOT NULL', "DEFAULT '0'");
367362
$row[] = $this->getFieldRow('rate_source', 'INT(8)', null, 'NOT NULL', "DEFAULT '0'");
368363
$row[] = $this->getFieldRow('rate_value', 'INT(1)', null, 'NOT NULL', "DEFAULT '0'");
369364
$row[] = $this->getFieldRow('rate_uid', 'INT(8)', null, 'NOT NULL', "DEFAULT '0'");
370365
$row[] = $this->getFieldRow('rate_ip', 'VARCHAR(60)', null, 'NOT NULL', "DEFAULT ''");
371366
$row[] = $this->getFieldRow('rate_date', 'INT(8)', null, 'NOT NULL', "DEFAULT '0'");
367+
$row[] = $this->getKey(2, 'rate_id');
372368

373-
374-
// ================= COMMA ================= //
375-
for ($i = 0; $i < $j; ++$i) {
376-
if ($i != $j - 1) {
377-
$row[] = $comma[$i] . ',';
378-
} else {
379-
$row[] = $comma[$i];
380-
}
381-
}
382-
// ================= COMMA CICLE ================= //
383369
$ret .= implode("\n", $row);
384-
unset($j);
385370
$ret .= $this->getFootDatabaseTable();
386371

387372
return $ret;

class/Modules.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,14 @@ public function getFormModules($action = false)
189189
$form->setExtra('enctype="multipart/form-data"');
190190

191191
$modName = $isNew ? $set['name'] : $this->getVar('mod_name');
192-
$modName = new \XoopsFormText(_AM_MODULEBUILDER_MODULE_NAME, 'mod_name', 50, 255, $modName);
193-
$modName->setDescription(_AM_MODULEBUILDER_MODULE_NAME_DESC);
194-
$form->addElement($modName, true);
192+
$modNameText = new \XoopsFormText(_AM_MODULEBUILDER_MODULE_NAME, 'mod_name', 50, 255, $modName);
193+
$modNameText->setDescription(_AM_MODULEBUILDER_MODULE_NAME_DESC);
194+
$form->addElement($modNameText, true);
195195

196196
$modDirname = $isNew ? $set['dirname'] : $this->getVar('mod_dirname');
197-
$modDirname = new \XoopsFormText(_AM_MODULEBUILDER_MODULE_DIRNAME, 'mod_dirname', 25, 255, $modDirname);
198-
$modDirname->setDescription(_AM_MODULEBUILDER_MODULE_DIRNAME_DESC);
199-
$form->addElement($modDirname, true);
197+
$modDirnameText = new \XoopsFormText(_AM_MODULEBUILDER_MODULE_DIRNAME, 'mod_dirname', 25, 255, $modDirname);
198+
$modDirnameText->setDescription(_AM_MODULEBUILDER_MODULE_DIRNAME_DESC);
199+
$form->addElement($modDirnameText, true);
200200

201201
$modVersion = $isNew ? $set['version'] : $this->getVar('mod_version');
202202
$form->addElement(new \XoopsFormText(_AM_MODULEBUILDER_MODULE_VERSION, 'mod_version', 10, 25, $modVersion), true);

0 commit comments

Comments
 (0)