@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | public function listBlocks(): void |
| 69 | 69 | { |
| 70 | 70 | global $xoopsModule, $pathIcon16; |
| 71 | - require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
| 71 | + require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
| 72 | 72 | // xoops_loadLanguage('admin', 'system'); |
| 73 | 73 | // xoops_loadLanguage('admin/blocksadmin', 'system'); |
| 74 | 74 | // xoops_loadLanguage('admin/groups', 'system'); |
@@ -88,16 +88,16 @@ discard block |
||
| 88 | 88 | $moduleList[-1] = \_AM_SYSTEM_BLOCKS_TOPPAGE; |
| 89 | 89 | $moduleList[0] = \_AM_SYSTEM_BLOCKS_ALLPAGES; |
| 90 | 90 | \ksort($moduleList); |
| 91 | - echo "<h4 style='text-align:left;'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BADMIN') . '</h4>'; |
|
| 92 | - echo "<form action='" . $_SERVER['SCRIPT_NAME'] . "' name='blockadmin' method='post'>"; |
|
| 91 | + echo "<h4 style='text-align:left;'>".\constant('CO_'.$this->moduleDirNameUpper.'_'.'BADMIN').'</h4>'; |
|
| 92 | + echo "<form action='".$_SERVER['SCRIPT_NAME']."' name='blockadmin' method='post'>"; |
|
| 93 | 93 | echo $GLOBALS['xoopsSecurity']->getTokenHTML(); |
| 94 | 94 | echo "<table width='100%' class='outer' cellpadding='4' cellspacing='1'> |
| 95 | - <tr valign='middle'><th align='center'>" . \_AM_SYSTEM_BLOCKS_TITLE . "</th><th align='center' nowrap='nowrap'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'SIDE') . '<br>' . \_LEFT . '-' . \_CENTER . '-' . \_RIGHT . "</th> |
|
| 96 | - <th align='center'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'WEIGHT') . "</th> |
|
| 97 | - <th align='center'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLE') . "</th><th align='center'>" . \_AM_SYSTEM_BLOCKS_VISIBLEIN . "</th> |
|
| 98 | - <th align='center'>" . \_AM_SYSTEM_ADGS . "</th> |
|
| 99 | - <th align='center'>" . \_AM_SYSTEM_BLOCKS_BCACHETIME . "</th> |
|
| 100 | - <th align='center'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'ACTION') . '</th> |
|
| 95 | + <tr valign='middle'><th align='center'>" . \_AM_SYSTEM_BLOCKS_TITLE."</th><th align='center' nowrap='nowrap'>".\constant('CO_'.$this->moduleDirNameUpper.'_'.'SIDE').'<br>'.\_LEFT.'-'.\_CENTER.'-'.\_RIGHT."</th> |
|
| 96 | + <th align='center'>" . \constant('CO_'.$this->moduleDirNameUpper.'_'.'WEIGHT')."</th> |
|
| 97 | + <th align='center'>" . \constant('CO_'.$this->moduleDirNameUpper.'_'.'VISIBLE')."</th><th align='center'>".\_AM_SYSTEM_BLOCKS_VISIBLEIN."</th> |
|
| 98 | + <th align='center'>" . \_AM_SYSTEM_ADGS."</th> |
|
| 99 | + <th align='center'>" . \_AM_SYSTEM_BLOCKS_BCACHETIME."</th> |
|
| 100 | + <th align='center'>" . \constant('CO_'.$this->moduleDirNameUpper.'_'.'ACTION').'</th> |
|
| 101 | 101 | </tr>'; |
| 102 | 102 | $blockArray = \XoopsBlock::getByModule($xoopsModule->mid()); |
| 103 | 103 | $blockCount = \count($blockArray); |
@@ -117,14 +117,14 @@ discard block |
||
| 117 | 117 | ]; |
| 118 | 118 | foreach ($blockArray as $i) { |
| 119 | 119 | $groupsPermissions = $grouppermHandler->getGroupIds('block_read', $i->getVar('bid')); |
| 120 | - $sql = 'SELECT module_id FROM ' . $this->db->prefix('block_module_link') . ' WHERE block_id=' . $i->getVar('bid'); |
|
| 120 | + $sql = 'SELECT module_id FROM '.$this->db->prefix('block_module_link').' WHERE block_id='.$i->getVar('bid'); |
|
| 121 | 121 | $result = $this->db->query($sql); |
| 122 | 122 | $modules = []; |
| 123 | 123 | if (!$result instanceof \mysqli_result) { |
| 124 | - \trigger_error("Query Failed! SQL: $sql Error: " . $this->db->error(), \E_USER_ERROR); |
|
| 124 | + \trigger_error("Query Failed! SQL: $sql Error: ".$this->db->error(), \E_USER_ERROR); |
|
| 125 | 125 | } |
| 126 | 126 | while (false !== ($row = $this->db->fetchArray($result))) { |
| 127 | - $modules[] = (int)$row['module_id']; |
|
| 127 | + $modules[] = (int) $row['module_id']; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | $cachetimeOptions = ''; |
@@ -174,46 +174,46 @@ discard block |
||
| 174 | 174 | $title = $i->getVar('title'); |
| 175 | 175 | } |
| 176 | 176 | $name = $i->getVar('name'); |
| 177 | - echo "<tr valign='top'><td class='$class' align='center'><input type='text' name='title[" . $i->getVar('bid') . "]' value='" . $title . "'></td> |
|
| 177 | + echo "<tr valign='top'><td class='$class' align='center'><input type='text' name='title[".$i->getVar('bid')."]' value='".$title."'></td> |
|
| 178 | 178 | <td class='$class' align='center' nowrap='nowrap'><div align='center' > |
| 179 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_LEFT . "'$ssel2> |
|
| 180 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_CENTER . "'$ssel3> |
|
| 181 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_RIGHT . "'$ssel4> |
|
| 179 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_LEFT."'$ssel2> |
|
| 180 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_CENTER."'$ssel3> |
|
| 181 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_RIGHT."'$ssel4> |
|
| 182 | 182 | </div> |
| 183 | 183 | <div> |
| 184 | - <span style='float:right;'><input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_SIDEBLOCK_RIGHT . "'$ssel1></span> |
|
| 185 | - <div align='left'><input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_SIDEBLOCK_LEFT . "'$ssel0></div> |
|
| 184 | + <span style='float:right;'><input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_SIDEBLOCK_RIGHT."'$ssel1></span> |
|
| 185 | + <div align='left'><input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_SIDEBLOCK_LEFT."'$ssel0></div> |
|
| 186 | 186 | </div> |
| 187 | 187 | <div align='center'> |
| 188 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_BOTTOMLEFT . "'$ssel5> |
|
| 189 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_BOTTOM . "'$ssel7> |
|
| 190 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_BOTTOMRIGHT . "'$ssel6> |
|
| 188 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_BOTTOMLEFT."'$ssel5> |
|
| 189 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_BOTTOM."'$ssel7> |
|
| 190 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_BOTTOMRIGHT."'$ssel6> |
|
| 191 | 191 | </div> |
| 192 | 192 | </td> |
| 193 | - <td class='$class' align='center'><input type='text' name='weight[" . $i->getVar('bid') . "]' value='" . $i->getVar('weight') . "' size='5' maxlength='5'></td> |
|
| 194 | - <td class='$class' align='center' nowrap><input type='radio' name='visible[" . $i->getVar('bid') . "]' value='1'$sel1>" . \_YES . " <input type='radio' name='visible[" . $i->getVar('bid') . "]' value='0'$sel0>" . \_NO . '</td>'; |
|
| 193 | + <td class='$class' align='center'><input type='text' name='weight[".$i->getVar('bid')."]' value='".$i->getVar('weight')."' size='5' maxlength='5'></td> |
|
| 194 | + <td class='$class' align='center' nowrap><input type='radio' name='visible[".$i->getVar('bid')."]' value='1'$sel1>".\_YES." <input type='radio' name='visible[".$i->getVar('bid')."]' value='0'$sel0>".\_NO.'</td>'; |
|
| 195 | 195 | |
| 196 | - echo "<td class='$class' align='center'><select size='5' name='bmodule[" . $i->getVar('bid') . "][]' id='bmodule[" . $i->getVar('bid') . "][]' multiple='multiple'>"; |
|
| 196 | + echo "<td class='$class' align='center'><select size='5' name='bmodule[".$i->getVar('bid')."][]' id='bmodule[".$i->getVar('bid')."][]' multiple='multiple'>"; |
|
| 197 | 197 | foreach ($moduleList as $k => $v) { |
| 198 | - echo "<option value='$k'" . (\in_array($k, $modules) ? " selected='selected'" : '') . ">$v</option>"; |
|
| 198 | + echo "<option value='$k'".(\in_array($k, $modules) ? " selected='selected'" : '').">$v</option>"; |
|
| 199 | 199 | } |
| 200 | 200 | echo '</select></td>'; |
| 201 | 201 | |
| 202 | - echo "<td class='$class' align='center'><select size='5' name='groups[" . $i->getVar('bid') . "][]' id='groups[" . $i->getVar('bid') . "][]' multiple='multiple'>"; |
|
| 202 | + echo "<td class='$class' align='center'><select size='5' name='groups[".$i->getVar('bid')."][]' id='groups[".$i->getVar('bid')."][]' multiple='multiple'>"; |
|
| 203 | 203 | foreach ($groups as $grp) { |
| 204 | - echo "<option value='" . $grp->getVar('groupid') . "' " . (\in_array($grp->getVar('groupid'), $groupsPermissions) ? " selected='selected'" : '') . '>' . $grp->getVar('name') . '</option>'; |
|
| 204 | + echo "<option value='".$grp->getVar('groupid')."' ".(\in_array($grp->getVar('groupid'), $groupsPermissions) ? " selected='selected'" : '').'>'.$grp->getVar('name').'</option>'; |
|
| 205 | 205 | } |
| 206 | 206 | echo '</select></td>'; |
| 207 | 207 | |
| 208 | 208 | // Cache lifetime |
| 209 | - echo '<td class="' . $class . '" align="center"> <select name="bcachetime[' . $i->getVar('bid') . ']" size="1">' . $cachetimeOptions . '</select> |
|
| 209 | + echo '<td class="'.$class.'" align="center"> <select name="bcachetime['.$i->getVar('bid').']" size="1">'.$cachetimeOptions.'</select> |
|
| 210 | 210 | </td>'; |
| 211 | 211 | |
| 212 | 212 | // Actions |
| 213 | 213 | |
| 214 | 214 | echo "<td class='$class' align='center'> |
| 215 | - <a href='blocksadmin.php?op=edit&bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/edit.png' . " alt='" . \_EDIT . "' title='" . \_EDIT . "'></a> |
|
| 216 | - <a href='blocksadmin.php?op=clone&bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/editcopy.png' . " alt='" . \_CLONE . "' title='" . \_CLONE . "'></a>"; |
|
| 215 | + <a href='blocksadmin.php?op=edit&bid=".$i->getVar('bid')."'><img src=".$pathIcon16.'/edit.png'." alt='".\_EDIT."' title='".\_EDIT."'></a> |
|
| 216 | + <a href='blocksadmin.php?op=clone&bid=" . $i->getVar('bid')."'><img src=".$pathIcon16.'/editcopy.png'." alt='".\_CLONE."' title='".\_CLONE."'></a>"; |
|
| 217 | 217 | // if ('S' !== $i->getVar('block_type') && 'M' !== $i->getVar('block_type')) { |
| 218 | 218 | // echo " <a href='" . XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&op=delete&bid=' . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/delete.png' . " alt='" . _DELETE . "' title='" . _DELETE . "'> |
| 219 | 219 | // </a>"; |
@@ -222,22 +222,22 @@ discard block |
||
| 222 | 222 | // if ('S' !== $i->getVar('block_type') && 'M' !== $i->getVar('block_type')) { |
| 223 | 223 | if (!\in_array($i->getVar('block_type'), ['M', 'S'])) { |
| 224 | 224 | echo " |
| 225 | - <a href='blocksadmin.php?op=delete&bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/delete.png' . " alt='" . \_DELETE . "' title='" . \_DELETE . "'> |
|
| 225 | + <a href='blocksadmin.php?op=delete&bid=" . $i->getVar('bid')."'><img src=".$pathIcon16.'/delete.png'." alt='".\_DELETE."' title='".\_DELETE."'> |
|
| 226 | 226 | </a>"; |
| 227 | 227 | } |
| 228 | 228 | echo " |
| 229 | - <input type='hidden' name='oldtitle[" . $i->getVar('bid') . "]' value='" . $i->getVar('title') . "'> |
|
| 230 | - <input type='hidden' name='oldside[" . $i->getVar('bid') . "]' value='" . $i->getVar('side') . "'> |
|
| 231 | - <input type='hidden' name='oldweight[" . $i->getVar('bid') . "]' value='" . $i->getVar('weight') . "'> |
|
| 232 | - <input type='hidden' name='oldvisible[" . $i->getVar('bid') . "]' value='" . $i->getVar('visible') . "'> |
|
| 233 | - <input type='hidden' name='oldgroups[" . $i->getVar('groups') . "]' value='" . $i->getVar('groups') . "'> |
|
| 234 | - <input type='hidden' name='oldbcachetime[" . $i->getVar('bid') . "]' value='" . $i->getVar('bcachetime') . "'> |
|
| 235 | - <input type='hidden' name='bid[" . $i->getVar('bid') . "]' value='" . $i->getVar('bid') . "'> |
|
| 229 | + <input type='hidden' name='oldtitle[" . $i->getVar('bid')."]' value='".$i->getVar('title')."'> |
|
| 230 | + <input type='hidden' name='oldside[" . $i->getVar('bid')."]' value='".$i->getVar('side')."'> |
|
| 231 | + <input type='hidden' name='oldweight[" . $i->getVar('bid')."]' value='".$i->getVar('weight')."'> |
|
| 232 | + <input type='hidden' name='oldvisible[" . $i->getVar('bid')."]' value='".$i->getVar('visible')."'> |
|
| 233 | + <input type='hidden' name='oldgroups[" . $i->getVar('groups')."]' value='".$i->getVar('groups')."'> |
|
| 234 | + <input type='hidden' name='oldbcachetime[" . $i->getVar('bid')."]' value='".$i->getVar('bcachetime')."'> |
|
| 235 | + <input type='hidden' name='bid[" . $i->getVar('bid')."]' value='".$i->getVar('bid')."'> |
|
| 236 | 236 | </td></tr> |
| 237 | 237 | "; |
| 238 | 238 | $class = ('even' === $class) ? 'odd' : 'even'; |
| 239 | 239 | } |
| 240 | - echo "<tr><td class='foot' align='center' colspan='8'> <input type='hidden' name='op' value='order'>" . $GLOBALS['xoopsSecurity']->getTokenHTML() . "<input type='submit' name='submit' value='" . \_SUBMIT . "'></td></tr></table></form><br><br>"; |
|
| 240 | + echo "<tr><td class='foot' align='center' colspan='8'> <input type='hidden' name='op' value='order'>".$GLOBALS['xoopsSecurity']->getTokenHTML()."<input type='submit' name='submit' value='".\_SUBMIT."'></td></tr></table></form><br><br>"; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /** |
@@ -276,18 +276,18 @@ discard block |
||
| 276 | 276 | \xoops_loadLanguage('admin/groups', 'system'); |
| 277 | 277 | |
| 278 | 278 | $myblock = new \XoopsBlock($bid); |
| 279 | - $sql = 'SELECT module_id FROM ' . $this->db->prefix('block_module_link') . ' WHERE block_id=' . $bid; |
|
| 279 | + $sql = 'SELECT module_id FROM '.$this->db->prefix('block_module_link').' WHERE block_id='.$bid; |
|
| 280 | 280 | $result = $this->db->query($sql); |
| 281 | 281 | $modules = []; |
| 282 | 282 | if ($result instanceof \mysqli_result) { |
| 283 | 283 | while (false !== ($row = $this->db->fetchArray($result))) { |
| 284 | - $modules[] = (int)$row['module_id']; |
|
| 284 | + $modules[] = (int) $row['module_id']; |
|
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | $isCustom = \in_array($myblock->getVar('block_type'), ['C', 'E']); |
| 288 | 288 | $block = [ |
| 289 | - 'title' => $myblock->getVar('title') . ' Clone', |
|
| 290 | - 'form_title' => \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BLOCKS_CLONEBLOCK'), |
|
| 289 | + 'title' => $myblock->getVar('title').' Clone', |
|
| 290 | + 'form_title' => \constant('CO_'.$this->moduleDirNameUpper.'_'.'BLOCKS_CLONEBLOCK'), |
|
| 291 | 291 | 'name' => $myblock->getVar('name'), |
| 292 | 292 | 'side' => $myblock->getVar('side'), |
| 293 | 293 | 'weight' => $myblock->getVar('weight'), |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | 'template' => $myblock->getVar('template'), |
| 304 | 304 | 'options' => $myblock->getVar('options'), |
| 305 | 305 | ]; |
| 306 | - echo '<a href="blocksadmin.php">' . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BADMIN') . '</a> <span style="font-weight:bold;">»»</span> ' . \_AM_SYSTEM_BLOCKS_CLONEBLOCK . '<br><br>'; |
|
| 306 | + echo '<a href="blocksadmin.php">'.\constant('CO_'.$this->moduleDirNameUpper.'_'.'BADMIN').'</a> <span style="font-weight:bold;">»»</span> '.\_AM_SYSTEM_BLOCKS_CLONEBLOCK.'<br><br>'; |
|
| 307 | 307 | // $form = new Blockform(); |
| 308 | 308 | // $form->render(); |
| 309 | 309 | |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | // $newid = $clone->store(); //see https://github.com/XOOPS/XoopsCore25/issues/1105 |
| 358 | 358 | if ($clone->store()) { |
| 359 | - $newid = $clone->id(); //get the id of the cloned block |
|
| 359 | + $newid = $clone->id(); //get the id of the cloned block |
|
| 360 | 360 | } |
| 361 | 361 | if (!$newid) { |
| 362 | 362 | // \xoops_cp_header(); |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | if ('' !== $clone->getVar('template')) { |
| 368 | 368 | /** @var \XoopsTplfileHandler $tplfileHandler */ |
| 369 | 369 | $tplfileHandler = \xoops_getHandler('tplfile'); |
| 370 | - $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', (string)$bid); |
|
| 370 | + $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', (string) $bid); |
|
| 371 | 371 | if (\count($btemplate) > 0) { |
| 372 | 372 | $tplclone = $btemplate[0]->xoopsClone(); |
| 373 | 373 | $tplclone->setVar('tpl_id', 0); |
@@ -377,12 +377,12 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | foreach ($bmodule as $bmid) { |
| 380 | - $sql = 'INSERT INTO ' . $this->db->prefix('block_module_link') . ' (block_id, module_id) VALUES (' . $newid . ', ' . $bmid . ')'; |
|
| 380 | + $sql = 'INSERT INTO '.$this->db->prefix('block_module_link').' (block_id, module_id) VALUES ('.$newid.', '.$bmid.')'; |
|
| 381 | 381 | $this->db->query($sql); |
| 382 | 382 | } |
| 383 | 383 | //$groups = &$GLOBALS['xoopsUser']->getGroups(); |
| 384 | 384 | foreach ($groups as $iValue) { |
| 385 | - $sql = 'INSERT INTO ' . $this->db->prefix('group_permission') . ' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (' . $iValue . ', ' . $newid . ", 1, 'block_read')"; |
|
| 385 | + $sql = 'INSERT INTO '.$this->db->prefix('group_permission').' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES ('.$iValue.', '.$newid.", 1, 'block_read')"; |
|
| 386 | 386 | $this->db->query($sql); |
| 387 | 387 | } |
| 388 | 388 | $this->helper->redirect('admin/blocksadmin.php?op=list', 1, _AM_DBUPDATED); |
@@ -425,12 +425,12 @@ discard block |
||
| 425 | 425 | \xoops_loadLanguage('admin/groups', 'system'); |
| 426 | 426 | // mpu_adm_menu(); |
| 427 | 427 | $myblock = new \XoopsBlock($bid); |
| 428 | - $sql = 'SELECT module_id FROM ' . $this->db->prefix('block_module_link') . ' WHERE block_id=' . $bid; |
|
| 428 | + $sql = 'SELECT module_id FROM '.$this->db->prefix('block_module_link').' WHERE block_id='.$bid; |
|
| 429 | 429 | $result = $this->db->query($sql); |
| 430 | 430 | $modules = []; |
| 431 | 431 | if ($result instanceof \mysqli_result) { |
| 432 | 432 | while (false !== ($row = $this->db->fetchArray($result))) { |
| 433 | - $modules[] = (int)$row['module_id']; |
|
| 433 | + $modules[] = (int) $row['module_id']; |
|
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | 436 | $isCustom = \in_array($myblock->getVar('block_type'), ['C', 'E']); |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | 'template' => $myblock->getVar('template'), |
| 453 | 453 | 'options' => $myblock->getVar('options'), |
| 454 | 454 | ]; |
| 455 | - echo '<a href="blocksadmin.php">' . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BADMIN') . '</a> <span style="font-weight:bold;">»»</span> ' . \_AM_SYSTEM_BLOCKS_EDITBLOCK . '<br><br>'; |
|
| 455 | + echo '<a href="blocksadmin.php">'.\constant('CO_'.$this->moduleDirNameUpper.'_'.'BADMIN').'</a> <span style="font-weight:bold;">»»</span> '.\_AM_SYSTEM_BLOCKS_EDITBLOCK.'<br><br>'; |
|
| 456 | 456 | |
| 457 | 457 | echo $this->render($block); |
| 458 | 458 | } |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | $this->db->query($sql); |
| 505 | 505 | } else { |
| 506 | 506 | foreach ($bmodule as $bmid) { |
| 507 | - $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid, (int)$bmid); |
|
| 507 | + $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid, (int) $bmid); |
|
| 508 | 508 | $this->db->query($sql); |
| 509 | 509 | } |
| 510 | 510 | } |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | $this->db->query($sql); |
| 518 | 518 | } |
| 519 | 519 | } |
| 520 | - $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_' . $this->moduleDirNameUpper . '_' . 'UPDATE_SUCCESS')); |
|
| 520 | + $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_'.$this->moduleDirNameUpper.'_'.'UPDATE_SUCCESS')); |
|
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | /** |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | $this->db->query($sql); |
| 562 | 562 | } else { |
| 563 | 563 | foreach ($bmodule[$i] as $bmid) { |
| 564 | - $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid[$i], (int)$bmid); |
|
| 564 | + $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid[$i], (int) $bmid); |
|
| 565 | 565 | $this->db->query($sql); |
| 566 | 566 | } |
| 567 | 567 | } |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | - $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_' . $this->moduleDirNameUpper . '_' . 'UPDATE_SUCCESS')); |
|
| 579 | + $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_'.$this->moduleDirNameUpper.'_'.'UPDATE_SUCCESS')); |
|
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | /** |
@@ -604,9 +604,9 @@ discard block |
||
| 604 | 604 | 9 => \_AM_SYSTEM_BLOCKS_CBBOTTOM, |
| 605 | 605 | ]); |
| 606 | 606 | $form->addElement($sideSelect); |
| 607 | - $form->addElement(new \XoopsFormText(\constant('CO_' . $this->moduleDirNameUpper . '_' . 'WEIGHT'), 'bweight', 2, 5, $block['weight'])); |
|
| 608 | - $form->addElement(new \XoopsFormRadioYN(\constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLE'), 'bvisible', $block['visible'])); |
|
| 609 | - $modSelect = new \XoopsFormSelect(\constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); |
|
| 607 | + $form->addElement(new \XoopsFormText(\constant('CO_'.$this->moduleDirNameUpper.'_'.'WEIGHT'), 'bweight', 2, 5, $block['weight'])); |
|
| 608 | + $form->addElement(new \XoopsFormRadioYN(\constant('CO_'.$this->moduleDirNameUpper.'_'.'VISIBLE'), 'bvisible', $block['visible'])); |
|
| 609 | + $modSelect = new \XoopsFormSelect(\constant('CO_'.$this->moduleDirNameUpper.'_'.'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); |
|
| 610 | 610 | /** @var \XoopsModuleHandler $moduleHandler */ |
| 611 | 611 | $moduleHandler = \xoops_getHandler('module'); |
| 612 | 612 | $criteria = new \CriteriaCompo(new \Criteria('hasmain', '1')); |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | $form->addElement(new \XoopsFormText(\_AM_SYSTEM_BLOCKS_TITLE, 'btitle', 50, 255, $block['title']), false); |
| 621 | 621 | if ($block['is_custom']) { |
| 622 | 622 | $textarea = new \XoopsFormDhtmlTextArea(\_AM_SYSTEM_BLOCKS_CONTENT, 'bcontent', $block['content'], 15, 70); |
| 623 | - $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">' . \_AM_SYSTEM_BLOCKS_USEFULTAGS . '</span><br><span style="font-size:x-small;font-weight:normal;">' . \sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL . '/') . '</span>'); |
|
| 623 | + $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">'.\_AM_SYSTEM_BLOCKS_USEFULTAGS.'</span><br><span style="font-size:x-small;font-weight:normal;">'.\sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL.'/').'</span>'); |
|
| 624 | 624 | $form->addElement($textarea, true); |
| 625 | 625 | $ctypeSelect = new \XoopsFormSelect(\_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']); |
| 626 | 626 | $ctypeSelect->addOptionArray([ |
@@ -636,11 +636,11 @@ discard block |
||
| 636 | 636 | $tplfileHandler = \xoops_getHandler('tplfile'); |
| 637 | 637 | $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']); |
| 638 | 638 | if (\count($btemplate) > 0) { |
| 639 | - $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate[0]->getVar('tpl_id') . '">' . \_AM_SYSTEM_BLOCKS_EDITTPL . '</a>')); |
|
| 639 | + $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate[0]->getVar('tpl_id').'">'.\_AM_SYSTEM_BLOCKS_EDITTPL.'</a>')); |
|
| 640 | 640 | } else { |
| 641 | 641 | $btemplate2 = $tplfileHandler->find('default', 'block', $block['bid']); |
| 642 | 642 | if (\count($btemplate2) > 0) { |
| 643 | - $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate2[0]->getVar('tpl_id') . '" target="_blank">' . \_AM_SYSTEM_BLOCKS_EDITTPL . '</a>')); |
|
| 643 | + $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate2[0]->getVar('tpl_id').'" target="_blank">'.\_AM_SYSTEM_BLOCKS_EDITTPL.'</a>')); |
|
| 644 | 644 | } |
| 645 | 645 | } |
| 646 | 646 | } |
@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | //check for minimum XOOPS version |
| 41 | 41 | $currentVer = mb_substr(\XOOPS_VERSION, 6); // get the numeric part of string |
| 42 | 42 | if (null === $requiredVer) { |
| 43 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
| 43 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
| 44 | 44 | } |
| 45 | 45 | $success = true; |
| 46 | 46 | |
| 47 | 47 | if (\version_compare($currentVer, $requiredVer, '<')) { |
| 48 | 48 | $success = false; |
| 49 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
| 49 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | return $success; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | if (false !== $reqVer && '' !== $reqVer) { |
| 79 | 79 | if (\version_compare($verNum, $reqVer, '<')) { |
| 80 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
| 80 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
| 81 | 81 | $success = false; |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
| 97 | 97 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
| 98 | 98 | $update = ''; |
| 99 | - $repository = 'XoopsModules25x/' . $moduleDirName; |
|
| 99 | + $repository = 'XoopsModules25x/'.$moduleDirName; |
|
| 100 | 100 | // $repository = 'XoopsModules25x/publisher'; //for testing only |
| 101 | 101 | $ret = null; |
| 102 | 102 | $infoReleasesUrl = "https://api.github.com/repos/$repository/releases"; |
@@ -110,14 +110,14 @@ discard block |
||
| 110 | 110 | if (false === $curlReturn) { |
| 111 | 111 | \trigger_error(\curl_error($curlHandle)); |
| 112 | 112 | } elseif (false !== \mb_strpos($curlReturn, 'Not Found')) { |
| 113 | - \trigger_error('Repository Not Found: ' . $infoReleasesUrl); |
|
| 113 | + \trigger_error('Repository Not Found: '.$infoReleasesUrl); |
|
| 114 | 114 | } else { |
| 115 | 115 | $file = json_decode($curlReturn, false); |
| 116 | 116 | $latestVersionLink = \sprintf("https://github.com/$repository/archive/%s.zip", $file ? \reset($file)->tag_name : $default); |
| 117 | 117 | $latestVersion = $file[0]->tag_name; |
| 118 | 118 | $prerelease = $file[0]->prerelease; |
| 119 | 119 | if ('master' !== $latestVersionLink) { |
| 120 | - $update = \constant('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION') . $latestVersion; |
|
| 120 | + $update = \constant('CO_'.$moduleDirNameUpper.'_'.'NEW_VERSION').$latestVersion; |
|
| 121 | 121 | } |
| 122 | 122 | //"PHP-standardized" version |
| 123 | 123 | $latestVersion = \mb_strtolower($latestVersion); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $latestVersion = \str_replace('final', '', \mb_strtolower($latestVersion)); |
| 127 | 127 | } |
| 128 | 128 | $moduleVersion = ($helper->getModule() |
| 129 | - ->getInfo('version') . '_' . $helper->getModule() |
|
| 129 | + ->getInfo('version').'_'.$helper->getModule() |
|
| 130 | 130 | ->getInfo('module_status')); |
| 131 | 131 | //"PHP-standardized" version |
| 132 | 132 | $moduleVersion = \str_replace(' ', '', \mb_strtolower($moduleVersion)); |
@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | { |
| 60 | 60 | if ($considerHtml) { |
| 61 | 61 | // if the plain text is shorter than the maximum length, return the whole text |
| 62 | - if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) { |
|
| 62 | + if (mb_strlen(\preg_replace('/<.*?'.'>/', '', $text)) <= $length) { |
|
| 63 | 63 | return $text; |
| 64 | 64 | } |
| 65 | 65 | // splits all html-tags to scanable lines |
| 66 | - \preg_match_all('/(<.+?' . '>)?([^<>]*)/s', $text, $lines, \PREG_SET_ORDER); |
|
| 66 | + \preg_match_all('/(<.+?'.'>)?([^<>]*)/s', $text, $lines, \PREG_SET_ORDER); |
|
| 67 | 67 | $total_length = mb_strlen($ending); |
| 68 | 68 | $open_tags = []; |
| 69 | 69 | $truncate = ''; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | unset($open_tags[$pos]); |
| 82 | 82 | } |
| 83 | 83 | // if tag is an opening tag |
| 84 | - } elseif (\preg_match('/^<\s*([^\s>!]+).*?' . '>$/s', $line_matchings[1], $tag_matchings)) { |
|
| 84 | + } elseif (\preg_match('/^<\s*([^\s>!]+).*?'.'>$/s', $line_matchings[1], $tag_matchings)) { |
|
| 85 | 85 | // add tag to the beginning of $open_tags list |
| 86 | 86 | \array_unshift($open_tags, \mb_strtolower($tag_matchings[1])); |
| 87 | 87 | } |
@@ -90,15 +90,15 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | // calculate the length of the plain text part of the line; handle entities as one character |
| 92 | 92 | $content_length = mb_strlen(\preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2])); |
| 93 | - if ($total_length + $content_length > $length) { |
|
| 93 | + if ($total_length+$content_length > $length) { |
|
| 94 | 94 | // the number of characters which are left |
| 95 | - $left = $length - $total_length; |
|
| 95 | + $left = $length-$total_length; |
|
| 96 | 96 | $entities_length = 0; |
| 97 | 97 | // search for html entities |
| 98 | 98 | if (\preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, \PREG_OFFSET_CAPTURE)) { |
| 99 | 99 | // calculate the real length of all entities in the legal range |
| 100 | 100 | foreach ($entities[0] as $entity) { |
| 101 | - if ($left >= $entity[1] + 1 - $entities_length) { |
|
| 101 | + if ($left >= $entity[1]+1-$entities_length) { |
|
| 102 | 102 | $left--; |
| 103 | 103 | $entities_length += mb_strlen($entity[0]); |
| 104 | 104 | } else { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | - $truncate .= mb_substr($line_matchings[2], 0, $left + $entities_length); |
|
| 110 | + $truncate .= mb_substr($line_matchings[2], 0, $left+$entities_length); |
|
| 111 | 111 | // maximum lenght is reached, so get off the loop |
| 112 | 112 | break; |
| 113 | 113 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if (mb_strlen($text) <= $length) { |
| 124 | 124 | return $text; |
| 125 | 125 | } |
| 126 | - $truncate = mb_substr($text, 0, $length - mb_strlen($ending)); |
|
| 126 | + $truncate = mb_substr($text, 0, $length-mb_strlen($ending)); |
|
| 127 | 127 | } |
| 128 | 128 | // if the words shouldn't be cut in the middle... |
| 129 | 129 | if (!$exact) { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | if ($considerHtml) { |
| 140 | 140 | // close all unclosed html-tags |
| 141 | 141 | foreach ($open_tags as $tag) { |
| 142 | - $truncate .= '</' . $tag . '>'; |
|
| 142 | + $truncate .= '</'.$tag.'>'; |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $new_id = false; |
| 211 | 211 | $table = $GLOBALS['xoopsDB']->prefix($tableName); |
| 212 | 212 | // copy content of the record you wish to clone |
| 213 | - $sql = "SELECT * FROM $table WHERE $idField='" . $id . "' "; |
|
| 213 | + $sql = "SELECT * FROM $table WHERE $idField='".$id."' "; |
|
| 214 | 214 | $result = $GLOBALS['xoopsDB']->query($sql); |
| 215 | 215 | if ($result instanceof \mysqli_result) { |
| 216 | 216 | $tempTable = $GLOBALS['xoopsDB']->fetchArray($result, \MYSQLI_ASSOC); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | // set the auto-incremented id's value to blank. |
| 222 | 222 | unset($tempTable[$id_field]); |
| 223 | 223 | // insert cloned copy of the original record |
| 224 | - $sql = "INSERT INTO $table (" . \implode(', ', \array_keys($tempTable)) . ") VALUES ('" . \implode("', '", $tempTable) . "')"; |
|
| 224 | + $sql = "INSERT INTO $table (".\implode(', ', \array_keys($tempTable)).") VALUES ('".\implode("', '", $tempTable)."')"; |
|
| 225 | 225 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
| 226 | 226 | if (!$result) { |
| 227 | 227 | \trigger_error($GLOBALS['xoopsDB']->error()); |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | /** @var Utility $utility */ |
| 31 | 31 | /** @var Configurator $configurator */ |
| 32 | 32 | |
| 33 | -require_once dirname(__DIR__, 3) . '/include/cp_header.php'; |
|
| 34 | -require \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
| 33 | +require_once dirname(__DIR__, 3).'/include/cp_header.php'; |
|
| 34 | +require \dirname(__DIR__).'/preloads/autoloader.php'; |
|
| 35 | 35 | |
| 36 | 36 | $op = Request::getCmd('op', ''); |
| 37 | 37 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | loadSampleData(); |
| 52 | 52 | } else { |
| 53 | 53 | xoops_cp_header(); |
| 54 | - xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', \sprintf(\constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_CONFIRM')), \constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
| 54 | + xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', \sprintf(\constant('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA_CONFIRM')), \constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'), true); |
|
| 55 | 55 | xoops_cp_footer(); |
| 56 | 56 | } |
| 57 | 57 | break; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | clearSampleData(); |
| 67 | 67 | } else { |
| 68 | 68 | xoops_cp_header(); |
| 69 | - xoops_confirm(['ok' => 1, 'op' => 'clear'], 'index.php', sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA')), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
| 69 | + xoops_confirm(['ok' => 1, 'op' => 'clear'], 'index.php', sprintf(constant('CO_'.$moduleDirNameUpper.'_'.'CLEAR_SAMPLEDATA')), constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'), true); |
|
| 70 | 70 | xoops_cp_footer(); |
| 71 | 71 | } |
| 72 | 72 | break; |
@@ -91,20 +91,20 @@ discard block |
||
| 91 | 91 | ->getInfo('tables'); |
| 92 | 92 | |
| 93 | 93 | $language = 'english/'; |
| 94 | - if (\is_dir(__DIR__ . '/' . $xoopsConfig['language'])) { |
|
| 95 | - $language = $xoopsConfig['language'] . '/'; |
|
| 94 | + if (\is_dir(__DIR__.'/'.$xoopsConfig['language'])) { |
|
| 95 | + $language = $xoopsConfig['language'].'/'; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // load module tables |
| 99 | 99 | foreach ($tables as $table) { |
| 100 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
| 100 | + $tabledata = Yaml::readWrapped($language.$table.'.yml'); |
|
| 101 | 101 | TableLoad::truncateTable($table); |
| 102 | 102 | TableLoad::loadTableFromArray($table, $tabledata); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | // load permissions |
| 106 | 106 | $table = 'group_permission'; |
| 107 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
| 107 | + $tabledata = Yaml::readWrapped($language.$table.'.yml'); |
|
| 108 | 108 | $mid = \Xmf\Module\Helper::getHelper($moduleDirName) |
| 109 | 109 | ->getModule() |
| 110 | 110 | ->getVar('mid'); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $utility::rcopy($src, $dest); |
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_SUCCESS')); |
|
| 122 | + \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA_SUCCESS')); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -134,16 +134,16 @@ discard block |
||
| 134 | 134 | $tables = $helper->getModule() |
| 135 | 135 | ->getInfo('tables'); |
| 136 | 136 | |
| 137 | - $languageFolder = __DIR__ . '/' . $xoopsConfig['language']; |
|
| 138 | - if (!\file_exists($languageFolder . '/')) { |
|
| 139 | - Utility::createFolder($languageFolder . '/'); |
|
| 137 | + $languageFolder = __DIR__.'/'.$xoopsConfig['language']; |
|
| 138 | + if (!\file_exists($languageFolder.'/')) { |
|
| 139 | + Utility::createFolder($languageFolder.'/'); |
|
| 140 | 140 | } |
| 141 | - $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/'; |
|
| 141 | + $exportFolder = $languageFolder.'/Exports-'.date('Y-m-d-H-i-s').'/'; |
|
| 142 | 142 | Utility::createFolder($exportFolder); |
| 143 | 143 | |
| 144 | 144 | // save module tables |
| 145 | 145 | foreach ($tables as $table) { |
| 146 | - TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml'); |
|
| 146 | + TableLoad::saveTableToYamlFile($table, $exportFolder.$table.'.yml'); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | // save permissions |
@@ -155,10 +155,10 @@ discard block |
||
| 155 | 155 | ) |
| 156 | 156 | ); |
| 157 | 157 | $skipColumns[] = 'gperm_id'; |
| 158 | - TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns); |
|
| 158 | + TableLoad::saveTableToYamlFile('group_permission', $exportFolder.'group_permission.yml', $criteria, $skipColumns); |
|
| 159 | 159 | unset($criteria); |
| 160 | 160 | |
| 161 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA_SUCCESS')); |
|
| 161 | + \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA_SUCCESS')); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | // |
| 177 | 177 | // redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS')); |
| 178 | 178 | } catch (\Throwable $e) { |
| 179 | - exit(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR')); |
|
| 179 | + exit(constant('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_ERROR')); |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
@@ -200,13 +200,13 @@ discard block |
||
| 200 | 200 | $prefixedTable = $db->prefix($table); |
| 201 | 201 | $count = 0; |
| 202 | 202 | |
| 203 | - $sql = 'DELETE FROM ' . $prefixedTable . ' WHERE `' . $search . '`=' . $db->quote($replace); |
|
| 203 | + $sql = 'DELETE FROM '.$prefixedTable.' WHERE `'.$search.'`='.$db->quote($replace); |
|
| 204 | 204 | |
| 205 | 205 | $result = $db->queryF($sql); |
| 206 | 206 | |
| 207 | 207 | if ($result) { |
| 208 | 208 | foreach ($data as $row) { |
| 209 | - $insertInto = 'INSERT INTO ' . $prefixedTable . ' ('; |
|
| 209 | + $insertInto = 'INSERT INTO '.$prefixedTable.' ('; |
|
| 210 | 210 | $valueClause = ' VALUES ('; |
| 211 | 211 | $first = true; |
| 212 | 212 | foreach ($row as $column => $value) { |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - $sql = $insertInto . ') ' . $valueClause . ')'; |
|
| 228 | + $sql = $insertInto.') '.$valueClause.')'; |
|
| 229 | 229 | |
| 230 | 230 | $result = $db->queryF($sql); |
| 231 | 231 | if (false !== $result) { |
@@ -252,5 +252,5 @@ discard block |
||
| 252 | 252 | foreach ($tables as $table) { |
| 253 | 253 | \Xmf\Database\TableLoad::truncateTable($table); |
| 254 | 254 | } |
| 255 | - redirect_header($helper->url('admin/index.php'), 1, constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA_OK')); |
|
| 255 | + redirect_header($helper->url('admin/index.php'), 1, constant('CO_'.$moduleDirNameUpper.'_'.'CLEAR_SAMPLEDATA_OK')); |
|
| 256 | 256 | } |
@@ -24,10 +24,10 @@ |
||
| 24 | 24 | |
| 25 | 25 | /** @var Helper $helper */ |
| 26 | 26 | |
| 27 | -require dirname(__DIR__, 2) . '/mainfile.php'; |
|
| 28 | -require XOOPS_ROOT_PATH . '/header.php'; |
|
| 27 | +require dirname(__DIR__, 2).'/mainfile.php'; |
|
| 28 | +require XOOPS_ROOT_PATH.'/header.php'; |
|
| 29 | 29 | |
| 30 | -require __DIR__ . '/preloads/autoloader.php'; |
|
| 30 | +require __DIR__.'/preloads/autoloader.php'; |
|
| 31 | 31 | |
| 32 | 32 | $moduleDirName = basename(__DIR__); |
| 33 | 33 | |