@@ -38,10 +38,10 @@ discard block |
||
| 38 | 38 | 'help' => 'page=help', |
| 39 | 39 | 'license_url' => 'www.gnu.org/licenses/gpl-2.0.html/', |
| 40 | 40 | 'release_info' => '', |
| 41 | - 'release_file' => \XOOPS_URL."/modules/{$dirname}/docs/release_info file", |
|
| 41 | + 'release_file' => \XOOPS_URL . "/modules/{$dirname}/docs/release_info file", |
|
| 42 | 42 | 'release_date' => '2021/04/01', |
| 43 | 43 | 'manual' => 'link to manual file', |
| 44 | - 'manual_file' => \XOOPS_URL."/modules/{$dirname}/docs/install.txt", |
|
| 44 | + 'manual_file' => \XOOPS_URL . "/modules/{$dirname}/docs/install.txt", |
|
| 45 | 45 | 'min_php' => '7.4', |
| 46 | 46 | 'min_xoops' => '2.5.11 Beta1', |
| 47 | 47 | 'min_admin' => '1.1', |
@@ -183,10 +183,10 @@ discard block |
||
| 183 | 183 | 'default' => 1, |
| 184 | 184 | ]; |
| 185 | 185 | |
| 186 | -$currdirname = isset($GLOBALS['xoopsModule'])&& \is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system'; |
|
| 186 | +$currdirname = isset($GLOBALS['xoopsModule']) && \is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system'; |
|
| 187 | 187 | if ($dirname == $currdirname) { |
| 188 | - $subcount = 1 ; |
|
| 189 | - $pathname = \XOOPS_ROOT_PATH. '/modules/'.$dirname; |
|
| 188 | + $subcount = 1; |
|
| 189 | + $pathname = \XOOPS_ROOT_PATH . '/modules/' . $dirname; |
|
| 190 | 190 | include_once $pathname . '/include/common.php'; |
| 191 | 191 | // Get instance of module |
| 192 | 192 | $helper = Helper::getInstance(); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | foreach (\array_keys($versions_arr) as $i) |
| 204 | 204 | { |
| 205 | 205 | $modversion['sub'][$subcount]['name'] = $versions_arr[$i]->getVar('version_name'); |
| 206 | - $modversion['sub'][$subcount++]['url'] = 'index.php?version_id=' . $versions_arr[$i]->getVar('version_id') ; |
|
| 206 | + $modversion['sub'][$subcount++]['url'] = 'index.php?version_id=' . $versions_arr[$i]->getVar('version_id'); |
|
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | } |
@@ -217,7 +217,7 @@ |
||
| 217 | 217 | //--></script> |
| 218 | 218 | <!-- End Form Validation JavaScript //-->', |
| 219 | 219 | ]; |
| 220 | - $paypalform = [ |
|
| 220 | + $paypalform = [ |
|
| 221 | 221 | 0 => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">', |
| 222 | 222 | 1 => '<input name="cmd" value="_s-xclick" type="hidden">', |
| 223 | 223 | 2 => '<input name="hosted_button_id" value="%s" type="hidden">', |
@@ -4,12 +4,12 @@ |
||
| 4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
| 5 | 5 | */ |
| 6 | 6 | spl_autoload_register( |
| 7 | - static function ($class) { |
|
| 7 | + static function($class) { |
|
| 8 | 8 | // project-specific namespace prefix |
| 9 | 9 | $prefix = 'XoopsModules\\' . \ucfirst(\basename(\dirname(__DIR__))); |
| 10 | 10 | |
| 11 | 11 | // base directory for the namespace prefix |
| 12 | - $baseDir = \dirname(__DIR__) . '/class/'; |
|
| 12 | + $baseDir = \dirname(__DIR__) . '/class/'; |
|
| 13 | 13 | |
| 14 | 14 | // does the class use the namespace prefix? |
| 15 | 15 | $len = \mb_strlen($prefix); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | use XoopsModules\Wgsitenotice\Helper; |
| 23 | 23 | |
| 24 | -include_once \XOOPS_ROOT_PATH.'/modules/wgsitenotice/include/common.php'; |
|
| 24 | +include_once \XOOPS_ROOT_PATH . '/modules/wgsitenotice/include/common.php'; |
|
| 25 | 25 | |
| 26 | 26 | // Function show block |
| 27 | 27 | function b_wgsitenotice_versions_show($options) |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | { |
| 68 | 68 | |
| 69 | 69 | $form = \_MB_WGSITENOTICE_DISPLAY; |
| 70 | - $form .= "<input name='options[0]' size='5' maxlength='255' value='".$options[0]."' type='text' /> <br />"; |
|
| 71 | - $form .= \_MB_WGSITENOTICE_TITLELENGTH." : <input name='options[1]' size='5' maxlength='255' value='".$options[1]."' type='text' /><br /><br />"; |
|
| 70 | + $form .= "<input name='options[0]' size='5' maxlength='255' value='" . $options[0] . "' type='text' /> <br />"; |
|
| 71 | + $form .= \_MB_WGSITENOTICE_TITLELENGTH . " : <input name='options[1]' size='5' maxlength='255' value='" . $options[1] . "' type='text' /><br /><br />"; |
|
| 72 | 72 | \array_shift($options); |
| 73 | 73 | \array_shift($options); |
| 74 | 74 | |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | // InfoBox Statistics |
| 28 | 28 | $adminMenu->addInfoBox(\_AM_WGSITENOTICE_STATISTICS); |
| 29 | 29 | // Info elements |
| 30 | -$adminMenu->addInfoBoxLine(\_AM_WGSITENOTICE_STATISTICS, '<label>'.\_AM_WGSITENOTICE_THEREARE_VERSIONS.'</label>', $count_versions); |
|
| 31 | -$adminMenu->addInfoBoxLine(\_AM_WGSITENOTICE_STATISTICS, '<label>'.\_AM_WGSITENOTICE_THEREARE_CONTENTS.'</label>', $count_contents); |
|
| 30 | +$adminMenu->addInfoBoxLine(\_AM_WGSITENOTICE_STATISTICS, '<label>' . \_AM_WGSITENOTICE_THEREARE_VERSIONS . '</label>', $count_versions); |
|
| 31 | +$adminMenu->addInfoBoxLine(\_AM_WGSITENOTICE_STATISTICS, '<label>' . \_AM_WGSITENOTICE_THEREARE_CONTENTS . '</label>', $count_contents); |
|
| 32 | 32 | // Render Index |
| 33 | 33 | echo $adminMenu->addNavigation('index.php'); |
| 34 | 34 | echo $adminMenu->renderIndex(); |
@@ -74,9 +74,9 @@ |
||
| 74 | 74 | \xoops_load('XoopsFormLoader'); |
| 75 | 75 | $form = new \XoopsThemeForm($title, 'form', $action, 'post', true); |
| 76 | 76 | $form->setExtra('enctype="multipart/form-data"'); |
| 77 | - $oc_server = $helper->getConfig('wgsitenotice_oc_server').'checkonline.php'; |
|
| 77 | + $oc_server = $helper->getConfig('wgsitenotice_oc_server') . 'checkonline.php'; |
|
| 78 | 78 | // Form Text oc_server |
| 79 | - $form->addElement( new \XoopsFormText(\_MI_WGSITENOTICE_OC_SERVER, 'oc_server', 50, 255, $oc_server), true ); |
|
| 79 | + $form->addElement(new \XoopsFormText(\_MI_WGSITENOTICE_OC_SERVER, 'oc_server', 50, 255, $oc_server), true); |
|
| 80 | 80 | // Send |
| 81 | 81 | $form->addElement(new \XoopsFormHidden('op', 'checkonline')); |
| 82 | 82 | $form->addElement(new \XoopsFormButton('', 'submit', \_AM_WGSITENOTICE_OC_START, 'submit')); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | $oc_server = Request::getString('oc_server', 'default'); |
| 29 | 29 | if ('default' === $oc_server) { |
| 30 | - $oc_server = $helper->getConfig('wgsitenotice_oc_server').'checkonline.php'; |
|
| 30 | + $oc_server = $helper->getConfig('wgsitenotice_oc_server') . 'checkonline.php'; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $template_main = 'wgsitenotice_admin_checkonline.tpl'; |
@@ -46,19 +46,19 @@ discard block |
||
| 46 | 46 | // Request version_id |
| 47 | 47 | $version_id = Request::getInt('version_id'); |
| 48 | 48 | if (0 == $version_id) { |
| 49 | - $GLOBALS['xoopsTpl']->assign('error',\_AM_WGSITENOTICE_OC_ERR_INVALID_PARAM); |
|
| 49 | + $GLOBALS['xoopsTpl']->assign('error', \_AM_WGSITENOTICE_OC_ERR_INVALID_PARAM); |
|
| 50 | 50 | break; |
| 51 | 51 | } |
| 52 | 52 | //$xml_text = \file_get_contents($oc_server.'?version_id='.$version_id); |
| 53 | - $xml_text = $checkonlineHandler->getData($oc_server . '?version_id='.$version_id); |
|
| 53 | + $xml_text = $checkonlineHandler->getData($oc_server . '?version_id=' . $version_id); |
|
| 54 | 54 | // echo $xml_text; |
| 55 | 55 | $xml_arr = $checkonlineHandler->readXML($xml_text); |
| 56 | 56 | // var_dump($xml_arr); |
| 57 | 57 | if (!$xml_arr) { |
| 58 | 58 | //error when loading xml |
| 59 | - $GLOBALS['xoopsTpl']->assign('error',\str_replace('%s', $oc_server, \_AM_WGSITENOTICE_OC_ERR_READ_XML)); |
|
| 59 | + $GLOBALS['xoopsTpl']->assign('error', \str_replace('%s', $oc_server, \_AM_WGSITENOTICE_OC_ERR_READ_XML)); |
|
| 60 | 60 | } else { |
| 61 | - echo $oc_server.'?version_id='.$version_id; |
|
| 61 | + echo $oc_server . '?version_id=' . $version_id; |
|
| 62 | 62 | echo $xml_arr->status_access; |
| 63 | 63 | |
| 64 | 64 | if ('allowed' == $xml_arr->status_access) { |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | } else if ('forbidden' == $xml_arr->status_access) { |
| 101 | - $GLOBALS['xoopsTpl']->assign('error',\_AM_WGSITENOTICE_OC_ERR_FORBIDDEN); |
|
| 101 | + $GLOBALS['xoopsTpl']->assign('error', \_AM_WGSITENOTICE_OC_ERR_FORBIDDEN); |
|
| 102 | 102 | } else { |
| 103 | - $GLOBALS['xoopsTpl']->assign('error',\str_replace('%s', $oc_server, \_AM_WGSITENOTICE_OC_ERR_CONNECT)); |
|
| 103 | + $GLOBALS['xoopsTpl']->assign('error', \str_replace('%s', $oc_server, \_AM_WGSITENOTICE_OC_ERR_CONNECT)); |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | break; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | // echo "<br/><br/>var_dump xml_arr:<br/>".var_dump($xml_arr); |
| 117 | 117 | |
| 118 | 118 | if (!$xml_arr) { |
| 119 | - $GLOBALS['xoopsTpl']->assign('error',\str_replace('%s', $oc_server, \_AM_WGSITENOTICE_OC_ERR_READ_XML)); |
|
| 119 | + $GLOBALS['xoopsTpl']->assign('error', \str_replace('%s', $oc_server, \_AM_WGSITENOTICE_OC_ERR_READ_XML)); |
|
| 120 | 120 | } else { |
| 121 | 121 | // echo "<br/>status_access:".$xml_arr->status_access; |
| 122 | 122 | if ('allowed' == $xml_arr->status_access) { |
@@ -132,12 +132,12 @@ discard block |
||
| 132 | 132 | $GLOBALS['xoopsTpl']->append('versions_list', $version); |
| 133 | 133 | } |
| 134 | 134 | } else { |
| 135 | - $GLOBALS['xoopsTpl']->assign('error',\_AM_WGSITENOTICE_OC_ERR_NO_VERSIONS); |
|
| 135 | + $GLOBALS['xoopsTpl']->assign('error', \_AM_WGSITENOTICE_OC_ERR_NO_VERSIONS); |
|
| 136 | 136 | } |
| 137 | 137 | } else if ('forbidden' == $xml_arr->status_access) { |
| 138 | - $GLOBALS['xoopsTpl']->assign('error',\_AM_WGSITENOTICE_OC_ERR_FORBIDDEN); |
|
| 138 | + $GLOBALS['xoopsTpl']->assign('error', \_AM_WGSITENOTICE_OC_ERR_FORBIDDEN); |
|
| 139 | 139 | } else { |
| 140 | - $GLOBALS['xoopsTpl']->assign('error',\str_replace('%s', $oc_server, \_AM_WGSITENOTICE_OC_ERR_CONNECT)); |
|
| 140 | + $GLOBALS['xoopsTpl']->assign('error', \str_replace('%s', $oc_server, \_AM_WGSITENOTICE_OC_ERR_CONNECT)); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | unset($version); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | use XoopsModules\Wgsitenotice\Helper; |
| 23 | 23 | |
| 24 | -include_once \XOOPS_ROOT_PATH.'/modules/wgsitenotice/include/common.php'; |
|
| 24 | +include_once \XOOPS_ROOT_PATH . '/modules/wgsitenotice/include/common.php'; |
|
| 25 | 25 | |
| 26 | 26 | // Function show block |
| 27 | 27 | function b_wgsitenotice_cookie_reg_show($options) |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $block['position'] = ''; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if ( $dataprotect_id > 0 || $cookie_reg_id > 0 ) { |
|
| 74 | + if ($dataprotect_id > 0 || $cookie_reg_id > 0) { |
|
| 75 | 75 | $dataprotect_obj = $versionsHandler->get($dataprotect_id); |
| 76 | 76 | if (\is_object($dataprotect_obj)) { |
| 77 | 77 | $block['dataprotect_id'] = $dataprotect_id; |
@@ -83,18 +83,18 @@ discard block |
||
| 83 | 83 | $block['cookie_reg_text'] = $cookie_reg_obj->getVar('version_name'); |
| 84 | 84 | } |
| 85 | 85 | $block['seperator'] = ""; |
| 86 | - if ( $dataprotect_id > 0 && $cookie_reg_id > 0 ) { |
|
| 86 | + if ($dataprotect_id > 0 && $cookie_reg_id > 0) { |
|
| 87 | 87 | $block['seperator'] = "|"; |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | - $tplSource = \XOOPS_ROOT_PATH.'/modules/wgsitenotice/templates/blocks/wgsitenotice_block_cookie_reg.tpl'; |
|
| 90 | + $tplSource = \XOOPS_ROOT_PATH . '/modules/wgsitenotice/templates/blocks/wgsitenotice_block_cookie_reg.tpl'; |
|
| 91 | 91 | |
| 92 | 92 | if ("smarty" == $display_type) { |
| 93 | 93 | //hide block and show in theme.html defined position |
| 94 | 94 | $blockTpl = new \XoopsTpl(); |
| 95 | 95 | $blockTpl->assign('block', $block); |
| 96 | 96 | |
| 97 | - $GLOBALS['xoopsTpl']->assign( $type_tpl_id, $blockTpl->fetch($tplSource) ); |
|
| 97 | + $GLOBALS['xoopsTpl']->assign($type_tpl_id, $blockTpl->fetch($tplSource)); |
|
| 98 | 98 | $block = false; |
| 99 | 99 | } |
| 100 | 100 | return $block; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | $cookie = $options[0]; |
| 118 | 118 | //remove existing cookie in order to see results |
| 119 | - \setcookie($cookie,"0"); |
|
| 119 | + \setcookie($cookie, "0"); |
|
| 120 | 120 | |
| 121 | 121 | $unique_id = new \XoopsFormText('', 'options[0]', 100, 255, $cookie); |
| 122 | 122 | $form = \_MB_WGSITENOTICE_COOKIE_REG_NAME . ': ' . $unique_id->render() . '<br><br>'; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $form .= \_MB_WGSITENOTICE_COOKIE_REG_DISPLAY . ': ' . $display_sel->render() . '<br>'; |
| 142 | 142 | |
| 143 | 143 | $form .= '<br>' . \_MB_WGSITENOTICE_COOKIE_REG_OPT_STYLE . ':<br>'; |
| 144 | - $form .= \str_repeat( '-' , \strlen(\_MB_WGSITENOTICE_COOKIE_REG_OPT_STYLE) + 5 ) . '<br>'; |
|
| 144 | + $form .= \str_repeat('-', \strlen(\_MB_WGSITENOTICE_COOKIE_REG_OPT_STYLE) + 5) . '<br>'; |
|
| 145 | 145 | |
| 146 | 146 | $opacity_sel = new \XoopsFormSelect("", 'options[4]', $options[4]); |
| 147 | 147 | $opacity_sel->addOption('0.1', '0.1'); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $form .= \_MB_WGSITENOTICE_COOKIE_REG_HEIGHT . ': ' . $height_sel->render() . '<br><br>'; |
| 168 | 168 | |
| 169 | 169 | $form .= '<br>' . \_MB_WGSITENOTICE_COOKIE_REG_OPT_SMARTY . ':<br>'; |
| 170 | - $form .= \str_repeat( '-' , \strlen(\_MB_WGSITENOTICE_COOKIE_REG_OPT_SMARTY) + 5 ) . '<br>'; |
|
| 170 | + $form .= \str_repeat('-', \strlen(\_MB_WGSITENOTICE_COOKIE_REG_OPT_SMARTY) + 5) . '<br>'; |
|
| 171 | 171 | |
| 172 | 172 | $position_sel = new \XoopsFormSelect("", 'options[9]', $options[9]); |
| 173 | 173 | $position_sel->addOption('top', \_MB_WGSITENOTICE_COOKIE_REG_POSITION_TOP); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * @min_xoops 2.5.11 |
| 19 | 19 | * @author Goffy (xoops.wedega.com) - Email:<[email protected]> - Website:<https://xoops.wedega.com> |
| 20 | 20 | */ |
| 21 | -if ( isset($template_main) ) { |
|
| 21 | +if (isset($template_main)) { |
|
| 22 | 22 | $GLOBALS['xoopsTpl']->display("db:{$template_main}"); |
| 23 | 23 | } |
| 24 | 24 | xoops_cp_footer(); |