@@ -27,13 +27,13 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | function wgsitenotice_block_addCatSelect($cats) { |
| 29 | 29 | $cat_sql = ''; |
| 30 | - if(\is_array($cats)) |
|
| 30 | + if (\is_array($cats)) |
|
| 31 | 31 | { |
| 32 | - $cat_sql = '('.current($cats); |
|
| 32 | + $cat_sql = '(' . current($cats); |
|
| 33 | 33 | \array_shift($cats); |
| 34 | - foreach($cats as $cat) |
|
| 34 | + foreach ($cats as $cat) |
|
| 35 | 35 | { |
| 36 | - $cat_sql .= ','.$cat; |
|
| 36 | + $cat_sql .= ',' . $cat; |
|
| 37 | 37 | } |
| 38 | 38 | $cat_sql .= ')'; |
| 39 | 39 | } |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | global $xoopsTpl, $xoTheme; |
| 46 | 46 | $myts = MyTextSanitizer::getInstance(); |
| 47 | - $content= $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
|
| 48 | - if(isset($xoTheme) && \is_object($xoTheme)) { |
|
| 49 | - $xoTheme->addMeta( 'meta', 'keywords', \strip_tags($content)); |
|
| 47 | + $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
|
| 48 | + if (isset($xoTheme) && \is_object($xoTheme)) { |
|
| 49 | + $xoTheme->addMeta('meta', 'keywords', \strip_tags($content)); |
|
| 50 | 50 | } else { // Compatibility for old Xoops versions |
| 51 | 51 | $xoopsTpl->assign('xoops_meta_keywords', \strip_tags($content)); |
| 52 | 52 | } |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | global $xoopsTpl, $xoTheme; |
| 58 | 58 | $myts = MyTextSanitizer::getInstance(); |
| 59 | 59 | $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
| 60 | - if(isset($xoTheme) && \is_object($xoTheme)) { |
|
| 61 | - $xoTheme->addMeta( 'meta', 'description', \strip_tags($content)); |
|
| 60 | + if (isset($xoTheme) && \is_object($xoTheme)) { |
|
| 61 | + $xoTheme->addMeta('meta', 'description', \strip_tags($content)); |
|
| 62 | 62 | } else { // Compatibility for old Xoops versions |
| 63 | 63 | $xoopsTpl->assign('xoops_meta_description', \strip_tags($content)); |
| 64 | 64 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * @author Goffy (xoops.wedega.com) - Email:<[email protected]> - Website:<https://xoops.wedega.com> |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | -$dirname = \basename( \dirname(__DIR__) ) ; |
|
| 22 | +$dirname = \basename(\dirname(__DIR__)); |
|
| 23 | 23 | $moduleDirNameUpper = \mb_strtoupper($dirname); |
| 24 | 24 | $moduleHandler = \xoops_getHandler('module'); |
| 25 | 25 | $xoopsModule = \XoopsModule::getByDirname($dirname); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $adminmenu[] = [ |
| 30 | 30 | 'title' => \_MI_WGSITENOTICE_ADMENU1, |
| 31 | 31 | 'link' => 'admin/index.php', |
| 32 | - 'icon' => $sysPathIcon32.'/dashboard.png' |
|
| 32 | + 'icon' => $sysPathIcon32 . '/dashboard.png' |
|
| 33 | 33 | ]; |
| 34 | 34 | $adminmenu[] = [ |
| 35 | 35 | 'title' => \_MI_WGSITENOTICE_ADMENU2, |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | require_once \dirname(__DIR__, 2) . '/mainfile.php'; |
| 27 | 27 | $dirname = $GLOBALS['xoopsModule']->getVar('dirname'); |
| 28 | -$pathname = \XOOPS_ROOT_PATH. '/modules/'.$dirname; |
|
| 28 | +$pathname = \XOOPS_ROOT_PATH . '/modules/' . $dirname; |
|
| 29 | 29 | include_once $pathname . '/include/common.php'; |
| 30 | 30 | // Get instance of module |
| 31 | 31 | $helper = Helper::getInstance(); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | // |
| 39 | 39 | $myts = MyTextSanitizer::getInstance(); |
| 40 | 40 | $style = \WGSITENOTICE_URL . '/assets/css/style.css'; |
| 41 | -if(\file_exists($style)) { return true; } |
|
| 41 | +if (\file_exists($style)) { return true; } |
|
| 42 | 42 | // |
| 43 | 43 | $sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16'); |
| 44 | 44 | $sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32'); |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | $GLOBALS['xoopsTpl']->assign('wgsitenotice_url', \WGSITENOTICE_URL); |
| 28 | 28 | // |
| 29 | 29 | $GLOBALS['xoopsTpl']->assign('admin', \WGSITENOTICE_ADMIN); |
| 30 | -if ( $helper->getConfig('show_copyright') ) { |
|
| 30 | +if ($helper->getConfig('show_copyright')) { |
|
| 31 | 31 | $GLOBALS['xoopsTpl']->assign('copyright', $copyright); |
| 32 | 32 | } |
| 33 | 33 | // User footer |
| 34 | -include_once \XOOPS_ROOT_PATH.'/footer.php'; |
|
| 35 | 34 | \ No newline at end of file |
| 35 | +include_once \XOOPS_ROOT_PATH . '/footer.php'; |
|
| 36 | 36 | \ No newline at end of file |
@@ -80,9 +80,9 @@ discard block |
||
| 80 | 80 | $form = new \XoopsThemeForm($title, 'form', $action, 'post', true); |
| 81 | 81 | $form->setExtra('enctype="multipart/form-data"'); |
| 82 | 82 | // Form Text version_name |
| 83 | - $form->addElement( new \XoopsFormText(\_AM_WGSITENOTICE_VERSION_NAME, 'version_name', 50, 255, $this->getVar('version_name')), true ); |
|
| 83 | + $form->addElement(new \XoopsFormText(\_AM_WGSITENOTICE_VERSION_NAME, 'version_name', 50, 255, $this->getVar('version_name')), true); |
|
| 84 | 84 | // Form Text version_lang |
| 85 | - $form->addElement( new \XoopsFormText(\_AM_WGSITENOTICE_VERSION_LANG, 'version_lang', 50, 255, $this->getVar('version_lang')) ); |
|
| 85 | + $form->addElement(new \XoopsFormText(\_AM_WGSITENOTICE_VERSION_LANG, 'version_lang', 50, 255, $this->getVar('version_lang'))); |
|
| 86 | 86 | // Form Text Area |
| 87 | 87 | // Form Dhtml Text Area |
| 88 | 88 | $editor_configs = []; |
@@ -93,18 +93,18 @@ discard block |
||
| 93 | 93 | $editor_configs['width'] = '100%'; |
| 94 | 94 | $editor_configs['height'] = '400px'; |
| 95 | 95 | $editor_configs['editor'] = $helper->getConfig('wgsitenotice_editor'); |
| 96 | - $form->addElement( new \XoopsFormEditor(\_AM_WGSITENOTICE_VERSION_DESCR, 'version_descr', $editor_configs) ); |
|
| 96 | + $form->addElement(new \XoopsFormEditor(\_AM_WGSITENOTICE_VERSION_DESCR, 'version_descr', $editor_configs)); |
|
| 97 | 97 | // Form Text version_author |
| 98 | 98 | $version_author = $this->isNew() ? $GLOBALS['xoopsUser']->getVar('uname') : $this->getVar('version_author'); |
| 99 | - $form->addElement( new \XoopsFormText(\_AM_WGSITENOTICE_VERSION_AUTHOR, 'version_author', 50, 255, $version_author) ); |
|
| 99 | + $form->addElement(new \XoopsFormText(\_AM_WGSITENOTICE_VERSION_AUTHOR, 'version_author', 50, 255, $version_author)); |
|
| 100 | 100 | // Form Text version_weight |
| 101 | - $form->addElement( new \XoopsFormHidden('version_weight', $this->getVar('version_weight')) ); |
|
| 101 | + $form->addElement(new \XoopsFormHidden('version_weight', $this->getVar('version_weight'))); |
|
| 102 | 102 | // Form Radio Yes/No version_current |
| 103 | 103 | $version_current = $this->isNew() ? 0 : $this->getVar('version_current'); |
| 104 | - $form->addElement( new \XoopsFormRadioYN(\_AM_WGSITENOTICE_VERSION_CURRENT, 'version_current', $version_current), true ); |
|
| 104 | + $form->addElement(new \XoopsFormRadioYN(\_AM_WGSITENOTICE_VERSION_CURRENT, 'version_current', $version_current), true); |
|
| 105 | 105 | // Form Radio Yes/No |
| 106 | 106 | $version_online = $this->isNew() ? 0 : $this->getVar('version_online'); |
| 107 | - $form->addElement( new \XoopsFormRadioYN(\_AM_WGSITENOTICE_VERSION_ONLINE, 'version_online', $version_online), true ); |
|
| 107 | + $form->addElement(new \XoopsFormRadioYN(\_AM_WGSITENOTICE_VERSION_ONLINE, 'version_online', $version_online), true); |
|
| 108 | 108 | // Form Text Date Select |
| 109 | 109 | //$form->addElement( new \XoopsFormTextDateSelect(\_AM_WGSITENOTICE_VERSION_DATE, 'version_date', '', $this->getVar('version_date')), true ); |
| 110 | 110 | // Send |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | $Handler = $helper->getHandler('Versions'); |
| 87 | 87 | $_select = new \XoopsFormSelect(\_AM_WGSITENOTICE_CONT_VERSION_ID, 'cont_version_id', $this->getVar('cont_version_id')); |
| 88 | 88 | $_select->addOptionArray($Handler->getList()); |
| 89 | - $form->addElement( $_select ); |
|
| 89 | + $form->addElement($_select); |
|
| 90 | 90 | // Form cont_header |
| 91 | - $form->addElement( new \XoopsFormText(\_AM_WGSITENOTICE_CONT_HEADER, 'cont_header', 50, 255, $this->getVar('cont_header')), true ); |
|
| 91 | + $form->addElement(new \XoopsFormText(\_AM_WGSITENOTICE_CONT_HEADER, 'cont_header', 50, 255, $this->getVar('cont_header')), true); |
|
| 92 | 92 | // Form cont_text |
| 93 | 93 | $editor_configs = []; |
| 94 | 94 | $editor_configs['name'] = 'cont_text'; |
@@ -98,10 +98,10 @@ discard block |
||
| 98 | 98 | $editor_configs['width'] = '100%'; |
| 99 | 99 | $editor_configs['height'] = '400px'; |
| 100 | 100 | $editor_configs['editor'] = $helper->getConfig('wgsitenotice_editor'); |
| 101 | - $form->addElement( new \XoopsFormEditor(\_AM_WGSITENOTICE_CONT_TEXT, 'cont_text', $editor_configs) ); |
|
| 101 | + $form->addElement(new \XoopsFormEditor(\_AM_WGSITENOTICE_CONT_TEXT, 'cont_text', $editor_configs)); |
|
| 102 | 102 | // Form Text cont_weight |
| 103 | 103 | $cont_weight = $this->isNew() ? 1 : $this->getVar('cont_weight'); |
| 104 | - $form->addElement( new \XoopsFormText(\_AM_WGSITENOTICE_CONT_WEIGHT, 'cont_weight', 50, 255, $cont_weight), true ); |
|
| 104 | + $form->addElement(new \XoopsFormText(\_AM_WGSITENOTICE_CONT_WEIGHT, 'cont_weight', 50, 255, $cont_weight), true); |
|
| 105 | 105 | // Form Text Date Select |
| 106 | 106 | //$form->addElement( new \XoopsFormTextDateSelect(\_AM_WGSITENOTICE_CONT_DATE, 'cont_date', '', $this->getVar('cont_date')), true ); |
| 107 | 107 | // Send |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | //execute post |
| 72 | 72 | $result = \curl_exec($ch); |
| 73 | 73 | // print_r(\curl_getinfo($ch)); |
| 74 | - if (false == $result) { |
|
| 74 | + if (false == $result) { |
|
| 75 | 75 | //echo '<br>unexpected curl_error:' . \curl_error($ch) . '<br>'; |
| 76 | - $GLOBALS['xoopsTpl']->assign('error',\curl_error($ch)); |
|
| 76 | + $GLOBALS['xoopsTpl']->assign('error', \curl_error($ch)); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | \curl_close($ch); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | ] |
| 87 | 87 | ]; |
| 88 | 88 | |
| 89 | - $context = \stream_context_create($opts); |
|
| 89 | + $context = \stream_context_create($opts); |
|
| 90 | 90 | $result = \file_get_contents($oc_server, false, $context); |
| 91 | 91 | } |
| 92 | 92 | return $result; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * @param string $xml_string |
| 99 | 99 | * @return array|\SimpleXMLElement|string |
| 100 | 100 | */ |
| 101 | - public function readXML(string $xml_string){ |
|
| 101 | + public function readXML(string $xml_string) { |
|
| 102 | 102 | // creating temporary string for avoiding entitiy errors |
| 103 | 103 | $xml_string = \str_replace('&', '[[avoid_entity_error]]', $xml_string); |
| 104 | 104 | $xml_arr = \simplexml_load_string($xml_string); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $errors = \libxml_get_errors(); |
| 109 | 109 | foreach ($errors as $error) { |
| 110 | 110 | //echo $this->display_xml_error($error, $xml); |
| 111 | - $GLOBALS['xoopsTpl']->assign('error',$this->display_xml_error($error, $xml)); |
|
| 111 | + $GLOBALS['xoopsTpl']->assign('error', $this->display_xml_error($error, $xml)); |
|
| 112 | 112 | } |
| 113 | 113 | \libxml_clear_errors(); |
| 114 | 114 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @param string $xml |
| 123 | 123 | * @return string |
| 124 | 124 | */ |
| 125 | - public function xml2str(string $xml){ |
|
| 125 | + public function xml2str(string $xml) { |
|
| 126 | 126 | // replace temporary string for avoiding entitiy errors |
| 127 | 127 | $str = \str_replace('[[avoid_entity_error]]', '&', (string)$xml); |
| 128 | 128 | // rebuild html tags |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $skip = false; |
| 95 | 95 | $options = ''; |
| 96 | 96 | // start table definition |
| 97 | - $tableName = $this->getTableName ($line); |
|
| 97 | + $tableName = $this->getTableName($line); |
|
| 98 | 98 | $tables[$tableName] = []; |
| 99 | 99 | $tables[$tableName]['options'] = ''; |
| 100 | 100 | $tables[$tableName]['columns'] = []; |
@@ -183,10 +183,10 @@ discard block |
||
| 183 | 183 | * @param string $line |
| 184 | 184 | * @return string|bool |
| 185 | 185 | */ |
| 186 | - private function getTableName (string $line) |
|
| 186 | + private function getTableName(string $line) |
|
| 187 | 187 | { |
| 188 | 188 | |
| 189 | - $arrLine = \explode( '`', $line); |
|
| 189 | + $arrLine = \explode('`', $line); |
|
| 190 | 190 | if (\count($arrLine) > 0) { |
| 191 | 191 | return $arrLine[1]; |
| 192 | 192 | } |
@@ -201,12 +201,12 @@ discard block |
||
| 201 | 201 | * @param string $line |
| 202 | 202 | * @return array|bool |
| 203 | 203 | */ |
| 204 | - private function getColumns (string $line) |
|
| 204 | + private function getColumns(string $line) |
|
| 205 | 205 | { |
| 206 | 206 | |
| 207 | 207 | $columns = []; |
| 208 | 208 | |
| 209 | - $arrCol = \explode( ' ', \trim($line)); |
|
| 209 | + $arrCol = \explode(' ', \trim($line)); |
|
| 210 | 210 | if (\count($arrCol) > 0) { |
| 211 | 211 | $name = \str_replace(['`'], '', $arrCol[0]); |
| 212 | 212 | } else { |
@@ -217,9 +217,9 @@ discard block |
||
| 217 | 217 | $columns['name'] = $name; |
| 218 | 218 | // update quotes |
| 219 | 219 | if (\strpos($attributes, "''") > 0) { |
| 220 | - $attributes = \trim(\str_replace("''", "''''''''" , $attributes)); |
|
| 220 | + $attributes = \trim(\str_replace("''", "''''''''", $attributes)); |
|
| 221 | 221 | } elseif (\strpos($attributes, "'") > 0) { |
| 222 | - $attributes = \trim(\str_replace("'", "''" , $attributes)); |
|
| 222 | + $attributes = \trim(\str_replace("'", "''", $attributes)); |
|
| 223 | 223 | } |
| 224 | 224 | $columns['attributes'] = "' " . $attributes . " '"; |
| 225 | 225 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * @param string $options |
| 235 | 235 | * @return void |
| 236 | 236 | */ |
| 237 | - private function getOptions (string $line, string &$options): void |
|
| 237 | + private function getOptions(string $line, string &$options): void |
|
| 238 | 238 | { |
| 239 | 239 | |
| 240 | 240 | $lineText = \trim(\str_replace([')', ';'], '', $line)); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | * @param string $line |
| 254 | 254 | * @return array |
| 255 | 255 | */ |
| 256 | - private function getKey (string $line) |
|
| 256 | + private function getKey(string $line) |
|
| 257 | 257 | { |
| 258 | 258 | |
| 259 | 259 | $key = []; |
@@ -276,11 +276,11 @@ discard block |
||
| 276 | 276 | if ('' == $name) { |
| 277 | 277 | $name = $columns; |
| 278 | 278 | } |
| 279 | - if (\strpos($name,' ') > 0) { |
|
| 279 | + if (\strpos($name, ' ') > 0) { |
|
| 280 | 280 | $name = "'" . $name . "'"; |
| 281 | 281 | } |
| 282 | 282 | $key[$name] = []; |
| 283 | - if (\strpos($columns,' ') > 0) { |
|
| 283 | + if (\strpos($columns, ' ') > 0) { |
|
| 284 | 284 | $columns = "'" . $columns . "'"; |
| 285 | 285 | } |
| 286 | 286 | $key[$name]['columns'] = $columns; |