@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * Copyright (c) Hervé Thouzard of Instant Zero (https://www.instant-zero.com) |
| 9 | 9 | * **************************************************************************** |
| 10 | 10 | */ |
| 11 | -require_once XOOPS_ROOT_PATH . '/kernel/object.php'; |
|
| 11 | +require_once XOOPS_ROOT_PATH.'/kernel/object.php'; |
|
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * Class MyiframeBaseHandler |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function get($id) |
| 37 | 37 | { |
| 38 | 38 | $ret = null; |
| 39 | - $sql = 'SELECT * FROM ' . $this->db->prefix('myiframe') . ' WHERE frame_frameid=' . (int)$id; |
|
| 39 | + $sql = 'SELECT * FROM '.$this->db->prefix('myiframe').' WHERE frame_frameid='.(int) $id; |
|
| 40 | 40 | if (!$result = $this->db->query($sql)) { |
| 41 | 41 | return $ret; |
| 42 | 42 | } |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | { |
| 159 | 159 | $ret = []; |
| 160 | 160 | $limit = $start = 0; |
| 161 | - $sql = 'SELECT * FROM ' . $this->db->prefix('myiframe'); |
|
| 161 | + $sql = 'SELECT * FROM '.$this->db->prefix('myiframe'); |
|
| 162 | 162 | if (($criteria instanceof \CriteriaCompo) || ($criteria instanceof \Criteria)) { |
| 163 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 163 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 164 | 164 | if ('' !== $criteria->getSort()) { |
| 165 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 165 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 166 | 166 | } |
| 167 | 167 | $limit = $criteria->getLimit(); |
| 168 | 168 | $start = $criteria->getStart(); |
@@ -187,9 +187,9 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | public function getCount(\CriteriaCompo $criteria = null) |
| 189 | 189 | { |
| 190 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('myiframe'); |
|
| 190 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('myiframe'); |
|
| 191 | 191 | if (($criteria instanceof \CriteriaCompo) || ($criteria instanceof \Criteria)) { |
| 192 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 192 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 193 | 193 | } |
| 194 | 194 | $result = $this->db->query($sql); |
| 195 | 195 | if (!$result) { |
@@ -206,9 +206,9 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function deleteAll(\CriteriaCompo $criteria = null) |
| 208 | 208 | { |
| 209 | - $sql = 'DELETE FROM ' . $this->db->prefix('myiframe'); |
|
| 209 | + $sql = 'DELETE FROM '.$this->db->prefix('myiframe'); |
|
| 210 | 210 | if (($criteria instanceof \CriteriaCompo) || ($criteria instanceof \Criteria)) { |
| 211 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 211 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 212 | 212 | } |
| 213 | 213 | if (!$result = $this->db->query($sql)) { |
| 214 | 214 | return false; |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | public function updatehits($frame_id): void |
| 224 | 224 | { |
| 225 | - $sql = \sprintf('UPDATE %s SET frame_hits = frame_hits+1 WHERE frame_frameid="%u"', $this->db->prefix('myiframe'), (int)$frame_id); |
|
| 225 | + $sql = \sprintf('UPDATE %s SET frame_hits = frame_hits+1 WHERE frame_frameid="%u"', $this->db->prefix('myiframe'), (int) $frame_id); |
|
| 226 | 226 | $this->db->queryF($sql); |
| 227 | 227 | } |
| 228 | 228 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * Copyright (c) Hervé Thouzard of Instant Zero (https://www.instant-zero.com) |
| 9 | 9 | * **************************************************************************** |
| 10 | 10 | */ |
| 11 | -require_once XOOPS_ROOT_PATH . '/kernel/object.php'; |
|
| 11 | +require_once XOOPS_ROOT_PATH.'/kernel/object.php'; |
|
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * Class Myiframe |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | if (\is_array($id)) { |
| 43 | 43 | $this->assignVars($id); |
| 44 | 44 | } else { |
| 45 | - $this->load((int)$id); |
|
| 45 | + $this->load((int) $id); |
|
| 46 | 46 | } |
| 47 | 47 | } else { |
| 48 | 48 | $this->setNew(); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function load($id): void |
| 56 | 56 | { |
| 57 | - $sql = 'SELECT * FROM ' . $this->db->prefix('myiframe') . ' WHERE frame_frameid=' . (int)$id; |
|
| 57 | + $sql = 'SELECT * FROM '.$this->db->prefix('myiframe').' WHERE frame_frameid='.(int) $id; |
|
| 58 | 58 | $myrow = $this->db->fetchArray($this->db->query($sql)); |
| 59 | 59 | $this->assignVars($myrow); |
| 60 | 60 | if (!$myrow) { |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | /** @var Helper $helper */ |
| 12 | 12 | |
| 13 | 13 | $GLOBALS['xoopsOption']['template_main'] = 'myiframe.tpl'; |
| 14 | -require __DIR__ . '/header.php'; |
|
| 15 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 14 | +require __DIR__.'/header.php'; |
|
| 15 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 16 | 16 | |
| 17 | 17 | $tblalign = []; |
| 18 | 18 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | if (isset($_GET)) { |
| 21 | 21 | foreach ($_GET as $k => $v) { |
| 22 | 22 | if ('IFRAMEID' !== \mb_strtoupper(trim($k))) { |
| 23 | - $suplparam .= $k . '=' . $v . '&'; |
|
| 23 | + $suplparam .= $k.'='.$v.'&'; |
|
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $iframeHandler = $helper->getHandler('MyiframeBase'); |
| 34 | 34 | |
| 35 | 35 | if (Request::hasVar('iframeid', 'GET')) { |
| 36 | - $tblalign = [ |
|
| 36 | + $tblalign = [ |
|
| 37 | 37 | 'top', |
| 38 | 38 | 'middle', |
| 39 | 39 | 'bottom', |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | 'no', |
| 46 | 46 | 'auto', |
| 47 | 47 | ]; |
| 48 | - $frameid = Request::getInt('iframeid', 0, 'GET'); |
|
| 48 | + $frameid = Request::getInt('iframeid', 0, 'GET'); |
|
| 49 | 49 | |
| 50 | 50 | $frame = $iframeHandler->get($frameid); |
| 51 | 51 | |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | $xoopsTpl->assign('longdesc', $frame->getVar('frame_description')); |
| 56 | 56 | $xoopsTpl->assign('width', $frame->getVar('frame_width')); |
| 57 | 57 | $xoopsTpl->assign('height', $frame->getVar('frame_height')); |
| 58 | - $xoopsTpl->assign('align', $tblalign[(string)($frame->getVar('frame_align') - 1)]); |
|
| 58 | + $xoopsTpl->assign('align', $tblalign[(string) ($frame->getVar('frame_align')-1)]); |
|
| 59 | 59 | $xoopsTpl->assign('frameborder', $frame->getVar('frame_frameborder')); |
| 60 | 60 | $xoopsTpl->assign('marginwidth', $frame->getVar('frame_marginwidth')); |
| 61 | 61 | $xoopsTpl->assign('marginheight', $frame->getVar('frame_marginheight')); |
| 62 | - $xoopsTpl->assign('scrolling', $tblscrolling[(string)($frame->getVar('frame_scrolling') - 1)]); |
|
| 62 | + $xoopsTpl->assign('scrolling', $tblscrolling[(string) ($frame->getVar('frame_scrolling')-1)]); |
|
| 63 | 63 | if ('' !== xoops_trim($suplparam)) { |
| 64 | - $xoopsTpl->assign('url', $frame->getVar('frame_url') . '?' . $suplparam); |
|
| 64 | + $xoopsTpl->assign('url', $frame->getVar('frame_url').'?'.$suplparam); |
|
| 65 | 65 | } else { |
| 66 | 66 | $xoopsTpl->assign('url', $frame->getVar('frame_url')); |
| 67 | 67 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | } else { |
| 75 | 75 | if (myiframe_getmoduleoption('showlist')) { |
| 76 | - $baseurl = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php'; |
|
| 76 | + $baseurl = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/index.php'; |
|
| 77 | 77 | $frarray = []; |
| 78 | 78 | $critere = new \Criteria('1', '1', '='); |
| 79 | 79 | $critere->setSort('frame_description'); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | if ('' === xoops_trim($frame->getVar('frame_description'))) { |
| 85 | 85 | $liendesc = $frame->getVar('frame_url'); |
| 86 | 86 | } else { |
| 87 | - $liendesc = "<a href='" . $baseurl . '?iframeid=' . $frame->getVar('frame_frameid') . "'>" . $frame->getVar('frame_description') . '</a>'; |
|
| 87 | + $liendesc = "<a href='".$baseurl.'?iframeid='.$frame->getVar('frame_frameid')."'>".$frame->getVar('frame_description').'</a>'; |
|
| 88 | 88 | } |
| 89 | 89 | $iframe['list'] = $liendesc; |
| 90 | 90 | $xoopsTpl->append('iframes', $iframe); |
@@ -95,4 +95,4 @@ discard block |
||
| 95 | 95 | $xoopsTpl->assign('frame_error', _MYIFRAME_FRAME_ERROR); |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 98 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | }; |
| 15 | 15 | /** @var Helper $helper */ |
| 16 | 16 | |
| 17 | -require_once XOOPS_ROOT_PATH . '/modules/myiframe/include/functions.php'; |
|
| 17 | +require_once XOOPS_ROOT_PATH.'/modules/myiframe/include/functions.php'; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @param $options |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | 'left', |
| 36 | 36 | 'rigth', |
| 37 | 37 | ]; |
| 38 | - $tblscrolling = [ |
|
| 38 | + $tblscrolling = [ |
|
| 39 | 39 | 'yes', |
| 40 | 40 | 'no', |
| 41 | 41 | 'auto', |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | $block['longdesc'] = $frame->getVar('frame_description'); |
| 48 | 48 | $block['width'] = $frame->getVar('frame_width'); |
| 49 | 49 | $block['height'] = $frame->getVar('frame_height'); |
| 50 | - $block['align'] = $tblalign[$frame->getVar('frame_align') - 1]; |
|
| 50 | + $block['align'] = $tblalign[$frame->getVar('frame_align')-1]; |
|
| 51 | 51 | $block['frameborder'] = $frame->getVar('frame_frameborder'); |
| 52 | 52 | $block['marginwidth'] = $frame->getVar('frame_marginwidth'); |
| 53 | 53 | $block['marginheight'] = $frame->getVar('frame_marginheight'); |
| 54 | - $block['scrolling'] = $tblscrolling[$frame->getVar('frame_scrolling') - 1]; |
|
| 54 | + $block['scrolling'] = $tblscrolling[$frame->getVar('frame_scrolling')-1]; |
|
| 55 | 55 | $block['url'] = $frame->getVar('frame_url'); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -76,14 +76,14 @@ discard block |
||
| 76 | 76 | $critere->setSort('frame_description'); |
| 77 | 77 | $frarray = $iframeHandler->getObjects($critere); |
| 78 | 78 | |
| 79 | - $form = '' . _MB_MYIFRAME_IFRAME . " <select name='options[0]'>"; |
|
| 79 | + $form = ''._MB_MYIFRAME_IFRAME." <select name='options[0]'>"; |
|
| 80 | 80 | /** @var Myiframe $oneframe */ |
| 81 | 81 | foreach ($frarray as $oneframe) { |
| 82 | - $form .= "<option value='" . $oneframe->getVar('frame_frameid') . "'"; |
|
| 82 | + $form .= "<option value='".$oneframe->getVar('frame_frameid')."'"; |
|
| 83 | 83 | if ($options[0] == $oneframe->getVar('frame_frameid')) { |
| 84 | 84 | $form .= " selected='selected'"; |
| 85 | 85 | } |
| 86 | - $form .= '>' . $oneframe->getVar('frame_description') . '</option>'; |
|
| 86 | + $form .= '>'.$oneframe->getVar('frame_description').'</option>'; |
|
| 87 | 87 | } |
| 88 | 88 | $form .= "</select>\n"; |
| 89 | 89 | |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined.'); |
| 10 | 10 | |
| 11 | -require_once __DIR__ . '/preloads/autoloader.php'; |
|
| 11 | +require_once __DIR__.'/preloads/autoloader.php'; |
|
| 12 | 12 | |
| 13 | 13 | $moduleDirName = \basename(__DIR__); |
| 14 | 14 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
@@ -72,15 +72,15 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | if (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $modversion['dirname'] && $xoopsModule->getVar('isactive')) { |
| 74 | 74 | $i = 0; |
| 75 | - require_once XOOPS_ROOT_PATH . '/modules/myiframe/include/functions.php'; |
|
| 75 | + require_once XOOPS_ROOT_PATH.'/modules/myiframe/include/functions.php'; |
|
| 76 | 76 | $myts = \MyTextSanitizer::getInstance(); |
| 77 | 77 | if (myiframe_getmoduleoption('showinmenu')) { |
| 78 | - $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('myiframe') . ' ORDER BY frame_description'; |
|
| 78 | + $sql = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('myiframe').' ORDER BY frame_description'; |
|
| 79 | 79 | $result = $GLOBALS['xoopsDB']->query($sql); |
| 80 | 80 | while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) { |
| 81 | 81 | if ('' !== xoops_trim($myrow['frame_description'])) { |
| 82 | 82 | $modversion['sub'][$i]['name'] = htmlspecialchars($myrow['frame_description'], ENT_QUOTES | ENT_HTML5); |
| 83 | - $modversion['sub'][$i]['url'] = 'index.php?iframeid=' . (int)$myrow['frame_frameid']; |
|
| 83 | + $modversion['sub'][$i]['url'] = 'index.php?iframeid='.(int) $myrow['frame_frameid']; |
|
| 84 | 84 | $i++; |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | // Make Sample button visible? |
| 108 | 108 | $modversion['config'][] = [ |
| 109 | 109 | 'name' => 'displaySampleButton', |
| 110 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', |
|
| 111 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', |
|
| 110 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON', |
|
| 111 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON_DESC', |
|
| 112 | 112 | 'formtype' => 'yesno', |
| 113 | 113 | 'valuetype' => 'int', |
| 114 | 114 | 'default' => 1, |