@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | use XoopsModules\Wggithub\Constants; |
| 26 | 26 | use XoopsModules\Wggithub\Common; |
| 27 | 27 | |
| 28 | -require __DIR__ . '/header.php'; |
|
| 28 | +require __DIR__.'/header.php'; |
|
| 29 | 29 | $GLOBALS['xoopsOption']['template_main'] = 'wggithub_readmes.tpl'; |
| 30 | -include_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 30 | +include_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 31 | 31 | |
| 32 | 32 | $op = Request::getCmd('op', 'list'); |
| 33 | 33 | $start = Request::getInt('start', 0); |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | unset($readmes); |
| 69 | 69 | // Display Navigation |
| 70 | 70 | if ($readmesCount > $limit) { |
| 71 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 72 | - $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
| 71 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 72 | + $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
| 73 | 73 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
| 74 | 74 | } |
| 75 | 75 | $GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type')); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $xoBreadcrumbs[] = ['title' => _MA_WGGITHUB_READMES]; |
| 84 | 84 | |
| 85 | 85 | // Keywords |
| 86 | -wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords)); |
|
| 86 | +wggithubMetaKeywords($helper->getConfig('keywords').', '.\implode(',', $keywords)); |
|
| 87 | 87 | unset($keywords); |
| 88 | 88 | |
| 89 | 89 | // Description |
@@ -91,4 +91,4 @@ discard block |
||
| 91 | 91 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/readmes.php'); |
| 92 | 92 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
| 93 | 93 | |
| 94 | -require __DIR__ . '/footer.php'; |
|
| 94 | +require __DIR__.'/footer.php'; |
|
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | use XoopsModules\Wggithub; |
| 25 | 25 | use XoopsModules\Wggithub\Constants; |
| 26 | 26 | |
| 27 | -require __DIR__ . '/header.php'; |
|
| 27 | +require __DIR__.'/header.php'; |
|
| 28 | 28 | |
| 29 | 29 | // Template Index |
| 30 | 30 | $templateMain = 'wggithub_admin_permissions.tpl'; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $op = Request::getCmd('op', 'global'); |
| 34 | 34 | |
| 35 | 35 | // Get Form |
| 36 | -include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php'; |
|
| 36 | +include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php'; |
|
| 37 | 37 | \xoops_load('XoopsFormLoader'); |
| 38 | 38 | |
| 39 | 39 | $formTitle = \_AM_WGGITHUB_PERMISSIONS_GLOBAL; |
@@ -61,4 +61,4 @@ discard block |
||
| 61 | 61 | exit(); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | -require __DIR__ . '/footer.php'; |
|
| 64 | +require __DIR__.'/footer.php'; |
|
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | Github\Releases, |
| 31 | 31 | }; |
| 32 | 32 | |
| 33 | -require __DIR__ . '/header.php'; |
|
| 33 | +require __DIR__.'/header.php'; |
|
| 34 | 34 | $GLOBALS['xoopsOption']['template_main'] = 'wggithub_index.tpl'; |
| 35 | -include_once \XOOPS_ROOT_PATH . '/header.php'; |
|
| 35 | +include_once \XOOPS_ROOT_PATH.'/header.php'; |
|
| 36 | 36 | // Define Stylesheet |
| 37 | 37 | $GLOBALS['xoTheme']->addStylesheet($style, null); |
| 38 | 38 | $keywords = []; |
@@ -165,4 +165,4 @@ discard block |
||
| 165 | 165 | var_dump($result); |
| 166 | 166 | */ |
| 167 | 167 | |
| 168 | -require __DIR__ . '/footer.php'; |
|
| 168 | +require __DIR__.'/footer.php'; |
|
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | if (isset($CurrentBlock['continuable'])) |
| 211 | 211 | { |
| 212 | - $methodName = 'block' . $CurrentBlock['type'] . 'Continue'; |
|
| 212 | + $methodName = 'block'.$CurrentBlock['type'].'Continue'; |
|
| 213 | 213 | $Block = $this->$methodName($Line, $CurrentBlock); |
| 214 | 214 | |
| 215 | 215 | if (isset($Block)) |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | } else { |
| 221 | 221 | if ($this->isBlockCompletable($CurrentBlock['type'])) |
| 222 | 222 | { |
| 223 | - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; |
|
| 223 | + $methodName = 'block'.$CurrentBlock['type'].'Complete'; |
|
| 224 | 224 | $CurrentBlock = $this->$methodName($CurrentBlock); |
| 225 | 225 | } |
| 226 | 226 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | { |
| 239 | 239 | foreach ($this->BlockTypes[$marker] as $blockType) |
| 240 | 240 | { |
| 241 | - $blockTypes []= $blockType; |
|
| 241 | + $blockTypes [] = $blockType; |
|
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | { |
| 254 | 254 | $Block['type'] = $blockType; |
| 255 | 255 | |
| 256 | - if ( ! isset($Block['identified'])) |
|
| 256 | + if (!isset($Block['identified'])) |
|
| 257 | 257 | { |
| 258 | 258 | if (isset($CurrentBlock)) |
| 259 | 259 | { |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | if (isset($CurrentBlock['continuable']) and $this->isBlockCompletable($CurrentBlock['type'])) |
| 302 | 302 | { |
| 303 | - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; |
|
| 303 | + $methodName = 'block'.$CurrentBlock['type'].'Complete'; |
|
| 304 | 304 | $CurrentBlock = $this->$methodName($CurrentBlock); |
| 305 | 305 | } |
| 306 | 306 | |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | protected function extractElement(array $Component) |
| 320 | 320 | { |
| 321 | - if ( ! isset($Component['element'])) |
|
| 321 | + if (!isset($Component['element'])) |
|
| 322 | 322 | { |
| 323 | 323 | if (isset($Component['markup'])) |
| 324 | 324 | { |
@@ -333,12 +333,12 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | protected function isBlockContinuable($Type) |
| 335 | 335 | { |
| 336 | - return method_exists($this, 'block' . $Type . 'Continue'); |
|
| 336 | + return method_exists($this, 'block'.$Type.'Continue'); |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | protected function isBlockCompletable($Type) |
| 340 | 340 | { |
| 341 | - return method_exists($this, 'block' . $Type . 'Complete'); |
|
| 341 | + return method_exists($this, 'block'.$Type.'Complete'); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | # |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | |
| 347 | 347 | protected function blockCode($Line, $Block = null) |
| 348 | 348 | { |
| 349 | - if (isset($Block) and $Block['type'] === 'Paragraph' and ! isset($Block['interrupted'])) |
|
| 349 | + if (isset($Block) and $Block['type'] === 'Paragraph' and !isset($Block['interrupted'])) |
|
| 350 | 350 | { |
| 351 | 351 | return; |
| 352 | 352 | } |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | return; |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | - $Block['element']['rawHtml'] .= "\n" . $Line['body']; |
|
| 433 | + $Block['element']['rawHtml'] .= "\n".$Line['body']; |
|
| 434 | 434 | |
| 435 | 435 | if (strpos($Line['text'], '-->') !== false) |
| 436 | 436 | { |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | return $Block; |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | - $Block['element']['element']['text'] .= "\n" . $Line['body']; |
|
| 524 | + $Block['element']['element']['text'] .= "\n".$Line['body']; |
|
| 525 | 525 | |
| 526 | 526 | return $Block; |
| 527 | 527 | } |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | |
| 555 | 555 | $Block = array( |
| 556 | 556 | 'element' => array( |
| 557 | - 'name' => 'h' . $level, |
|
| 557 | + 'name' => 'h'.$level, |
|
| 558 | 558 | 'handler' => array( |
| 559 | 559 | 'function' => 'lineElements', |
| 560 | 560 | 'argument' => $text, |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | { |
| 582 | 582 | $contentIndent -= 1; |
| 583 | 583 | $matches[1] = substr($matches[1], 0, -$contentIndent); |
| 584 | - $matches[3] = str_repeat(' ', $contentIndent) . $matches[3]; |
|
| 584 | + $matches[3] = str_repeat(' ', $contentIndent).$matches[3]; |
|
| 585 | 585 | } elseif ($contentIndent === 0) { |
| 586 | 586 | $matches[1] .= ' '; |
| 587 | 587 | } |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | if ( |
| 613 | 613 | isset($CurrentBlock) |
| 614 | 614 | and $CurrentBlock['type'] === 'Paragraph' |
| 615 | - and ! isset($CurrentBlock['interrupted']) |
|
| 615 | + and !isset($CurrentBlock['interrupted']) |
|
| 616 | 616 | ) { |
| 617 | 617 | return; |
| 618 | 618 | } |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | ) |
| 631 | 631 | ); |
| 632 | 632 | |
| 633 | - $Block['element']['elements'] []= & $Block['li']; |
|
| 633 | + $Block['element']['elements'] [] = & $Block['li']; |
|
| 634 | 634 | |
| 635 | 635 | return $Block; |
| 636 | 636 | } |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | ) |
| 658 | 658 | ) { |
| 659 | 659 | if (isset($Block['interrupted'])) { |
| 660 | - $Block['li']['handler']['argument'] []= ''; |
|
| 660 | + $Block['li']['handler']['argument'] [] = ''; |
|
| 661 | 661 | |
| 662 | 662 | $Block['loose'] = true; |
| 663 | 663 | |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | ) |
| 680 | 680 | ); |
| 681 | 681 | |
| 682 | - $Block['element']['elements'] []= & $Block['li']; |
|
| 682 | + $Block['element']['elements'] [] = & $Block['li']; |
|
| 683 | 683 | |
| 684 | 684 | return $Block; |
| 685 | 685 | } elseif ($Line['indent'] < $requiredIndent and $this->blockList($Line)) { |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | if ($Line['indent'] >= $requiredIndent) { |
| 694 | 694 | if (isset($Block['interrupted'])) |
| 695 | 695 | { |
| 696 | - $Block['li']['handler']['argument'] []= ''; |
|
| 696 | + $Block['li']['handler']['argument'] [] = ''; |
|
| 697 | 697 | |
| 698 | 698 | $Block['loose'] = true; |
| 699 | 699 | |
@@ -702,15 +702,15 @@ discard block |
||
| 702 | 702 | |
| 703 | 703 | $text = substr($Line['body'], $requiredIndent); |
| 704 | 704 | |
| 705 | - $Block['li']['handler']['argument'] []= $text; |
|
| 705 | + $Block['li']['handler']['argument'] [] = $text; |
|
| 706 | 706 | |
| 707 | 707 | return $Block; |
| 708 | 708 | } |
| 709 | 709 | |
| 710 | - if ( ! isset($Block['interrupted'])) { |
|
| 710 | + if (!isset($Block['interrupted'])) { |
|
| 711 | 711 | $text = preg_replace('/^[ ]{0,'.$requiredIndent.'}+/', '', $Line['body']); |
| 712 | 712 | |
| 713 | - $Block['li']['handler']['argument'] []= $text; |
|
| 713 | + $Block['li']['handler']['argument'] [] = $text; |
|
| 714 | 714 | |
| 715 | 715 | return $Block; |
| 716 | 716 | } |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | { |
| 724 | 724 | if (end($li['handler']['argument']) !== '') |
| 725 | 725 | { |
| 726 | - $li['handler']['argument'] []= ''; |
|
| 726 | + $li['handler']['argument'] [] = ''; |
|
| 727 | 727 | } |
| 728 | 728 | } |
| 729 | 729 | } |
@@ -759,13 +759,13 @@ discard block |
||
| 759 | 759 | } |
| 760 | 760 | |
| 761 | 761 | if ($Line['text'][0] === '>' and preg_match('/^>[ ]?+(.*+)/', $Line['text'], $matches)) { |
| 762 | - $Block['element']['handler']['argument'] []= $matches[1]; |
|
| 762 | + $Block['element']['handler']['argument'] [] = $matches[1]; |
|
| 763 | 763 | |
| 764 | 764 | return $Block; |
| 765 | 765 | } |
| 766 | 766 | |
| 767 | - if ( ! isset($Block['interrupted'])) { |
|
| 768 | - $Block['element']['handler']['argument'] []= $Line['text']; |
|
| 767 | + if (!isset($Block['interrupted'])) { |
|
| 768 | + $Block['element']['handler']['argument'] [] = $Line['text']; |
|
| 769 | 769 | |
| 770 | 770 | return $Block; |
| 771 | 771 | } |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | |
| 795 | 795 | protected function blockSetextHeader($Line, array $Block = null) |
| 796 | 796 | { |
| 797 | - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { |
|
| 797 | + if (!isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { |
|
| 798 | 798 | return; |
| 799 | 799 | } |
| 800 | 800 | |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | return; |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | - $Block['element']['rawHtml'] .= "\n" . $Line['body']; |
|
| 842 | + $Block['element']['rawHtml'] .= "\n".$Line['body']; |
|
| 843 | 843 | |
| 844 | 844 | return $Block; |
| 845 | 845 | } |
@@ -874,7 +874,7 @@ discard block |
||
| 874 | 874 | |
| 875 | 875 | protected function blockTable($Line, array $Block = null) |
| 876 | 876 | { |
| 877 | - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { |
|
| 877 | + if (!isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { |
|
| 878 | 878 | return; |
| 879 | 879 | } |
| 880 | 880 | |
@@ -917,7 +917,7 @@ discard block |
||
| 917 | 917 | $alignment = $alignment === 'left' ? 'center' : 'right'; |
| 918 | 918 | } |
| 919 | 919 | |
| 920 | - $alignments []= $alignment; |
|
| 920 | + $alignments [] = $alignment; |
|
| 921 | 921 | } |
| 922 | 922 | |
| 923 | 923 | # ~ |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | ); |
| 956 | 956 | } |
| 957 | 957 | |
| 958 | - $HeaderElements []= $HeaderElement; |
|
| 958 | + $HeaderElements [] = $HeaderElement; |
|
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | # ~ |
@@ -969,16 +969,16 @@ discard block |
||
| 969 | 969 | ), |
| 970 | 970 | ); |
| 971 | 971 | |
| 972 | - $Block['element']['elements'] []= array( |
|
| 972 | + $Block['element']['elements'] [] = array( |
|
| 973 | 973 | 'name' => 'thead', |
| 974 | 974 | ); |
| 975 | 975 | |
| 976 | - $Block['element']['elements'] []= array( |
|
| 976 | + $Block['element']['elements'] [] = array( |
|
| 977 | 977 | 'name' => 'tbody', |
| 978 | 978 | 'elements' => array(), |
| 979 | 979 | ); |
| 980 | 980 | |
| 981 | - $Block['element']['elements'][0]['elements'] []= array( |
|
| 981 | + $Block['element']['elements'][0]['elements'] [] = array( |
|
| 982 | 982 | 'name' => 'tr', |
| 983 | 983 | 'elements' => $HeaderElements, |
| 984 | 984 | ); |
@@ -1021,11 +1021,11 @@ discard block |
||
| 1021 | 1021 | if (isset($Block['alignments'][$index])) |
| 1022 | 1022 | { |
| 1023 | 1023 | $Element['attributes'] = array( |
| 1024 | - 'style' => 'text-align: ' . $Block['alignments'][$index] . ';', |
|
| 1024 | + 'style' => 'text-align: '.$Block['alignments'][$index].';', |
|
| 1025 | 1025 | ); |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | - $Elements []= $Element; |
|
| 1028 | + $Elements [] = $Element; |
|
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | $Element = array( |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | 'elements' => $Elements, |
| 1034 | 1034 | ); |
| 1035 | 1035 | |
| 1036 | - $Block['element']['elements'][1]['elements'] []= $Element; |
|
| 1036 | + $Block['element']['elements'][1]['elements'] [] = $Element; |
|
| 1037 | 1037 | |
| 1038 | 1038 | return $Block; |
| 1039 | 1039 | } |
@@ -1133,7 +1133,7 @@ discard block |
||
| 1133 | 1133 | |
| 1134 | 1134 | $Inline = $this->{"inline$inlineType"}($Excerpt); |
| 1135 | 1135 | |
| 1136 | - if ( ! isset($Inline)) |
|
| 1136 | + if (!isset($Inline)) |
|
| 1137 | 1137 | { |
| 1138 | 1138 | continue; |
| 1139 | 1139 | } |
@@ -1147,7 +1147,7 @@ discard block |
||
| 1147 | 1147 | |
| 1148 | 1148 | # sets a default inline position |
| 1149 | 1149 | |
| 1150 | - if ( ! isset($Inline['position'])) |
|
| 1150 | + if (!isset($Inline['position'])) |
|
| 1151 | 1151 | { |
| 1152 | 1152 | $Inline['position'] = $markerPosition; |
| 1153 | 1153 | } |
@@ -1191,7 +1191,7 @@ discard block |
||
| 1191 | 1191 | |
| 1192 | 1192 | foreach ($Elements as &$Element) |
| 1193 | 1193 | { |
| 1194 | - if ( ! isset($Element['autobreak'])) |
|
| 1194 | + if (!isset($Element['autobreak'])) |
|
| 1195 | 1195 | { |
| 1196 | 1196 | $Element['autobreak'] = false; |
| 1197 | 1197 | } |
@@ -1247,14 +1247,14 @@ discard block |
||
| 1247 | 1247 | $hostnameLabel = '[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?'; |
| 1248 | 1248 | |
| 1249 | 1249 | $commonMarkEmail = '[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]++@' |
| 1250 | - . $hostnameLabel . '(?:\.' . $hostnameLabel . ')*'; |
|
| 1250 | + . $hostnameLabel.'(?:\.'.$hostnameLabel.')*'; |
|
| 1251 | 1251 | |
| 1252 | 1252 | if (strpos($Excerpt['text'], '>') !== false |
| 1253 | 1253 | and preg_match("/^<((mailto:)?$commonMarkEmail)>/i", $Excerpt['text'], $matches) |
| 1254 | - ){ |
|
| 1254 | + ) { |
|
| 1255 | 1255 | $url = $matches[1]; |
| 1256 | 1256 | |
| 1257 | - if ( ! isset($matches[2])) |
|
| 1257 | + if (!isset($matches[2])) |
|
| 1258 | 1258 | { |
| 1259 | 1259 | $url = "mailto:$url"; |
| 1260 | 1260 | } |
@@ -1274,7 +1274,7 @@ discard block |
||
| 1274 | 1274 | |
| 1275 | 1275 | protected function inlineEmphasis($Excerpt) |
| 1276 | 1276 | { |
| 1277 | - if ( ! isset($Excerpt['text'][1])) |
|
| 1277 | + if (!isset($Excerpt['text'][1])) |
|
| 1278 | 1278 | { |
| 1279 | 1279 | return; |
| 1280 | 1280 | } |
@@ -1320,12 +1320,12 @@ discard block |
||
| 1320 | 1320 | |
| 1321 | 1321 | protected function inlineImage($Excerpt) |
| 1322 | 1322 | { |
| 1323 | - if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') |
|
| 1323 | + if (!isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') |
|
| 1324 | 1324 | { |
| 1325 | 1325 | return; |
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | - $Excerpt['text']= substr($Excerpt['text'], 1); |
|
| 1328 | + $Excerpt['text'] = substr($Excerpt['text'], 1); |
|
| 1329 | 1329 | |
| 1330 | 1330 | $Link = $this->inlineLink($Excerpt); |
| 1331 | 1331 | |
@@ -1411,7 +1411,7 @@ discard block |
||
| 1411 | 1411 | $definition = strtolower($Element['handler']['argument']); |
| 1412 | 1412 | } |
| 1413 | 1413 | |
| 1414 | - if ( ! isset($this->DefinitionData['Reference'][$definition])) |
|
| 1414 | + if (!isset($this->DefinitionData['Reference'][$definition])) |
|
| 1415 | 1415 | { |
| 1416 | 1416 | return; |
| 1417 | 1417 | } |
@@ -1466,7 +1466,7 @@ discard block |
||
| 1466 | 1466 | and preg_match('/^&(#?+[0-9a-zA-Z]++);/', $Excerpt['text'], $matches) |
| 1467 | 1467 | ) { |
| 1468 | 1468 | return array( |
| 1469 | - 'element' => array('rawHtml' => '&' . $matches[1] . ';'), |
|
| 1469 | + 'element' => array('rawHtml' => '&'.$matches[1].';'), |
|
| 1470 | 1470 | 'extent' => strlen($matches[0]), |
| 1471 | 1471 | ); |
| 1472 | 1472 | } |
@@ -1476,7 +1476,7 @@ discard block |
||
| 1476 | 1476 | |
| 1477 | 1477 | protected function inlineStrikethrough($Excerpt) |
| 1478 | 1478 | { |
| 1479 | - if ( ! isset($Excerpt['text'][1])) |
|
| 1479 | + if (!isset($Excerpt['text'][1])) |
|
| 1480 | 1480 | { |
| 1481 | 1481 | return; |
| 1482 | 1482 | } |
@@ -1499,7 +1499,7 @@ discard block |
||
| 1499 | 1499 | |
| 1500 | 1500 | protected function inlineUrl($Excerpt) |
| 1501 | 1501 | { |
| 1502 | - if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') |
|
| 1502 | + if ($this->urlsLinked !== true or !isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') |
|
| 1503 | 1503 | { |
| 1504 | 1504 | return; |
| 1505 | 1505 | } |
@@ -1670,7 +1670,7 @@ discard block |
||
| 1670 | 1670 | |
| 1671 | 1671 | if ($hasName) |
| 1672 | 1672 | { |
| 1673 | - $markup .= '<' . $Element['name']; |
|
| 1673 | + $markup .= '<'.$Element['name']; |
|
| 1674 | 1674 | |
| 1675 | 1675 | if (isset($Element['attributes'])) |
| 1676 | 1676 | { |
@@ -1728,7 +1728,7 @@ discard block |
||
| 1728 | 1728 | } |
| 1729 | 1729 | } |
| 1730 | 1730 | |
| 1731 | - $markup .= $hasName ? '</' . $Element['name'] . '>' : ''; |
|
| 1731 | + $markup .= $hasName ? '</'.$Element['name'].'>' : ''; |
|
| 1732 | 1732 | } |
| 1733 | 1733 | elseif ($hasName) |
| 1734 | 1734 | { |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | // (autobreak === false) covers both sides of an element |
| 1758 | 1758 | $autoBreak = !$autoBreak ? $autoBreak : $autoBreakNext; |
| 1759 | 1759 | |
| 1760 | - $markup .= ($autoBreak ? "\n" : '') . $this->element($Element); |
|
| 1760 | + $markup .= ($autoBreak ? "\n" : '').$this->element($Element); |
|
| 1761 | 1761 | $autoBreak = $autoBreakNext; |
| 1762 | 1762 | } |
| 1763 | 1763 | |
@@ -1772,7 +1772,7 @@ discard block |
||
| 1772 | 1772 | { |
| 1773 | 1773 | $Elements = $this->linesElements($lines); |
| 1774 | 1774 | |
| 1775 | - if ( ! in_array('', $lines) |
|
| 1775 | + if (!in_array('', $lines) |
|
| 1776 | 1776 | and isset($Elements[0]) and isset($Elements[0]['name']) |
| 1777 | 1777 | and $Elements[0]['name'] === 'p' |
| 1778 | 1778 | ) { |
@@ -1829,12 +1829,12 @@ discard block |
||
| 1829 | 1829 | protected function sanitiseElement(array $Element) |
| 1830 | 1830 | { |
| 1831 | 1831 | static $goodAttribute = '/^[a-zA-Z0-9][a-zA-Z0-9-_]*+$/'; |
| 1832 | - static $safeUrlNameToAtt = array( |
|
| 1832 | + static $safeUrlNameToAtt = array( |
|
| 1833 | 1833 | 'a' => 'href', |
| 1834 | 1834 | 'img' => 'src', |
| 1835 | 1835 | ); |
| 1836 | 1836 | |
| 1837 | - if ( ! isset($Element['name'])) |
|
| 1837 | + if (!isset($Element['name'])) |
|
| 1838 | 1838 | { |
| 1839 | 1839 | unset($Element['attributes']); |
| 1840 | 1840 | return $Element; |
@@ -1845,12 +1845,12 @@ discard block |
||
| 1845 | 1845 | $Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element['name']]); |
| 1846 | 1846 | } |
| 1847 | 1847 | |
| 1848 | - if ( ! empty($Element['attributes'])) |
|
| 1848 | + if (!empty($Element['attributes'])) |
|
| 1849 | 1849 | { |
| 1850 | 1850 | foreach ($Element['attributes'] as $att => $val) |
| 1851 | 1851 | { |
| 1852 | 1852 | # filter out badly parsed attribute |
| 1853 | - if ( ! preg_match($goodAttribute, $att)) |
|
| 1853 | + if (!preg_match($goodAttribute, $att)) |
|
| 1854 | 1854 | { |
| 1855 | 1855 | unset($Element['attributes'][$att]); |
| 1856 | 1856 | } |
@@ -1951,8 +1951,8 @@ discard block |
||
| 1951 | 1951 | protected $textLevelElements = array( |
| 1952 | 1952 | 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', |
| 1953 | 1953 | 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', |
| 1954 | - 'i', 'rp', 'del', 'code', 'strike', 'marquee', |
|
| 1955 | - 'q', 'rt', 'ins', 'font', 'strong', |
|
| 1954 | + 'i', 'rp', 'del', 'code', 'strike', 'marquee', |
|
| 1955 | + 'q', 'rt', 'ins', 'font', 'strong', |
|
| 1956 | 1956 | 's', 'tt', 'kbd', 'mark', |
| 1957 | 1957 | 'u', 'xm', 'sub', 'nobr', |
| 1958 | 1958 | 'sup', 'ruby', |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | Utility |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | -require_once dirname(__DIR__, 3) . '/include/cp_header.php'; |
|
| 28 | -require \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
| 27 | +require_once dirname(__DIR__, 3).'/include/cp_header.php'; |
|
| 28 | +require \dirname(__DIR__).'/preloads/autoloader.php'; |
|
| 29 | 29 | |
| 30 | 30 | $op = \Xmf\Request::getCmd('op', ''); |
| 31 | 31 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | loadSampleData(); |
| 46 | 46 | } else { |
| 47 | 47 | xoops_cp_header(); |
| 48 | - xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', \sprintf(\constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA_OK')), \constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
| 48 | + xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', \sprintf(\constant('CO_'.$moduleDirNameUpper.'_'.'ADD_SAMPLEDATA_OK')), \constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'), true); |
|
| 49 | 49 | xoops_cp_footer(); |
| 50 | 50 | } |
| 51 | 51 | break; |
@@ -68,20 +68,20 @@ discard block |
||
| 68 | 68 | $tables = Helper::getHelper($moduleDirName)->getModule()->getInfo('tables'); |
| 69 | 69 | |
| 70 | 70 | $language = 'english/'; |
| 71 | - if (\is_dir(__DIR__ . '/' . $xoopsConfig['language'])) { |
|
| 72 | - $language = $xoopsConfig['language'] . '/'; |
|
| 71 | + if (\is_dir(__DIR__.'/'.$xoopsConfig['language'])) { |
|
| 72 | + $language = $xoopsConfig['language'].'/'; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // load module tables |
| 76 | 76 | foreach ($tables as $table) { |
| 77 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
| 77 | + $tabledata = Yaml::readWrapped($language.$table.'.yml'); |
|
| 78 | 78 | TableLoad::truncateTable($table); |
| 79 | 79 | TableLoad::loadTableFromArray($table, $tabledata); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // load permissions |
| 83 | 83 | $table = 'group_permission'; |
| 84 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
| 84 | + $tabledata = Yaml::readWrapped($language.$table.'.yml'); |
|
| 85 | 85 | $mid = Helper::getHelper($moduleDirName)->getModule()->getVar('mid'); |
| 86 | 86 | loadTableFromArrayWithReplace($table, $tabledata, 'gperm_modid', $mid); |
| 87 | 87 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $utility::rcopy($src, $dest); |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS')); |
|
| 97 | + \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'SAMPLEDATA_SUCCESS')); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | function saveSampleData() |
@@ -108,23 +108,23 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $tables = Helper::getHelper($moduleDirName)->getModule()->getInfo('tables'); |
| 110 | 110 | |
| 111 | - $languageFolder = __DIR__ . '/' . $xoopsConfig['language']; |
|
| 112 | - if (!\file_exists($languageFolder . '/')) { |
|
| 113 | - Utility::createFolder($languageFolder . '/'); |
|
| 111 | + $languageFolder = __DIR__.'/'.$xoopsConfig['language']; |
|
| 112 | + if (!\file_exists($languageFolder.'/')) { |
|
| 113 | + Utility::createFolder($languageFolder.'/'); |
|
| 114 | 114 | } |
| 115 | - $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/'; |
|
| 115 | + $exportFolder = $languageFolder.'/Exports-'.date('Y-m-d-H-i-s').'/'; |
|
| 116 | 116 | Utility::createFolder($exportFolder); |
| 117 | 117 | |
| 118 | 118 | // save module tables |
| 119 | 119 | foreach ($tables as $table) { |
| 120 | - TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml'); |
|
| 120 | + TableLoad::saveTableToYamlFile($table, $exportFolder.$table.'.yml'); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | // save permissions |
| 124 | 124 | $criteria = new \CriteriaCompo(); |
| 125 | 125 | $criteria->add(new \Criteria('gperm_modid', Helper::getHelper($moduleDirName)->getModule()->getVar('mid'))); |
| 126 | 126 | $skipColumns[] = 'gperm_id'; |
| 127 | - TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns); |
|
| 127 | + TableLoad::saveTableToYamlFile('group_permission', $exportFolder.'group_permission.yml', $criteria, $skipColumns); |
|
| 128 | 128 | unset($criteria); |
| 129 | 129 | |
| 130 | 130 | // --- COPY test folder files --------------- |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | Utility::rcopy($src, $dest); |
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA_SUCCESS')); |
|
| 138 | + \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA_SUCCESS')); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | function exportSchema() |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | // |
| 151 | 151 | // \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS')); |
| 152 | 152 | } catch (\Exception $e) { |
| 153 | - exit(\constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR')); |
|
| 153 | + exit(\constant('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_ERROR')); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | } |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
| 174 | 174 | $prefixedTable = $db->prefix($table); |
| 175 | 175 | $count = 0; |
| 176 | - $sql = 'DELETE FROM ' . $prefixedTable . ' WHERE `' . $search . '`=' . $db->quote($replace); |
|
| 176 | + $sql = 'DELETE FROM '.$prefixedTable.' WHERE `'.$search.'`='.$db->quote($replace); |
|
| 177 | 177 | $db->queryF($sql); |
| 178 | 178 | foreach ($data as $row) { |
| 179 | - $insertInto = 'INSERT INTO ' . $prefixedTable . ' ('; |
|
| 179 | + $insertInto = 'INSERT INTO '.$prefixedTable.' ('; |
|
| 180 | 180 | $valueClause = ' VALUES ('; |
| 181 | 181 | $first = true; |
| 182 | 182 | foreach ($row as $column => $value) { |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $valueClause .= $db->quote($value); |
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | - $sql = $insertInto . ') ' . $valueClause . ')'; |
|
| 196 | + $sql = $insertInto.') '.$valueClause.')'; |
|
| 197 | 197 | $result = $db->queryF($sql); |
| 198 | 198 | if (false !== $result) { |
| 199 | 199 | ++$count; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $ret = wggithub_check_db($module); |
| 40 | 40 | |
| 41 | 41 | //check upload directory |
| 42 | - include_once __DIR__ . '/install.php'; |
|
| 42 | + include_once __DIR__.'/install.php'; |
|
| 43 | 43 | $ret = xoops_module_install_wggithub($module); |
| 44 | 44 | |
| 45 | 45 | $errors = $module->getErrors(); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | global $xoopsDB; |
| 63 | 63 | $result = $xoopsDB->query( |
| 64 | - 'SELECT t1.tpl_id FROM ' . $xoopsDB->prefix('tplfile') . ' t1, ' . $xoopsDB->prefix('tplfile') . ' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id' |
|
| 64 | + 'SELECT t1.tpl_id FROM '.$xoopsDB->prefix('tplfile').' t1, '.$xoopsDB->prefix('tplfile').' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id' |
|
| 65 | 65 | ); |
| 66 | 66 | $tplids = []; |
| 67 | 67 | while (false !== (list($tplid) = $xoopsDB->fetchRow($result))) { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | if (\count($tplids) > 0) { |
| 71 | 71 | $tplfileHandler = \xoops_getHandler('tplfile'); |
| 72 | - $duplicate_files = $tplfileHandler->getObjects(new \Criteria('tpl_id', '(' . \implode(',', $tplids) . ')', 'IN')); |
|
| 72 | + $duplicate_files = $tplfileHandler->getObjects(new \Criteria('tpl_id', '('.\implode(',', $tplids).')', 'IN')); |
|
| 73 | 73 | |
| 74 | 74 | if (\count($duplicate_files) > 0) { |
| 75 | 75 | foreach (\array_keys($duplicate_files) as $i) { |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | - $sql = 'SHOW INDEX FROM ' . $xoopsDB->prefix('tplfile') . " WHERE KEY_NAME = 'tpl_refid_module_set_file_type'"; |
|
| 80 | + $sql = 'SHOW INDEX FROM '.$xoopsDB->prefix('tplfile')." WHERE KEY_NAME = 'tpl_refid_module_set_file_type'"; |
|
| 81 | 81 | if (!$result = $xoopsDB->queryF($sql)) { |
| 82 | - xoops_error($xoopsDB->error() . '<br>' . $sql); |
|
| 82 | + xoops_error($xoopsDB->error().'<br>'.$sql); |
|
| 83 | 83 | |
| 84 | 84 | return false; |
| 85 | 85 | } |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | return true; |
| 94 | 94 | } |
| 95 | - $sql = 'ALTER TABLE ' . $xoopsDB->prefix('tplfile') . ' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )'; |
|
| 95 | + $sql = 'ALTER TABLE '.$xoopsDB->prefix('tplfile').' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )'; |
|
| 96 | 96 | if (!$result = $xoopsDB->queryF($sql)) { |
| 97 | - xoops_error($xoopsDB->error() . '<br>' . $sql); |
|
| 97 | + xoops_error($xoopsDB->error().'<br>'.$sql); |
|
| 98 | 98 | $module->setErrors("'tpl_refid_module_set_file_type' unique index is not added to 'tplfile' table. Warning: do not use XOOPS until you add this unique index."); |
| 99 | 99 | |
| 100 | 100 | return false; |
@@ -118,12 +118,12 @@ discard block |
||
| 118 | 118 | // Example: update table (add new field) |
| 119 | 119 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
| 120 | 120 | $field = 'repo_release'; |
| 121 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 121 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 122 | 122 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 123 | 123 | if (!$numRows) { |
| 124 | 124 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
| 125 | 125 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 126 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 126 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 127 | 127 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 128 | 128 | $ret = false; |
| 129 | 129 | } |
@@ -132,12 +132,12 @@ discard block |
||
| 132 | 132 | // Example: update table (add new field) |
| 133 | 133 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
| 134 | 134 | $field = 'repo_prerelease'; |
| 135 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 135 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 136 | 136 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 137 | 137 | if (!$numRows) { |
| 138 | 138 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
| 139 | 139 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 140 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 140 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 141 | 141 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 142 | 142 | $ret = false; |
| 143 | 143 | } |
@@ -145,12 +145,12 @@ discard block |
||
| 145 | 145 | // Example: update table (add new field) |
| 146 | 146 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
| 147 | 147 | $field = 'repo_readme'; |
| 148 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 148 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 149 | 149 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 150 | 150 | if (!$numRows) { |
| 151 | 151 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
| 152 | 152 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 153 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 153 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 154 | 154 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 155 | 155 | $ret = false; |
| 156 | 156 | } |
@@ -159,12 +159,12 @@ discard block |
||
| 159 | 159 | // Example: update table (add new field) |
| 160 | 160 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories'); |
| 161 | 161 | $field = 'dir_filterrelease'; |
| 162 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 162 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 163 | 163 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 164 | 164 | if (!$numRows) { |
| 165 | 165 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `dir_online`;"; |
| 166 | 166 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 167 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 167 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 168 | 168 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 169 | 169 | $ret = false; |
| 170 | 170 | } |
@@ -30,15 +30,15 @@ discard block |
||
| 30 | 30 | Github\Releases |
| 31 | 31 | }; |
| 32 | 32 | |
| 33 | -require __DIR__ . '/header.php'; |
|
| 33 | +require __DIR__.'/header.php'; |
|
| 34 | 34 | $GLOBALS['xoopsOption']['template_main'] = 'wggithub_index.tpl'; |
| 35 | -include_once \XOOPS_ROOT_PATH . '/header.php'; |
|
| 35 | +include_once \XOOPS_ROOT_PATH.'/header.php'; |
|
| 36 | 36 | |
| 37 | 37 | // Permissions |
| 38 | 38 | $permGlobalView = $permissionsHandler->getPermGlobalView(); |
| 39 | 39 | if (!$permGlobalView) { |
| 40 | 40 | $GLOBALS['xoopsTpl']->assign('error', _NOPERM); |
| 41 | - require __DIR__ . '/footer.php'; |
|
| 41 | + require __DIR__.'/footer.php'; |
|
| 42 | 42 | } |
| 43 | 43 | $permGlobalRead = $permissionsHandler->getPermGlobalRead(); |
| 44 | 44 | $permReadmeUpdate = $permissionsHandler->getPermReadmeUpdate(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | // Define Stylesheet |
| 54 | 54 | $GLOBALS['xoTheme']->addStylesheet($style, null); |
| 55 | -$GLOBALS['xoTheme']->addStylesheet(WGGITHUB_URL . '/assets/css/tabs.css', null); |
|
| 55 | +$GLOBALS['xoTheme']->addStylesheet(WGGITHUB_URL.'/assets/css/tabs.css', null); |
|
| 56 | 56 | $keywords = []; |
| 57 | 57 | // |
| 58 | 58 | $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL); |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | foreach (\array_keys($directoriesAll) as $i) { |
| 121 | 121 | $directories[$i] = $directoriesAll[$i]->getValuesDirectories(); |
| 122 | 122 | $dirName = $directoriesAll[$i]->getVar('dir_name'); |
| 123 | - $dirFilterRelease = (bool)$directoriesAll[$i]->getVar('dir_filterrelease'); |
|
| 123 | + $dirFilterRelease = (bool) $directoriesAll[$i]->getVar('dir_filterrelease'); |
|
| 124 | 124 | $repos = []; |
| 125 | 125 | $crRepositories = new \CriteriaCompo(); |
| 126 | 126 | $crRepositories->add(new \Criteria('repo_user', $dirName)); |
| 127 | 127 | $repositoriesCountTotal = $repositoriesHandler->getCount($crRepositories); |
| 128 | 128 | if ('any' === $filterRelease && $dirFilterRelease) { |
| 129 | - $crRepositories->add(new \Criteria('repo_prerelease', 1) ); |
|
| 129 | + $crRepositories->add(new \Criteria('repo_prerelease', 1)); |
|
| 130 | 130 | $crRepositories->add(new \Criteria('repo_release', 1), 'OR'); |
| 131 | 131 | } |
| 132 | 132 | if ('final' === $filterRelease && $dirFilterRelease) { |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | $directories[$i]['repos'] = $repos; |
| 183 | 183 | $directories[$i]['previousRepos'] = $start > 0; |
| 184 | - $directories[$i]['previousOp'] = '&start=' . ($start - $limit) . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
| 184 | + $directories[$i]['previousOp'] = '&start='.($start - $limit).'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
| 185 | 185 | $directories[$i]['nextRepos'] = ($repositoriesCount - $start) > $limit; |
| 186 | - $directories[$i]['nextOp'] = '&start=' . ($start + $limit) . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
| 186 | + $directories[$i]['nextOp'] = '&start='.($start + $limit).'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
| 187 | 187 | $GLOBALS['xoopsTpl']->assign('start', $start); |
| 188 | 188 | $GLOBALS['xoopsTpl']->assign('limit', $limit); |
| 189 | 189 | $GLOBALS['xoopsTpl']->assign('menu', $menu); |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | unset($crDirectories, $directories); |
| 195 | 195 | // Display Navigation |
| 196 | 196 | if ($directoriesCount > $limit) { |
| 197 | - include_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 198 | - $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
| 197 | + include_once \XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 198 | + $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
| 199 | 199 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
| 200 | 200 | } |
| 201 | 201 | $GLOBALS['xoopsTpl']->assign('lang_thereare', \sprintf(\_MA_WGGITHUB_INDEX_THEREARE, $directoriesCount)); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | // Permissions |
| 209 | 209 | if (!$permGlobalRead) { |
| 210 | 210 | $GLOBALS['xoopsTpl']->assign('error', _NOPERM); |
| 211 | - require __DIR__ . '/footer.php'; |
|
| 211 | + require __DIR__.'/footer.php'; |
|
| 212 | 212 | } |
| 213 | 213 | executeUpdate(); |
| 214 | 214 | break; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | // Permissions |
| 217 | 217 | if (!$permReadmeUpdate) { |
| 218 | 218 | $GLOBALS['xoopsTpl']->assign('error', _NOPERM); |
| 219 | - require __DIR__ . '/footer.php'; |
|
| 219 | + require __DIR__.'/footer.php'; |
|
| 220 | 220 | } |
| 221 | 221 | $repoId = Request::getInt('repo_id', 0); |
| 222 | 222 | $repoUser = Request::getString('repo_user', 'none'); |
@@ -229,14 +229,14 @@ discard block |
||
| 229 | 229 | // Breadcrumbs |
| 230 | 230 | $xoBreadcrumbs[] = ['title' => \_MA_WGGITHUB_INDEX]; |
| 231 | 231 | // Keywords |
| 232 | -wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords)); |
|
| 232 | +wggithubMetaKeywords($helper->getConfig('keywords').', '.\implode(',', $keywords)); |
|
| 233 | 233 | unset($keywords); |
| 234 | 234 | // Description |
| 235 | 235 | wggithubMetaDescription(\_MA_WGGITHUB_INDEX_DESC); |
| 236 | 236 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/index.php'); |
| 237 | 237 | $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL); |
| 238 | 238 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
| 239 | -require __DIR__ . '/footer.php'; |
|
| 239 | +require __DIR__.'/footer.php'; |
|
| 240 | 240 | |
| 241 | 241 | |
| 242 | 242 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | * |
| 246 | 246 | * @return bool |
| 247 | 247 | */ |
| 248 | -function executeUpdate(){ |
|
| 248 | +function executeUpdate() { |
|
| 249 | 249 | |
| 250 | 250 | $github = Github::getInstance(); |
| 251 | 251 | $helper = Helper::getInstance(); |
@@ -230,7 +230,7 @@ |
||
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | if (0 == \count($setting)) { |
| 233 | - \redirect_header(XOOPS_URL . '/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS); |
|
| 233 | + \redirect_header(XOOPS_URL.'/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS); |
|
| 234 | 234 | } |
| 235 | 235 | $this->userAuth = $setting['user']; |
| 236 | 236 | $this->tokenAuth = $setting['token']; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $readmesObj->setVar('rm_content', $readme['content']); |
| 171 | 171 | $readmesObj->setVar('rm_encoding', $readme['encoding']); |
| 172 | 172 | $readmesObj->setVar('rm_downloadurl', $readme['download_url']); |
| 173 | - $readmesObj->setVar('rm_datecreated',time()); |
|
| 173 | + $readmesObj->setVar('rm_datecreated', time()); |
|
| 174 | 174 | $readmesObj->setVar('rm_submitter', $submitter); |
| 175 | 175 | // Insert Data |
| 176 | 176 | if (!$readmesHandler->insert($readmesObj)) { |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $readmesObj->setVar('rm_content', $readme['content']); |
| 241 | 241 | $readmesObj->setVar('rm_encoding', $readme['encoding']); |
| 242 | 242 | $readmesObj->setVar('rm_downloadurl', $readme['download_url']); |
| 243 | - $readmesObj->setVar('rm_datecreated',time()); |
|
| 243 | + $readmesObj->setVar('rm_datecreated', time()); |
|
| 244 | 244 | $readmesObj->setVar('rm_submitter', $submitter); |
| 245 | 245 | // Insert Data |
| 246 | 246 | if (!$readmesHandler->insert($readmesObj)) { |
@@ -278,10 +278,10 @@ discard block |
||
| 278 | 278 | public function updateRepoReadme() |
| 279 | 279 | { |
| 280 | 280 | // update repo_readme |
| 281 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . ' INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes'); |
|
| 282 | - $sql .= ' ON ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_id = ' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes') . '.rm_repoid '; |
|
| 283 | - $sql .= 'SET ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_readme = 1 '; |
|
| 284 | - $sql .= 'WHERE (((' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes') . '.rm_id)>0));'; |
|
| 281 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').' INNER JOIN '.$GLOBALS['xoopsDB']->prefix('wggithub_readmes'); |
|
| 282 | + $sql .= ' ON '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_id = '.$GLOBALS['xoopsDB']->prefix('wggithub_readmes').'.rm_repoid '; |
|
| 283 | + $sql .= 'SET '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_readme = 1 '; |
|
| 284 | + $sql .= 'WHERE ((('.$GLOBALS['xoopsDB']->prefix('wggithub_readmes').'.rm_id)>0));'; |
|
| 285 | 285 | $GLOBALS['xoopsDB']->queryF($sql); |
| 286 | 286 | |
| 287 | 287 | return true; |