@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function setPrimarySetting($setId) |
150 | 150 | { |
151 | - $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
|
151 | + $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
|
152 | 152 | $settingsObj = null; |
153 | 153 | $settingsHandler = $helper->getHandler('Settings'); |
154 | 154 | if (isset($setId)) { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | // reset all |
161 | - $strSQL = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('wggithub_settings') . ' SET ' . $GLOBALS['xoopsDB']->prefix('wggithub_settings') . '.set_primary = 0'; |
|
161 | + $strSQL = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('wggithub_settings').' SET '.$GLOBALS['xoopsDB']->prefix('wggithub_settings').'.set_primary = 0'; |
|
162 | 162 | $GLOBALS['xoopsDB']->queryF($strSQL); |
163 | 163 | // Set Vars |
164 | 164 | $settingsObj->setVar('set_primary', 1); |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function getValuesReleases($keys = null, $format = null, $maxDepth = null) |
138 | 138 | { |
139 | - $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
|
139 | + $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
|
140 | 140 | $ret = $this->getValues($keys, $format, $maxDepth); |
141 | - $ret['id'] = $this->getVar('rel_id'); |
|
141 | + $ret['id'] = $this->getVar('rel_id'); |
|
142 | 142 | $repositoriesHandler = $helper->getHandler('Repositories'); |
143 | 143 | $repositoriesObj = $repositoriesHandler->get($this->getVar('rel_repoid')); |
144 | 144 | if (\is_object($repositoriesObj)) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | $ret['type'] = $this->getVar('rel_type'); |
150 | 150 | $ret['name'] = $this->getVar('rel_name'); |
151 | - $ret['prerelease'] = (int)$this->getVar('rel_prerelease') > 0 ? _YES : _NO; |
|
151 | + $ret['prerelease'] = (int) $this->getVar('rel_prerelease') > 0 ? _YES : _NO; |
|
152 | 152 | $ret['publishedat'] = \formatTimestamp($this->getVar('rel_publishedat'), 'm'); |
153 | 153 | $ret['tarballurl'] = $this->getVar('rel_tarballurl'); |
154 | 154 | $ret['zipballurl'] = $this->getVar('rel_zipballurl'); |
@@ -176,10 +176,10 @@ |
||
176 | 176 | break; |
177 | 177 | } |
178 | 178 | $ret['content_shorttext'] = Utility::truncateHtml($content_text); |
179 | - $ret['autoupdate'] = (int)$this->getVar('dir_autoupdate') > 0 ? _YES : _NO; |
|
180 | - $ret['online'] = (int)$this->getVar('dir_online') > 0 ? _YES : _NO; |
|
181 | - $ret['filterrelease'] = (int)$this->getVar('dir_filterrelease') > 0 ? _YES : _NO; |
|
182 | - $ret['weight'] = (int)$this->getVar('dir_weight'); |
|
179 | + $ret['autoupdate'] = (int) $this->getVar('dir_autoupdate') > 0 ? _YES : _NO; |
|
180 | + $ret['online'] = (int) $this->getVar('dir_online') > 0 ? _YES : _NO; |
|
181 | + $ret['filterrelease'] = (int) $this->getVar('dir_filterrelease') > 0 ? _YES : _NO; |
|
182 | + $ret['weight'] = (int) $this->getVar('dir_weight'); |
|
183 | 183 | $ret['datecreated'] = \formatTimestamp($this->getVar('dir_datecreated'), 's'); |
184 | 184 | $ret['submitter'] = \XoopsUser::getUnameFromId($this->getVar('dir_submitter')); |
185 | 185 | return $ret; |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | use Xmf\Request; |
24 | 24 | use XoopsModules\Wggithub\Common; |
25 | 25 | |
26 | -include_once \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
27 | -require __DIR__ . '/header.php'; |
|
26 | +include_once \dirname(__DIR__).'/preloads/autoloader.php'; |
|
27 | +require __DIR__.'/header.php'; |
|
28 | 28 | |
29 | 29 | // Template Index |
30 | 30 | $templateMain = 'wggithub_admin_index.tpl'; |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | // InfoBox Statistics |
46 | 46 | $adminObject->addInfoBox(\_AM_WGGITHUB_STATISTICS); |
47 | 47 | // Info elements |
48 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . \_AM_WGGITHUB_THEREARE_SETTINGS . '</label>', $countSettings)); |
|
49 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . \_AM_WGGITHUB_THEREARE_DIRECTORIES . '</label>', $countDirectories)); |
|
50 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . \_AM_WGGITHUB_THEREARE_LOGS . '</label>', $countLogs)); |
|
51 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . \_AM_WGGITHUB_THEREARE_REPOSITORIES . '</label>', $countRepositories)); |
|
52 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . \_AM_WGGITHUB_THEREARE_READMES . '</label>', $countReadmes)); |
|
53 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . \_AM_WGGITHUB_THEREARE_RELEASES . '</label>', $countReleases)); |
|
48 | +$adminObject->addInfoBoxLine(\sprintf('<label>'.\_AM_WGGITHUB_THEREARE_SETTINGS.'</label>', $countSettings)); |
|
49 | +$adminObject->addInfoBoxLine(\sprintf('<label>'.\_AM_WGGITHUB_THEREARE_DIRECTORIES.'</label>', $countDirectories)); |
|
50 | +$adminObject->addInfoBoxLine(\sprintf('<label>'.\_AM_WGGITHUB_THEREARE_LOGS.'</label>', $countLogs)); |
|
51 | +$adminObject->addInfoBoxLine(\sprintf('<label>'.\_AM_WGGITHUB_THEREARE_REPOSITORIES.'</label>', $countRepositories)); |
|
52 | +$adminObject->addInfoBoxLine(\sprintf('<label>'.\_AM_WGGITHUB_THEREARE_READMES.'</label>', $countReadmes)); |
|
53 | +$adminObject->addInfoBoxLine(\sprintf('<label>'.\_AM_WGGITHUB_THEREARE_RELEASES.'</label>', $countReleases)); |
|
54 | 54 | |
55 | 55 | // Upload Folders |
56 | 56 | $configurator = new Common\Configurator(); |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | // Test Data |
71 | 71 | if ($helper->getConfig('displaySampleButton')) { |
72 | 72 | \xoops_loadLanguage('admin/modulesadmin', 'system'); |
73 | - include_once \dirname(__DIR__) . '/testdata/index.php'; |
|
74 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add'); |
|
75 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add'); |
|
73 | + include_once \dirname(__DIR__).'/testdata/index.php'; |
|
74 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add'); |
|
75 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add'); |
|
76 | 76 | // $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_EXPORT_SCHEMA'), '__DIR__ . /../../testdata/index.php?op=exportschema', 'add'); |
77 | 77 | $adminObject->displayButton('left'); |
78 | 78 | } |
79 | 79 | $GLOBALS['xoopsTpl']->assign('index', $adminObject->displayIndex()); |
80 | 80 | // End Test Data |
81 | -require __DIR__ . '/footer.php'; |
|
81 | +require __DIR__.'/footer.php'; |
@@ -191,14 +191,14 @@ |
||
191 | 191 | $donationform = [ |
192 | 192 | 0 => '<form name="donation" id="donation" action="http://www.txmodxoops.org/modules/xdonations/" method="post" onsubmit="return xoopsFormValidate_donation();">', |
193 | 193 | 1 => '<table class="outer" cellspacing="1" width="100%"><tbody><tr><th colspan="2">' |
194 | - . \_AM_WGGITHUB_ABOUT_MAKE_DONATION |
|
195 | - . '</th></tr><tr align="left" valign="top"><td class="head"><div class="xoops-form-element-caption-required"><span class="caption-text">' |
|
196 | - . \_AM_WGGITHUB_DONATION_AMOUNT |
|
197 | - . '</span><span class="caption-marker">*</span></div></td><td class="even"><select size="1" name="item[A][amount]" id="item[A][amount]" title="Donation Amount"><option value="5">5.00 EUR</option><option value="10">10.00 EUR</option><option value="20">20.00 EUR</option><option value="40">40.00 EUR</option><option value="60">60.00 EUR</option><option value="80">80.00 EUR</option><option value="90">90.00 EUR</option><option value="100">100.00 EUR</option><option value="200">200.00 EUR</option></select></td></tr><tr align="left" valign="top"><td class="head"></td><td class="even"><input class="formButton" name="submit" id="submit" value="' |
|
198 | - . \_SUBMIT |
|
199 | - . '" title="' |
|
200 | - . \_SUBMIT |
|
201 | - . '" type="submit"></td></tr></tbody></table>', |
|
194 | + . \_AM_WGGITHUB_ABOUT_MAKE_DONATION |
|
195 | + . '</th></tr><tr align="left" valign="top"><td class="head"><div class="xoops-form-element-caption-required"><span class="caption-text">' |
|
196 | + . \_AM_WGGITHUB_DONATION_AMOUNT |
|
197 | + . '</span><span class="caption-marker">*</span></div></td><td class="even"><select size="1" name="item[A][amount]" id="item[A][amount]" title="Donation Amount"><option value="5">5.00 EUR</option><option value="10">10.00 EUR</option><option value="20">20.00 EUR</option><option value="40">40.00 EUR</option><option value="60">60.00 EUR</option><option value="80">80.00 EUR</option><option value="90">90.00 EUR</option><option value="100">100.00 EUR</option><option value="200">200.00 EUR</option></select></td></tr><tr align="left" valign="top"><td class="head"></td><td class="even"><input class="formButton" name="submit" id="submit" value="' |
|
198 | + . \_SUBMIT |
|
199 | + . '" title="' |
|
200 | + . \_SUBMIT |
|
201 | + . '" type="submit"></td></tr></tbody></table>', |
|
202 | 202 | 2 => '<input name="op" id="op" value="createinvoice" type="hidden"><input name="plugin" id="plugin" value="donations" type="hidden"><input name="donation" id="donation" value="1" type="hidden"><input name="drawfor" id="drawfor" value="Chronolabs Co-Operative" type="hidden"><input name="drawto" id="drawto" value="%s" type="hidden"><input name="drawto_email" id="drawto_email" value="%s" type="hidden"><input name="key" id="key" value="%s" type="hidden"><input name="currency" id="currency" value="EUR" type="hidden"><input name="weight_unit" id="weight_unit" value="kgs" type="hidden"><input name="item[A][cat]" id="item[A][cat]" value="XDN%s" type="hidden"><input name="item[A][name]" id="item[A][name]" value="Donation for %s" type="hidden"><input name="item[A][quantity]" id="item[A][quantity]" value="1" type="hidden"><input name="item[A][shipping]" id="item[A][shipping]" value="0" type="hidden"><input name="item[A][handling]" id="item[A][handling]" value="0" type="hidden"><input name="item[A][weight]" id="item[A][weight]" value="0" type="hidden"><input name="item[A][tax]" id="item[A][tax]" value="0" type="hidden"><input name="return" id="return" value="http://www.txmodxoops.org/modules/xdonations/success.php" type="hidden"><input name="cancel" id="cancel" value="http://www.txmodxoops.org/modules/xdonations/success.php" type="hidden"></form>', |
203 | 203 | 'D' => '', |
204 | 204 | 3 => '', |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | { |
57 | 57 | if ($considerHtml) { |
58 | 58 | // if the plain text is shorter than the maximum length, return the whole text |
59 | - if (\mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) { |
|
59 | + if (\mb_strlen(\preg_replace('/<.*?'.'>/', '', $text)) <= $length) { |
|
60 | 60 | return $text; |
61 | 61 | } |
62 | 62 | // splits all html-tags to scanable lines |
63 | - \preg_match_all('/(<.+?' . '>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER); |
|
63 | + \preg_match_all('/(<.+?'.'>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER); |
|
64 | 64 | $total_length = \mb_strlen($ending); |
65 | 65 | $open_tags = []; |
66 | 66 | $truncate = ''; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | unset($open_tags[$pos]); |
79 | 79 | } |
80 | 80 | // if tag is an opening tag |
81 | - } elseif (\preg_match('/^<\s*([^\s>!]+).*?' . '>$/s', $line_matchings[1], $tag_matchings)) { |
|
81 | + } elseif (\preg_match('/^<\s*([^\s>!]+).*?'.'>$/s', $line_matchings[1], $tag_matchings)) { |
|
82 | 82 | // add tag to the beginning of $open_tags list |
83 | 83 | \array_unshift($open_tags, \mb_strtolower($tag_matchings[1])); |
84 | 84 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | if ($considerHtml) { |
139 | 139 | // close all unclosed html-tags |
140 | 140 | foreach ($open_tags as $tag) { |
141 | - $truncate .= '</' . $tag . '>'; |
|
141 | + $truncate .= '</'.$tag.'>'; |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | //--></script> |
212 | 212 | <!-- End Form Validation JavaScript //-->', |
213 | 213 | ]; |
214 | - $paypalform = [ |
|
214 | + $paypalform = [ |
|
215 | 215 | 0 => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">', |
216 | 216 | 1 => '<input name="cmd" value="_s-xclick" type="hidden">', |
217 | 217 | 2 => '<input name="hosted_button_id" value="%s" type="hidden">', |
@@ -224,11 +224,11 @@ discard block |
||
224 | 224 | case 2: |
225 | 225 | $donationform[$key] = \sprintf( |
226 | 226 | $donationform[$key], |
227 | - $GLOBALS['xoopsConfig']['sitename'] . ' - ' . ('' != $GLOBALS['xoopsUser']->getVar('name') ? $GLOBALS['xoopsUser']->getVar('name') . ' [' . $GLOBALS['xoopsUser']->getVar('uname') . ']' : $GLOBALS['xoopsUser']->getVar('uname')), |
|
227 | + $GLOBALS['xoopsConfig']['sitename'].' - '.('' != $GLOBALS['xoopsUser']->getVar('name') ? $GLOBALS['xoopsUser']->getVar('name').' ['.$GLOBALS['xoopsUser']->getVar('uname').']' : $GLOBALS['xoopsUser']->getVar('uname')), |
|
228 | 228 | $GLOBALS['xoopsUser']->getVar('email'), |
229 | 229 | XOOPS_LICENSE_KEY, |
230 | 230 | \mb_strtoupper($GLOBALS['xoopsModule']->getVar('dirname')), |
231 | - \mb_strtoupper($GLOBALS['xoopsModule']->getVar('dirname')) . ' ' . $GLOBALS['xoopsModule']->getVar('name') |
|
231 | + \mb_strtoupper($GLOBALS['xoopsModule']->getVar('dirname')).' '.$GLOBALS['xoopsModule']->getVar('name') |
|
232 | 232 | ); |
233 | 233 | break; |
234 | 234 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
138 | 138 | $utility = new \XoopsModules\Wggithub\Utility(); |
139 | 139 | $ret = $this->getValues($keys, $format, $maxDepth); |
140 | - $ret['id'] = $this->getVar('rm_id'); |
|
140 | + $ret['id'] = $this->getVar('rm_id'); |
|
141 | 141 | $repositoriesHandler = $helper->getHandler('Repositories'); |
142 | 142 | $repositoriesObj = $repositoriesHandler->get($this->getVar('rm_repoid')); |
143 | 143 | $repoName = '*****missing repo_name*****'; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $ret['submitter'] = \XoopsUser::getUnameFromId($this->getVar('rm_submitter')); |
170 | 170 | $ret['gitbook_link'] = ''; |
171 | 171 | if (\strpos($ret['downloadurl'], 'XoopsDoc') > 0) { |
172 | - $ret['gitbook_link'] = 'https://xoops.gitbook.io/' . $repoName . '/'; |
|
172 | + $ret['gitbook_link'] = 'https://xoops.gitbook.io/'.$repoName.'/'; |
|
173 | 173 | } |
174 | 174 | return $ret; |
175 | 175 | } |
@@ -214,22 +214,22 @@ discard block |
||
214 | 214 | $arrReplace = [ |
215 | 215 | 'src="https://xoops.org/images/logoXoopsPhp8.png', |
216 | 216 | "src='https://xoops.org/images/logoXoopsPhp8.png", |
217 | - 'src="' . $baseUrl . '.gitbook/assets/', |
|
218 | - "src='" . $baseUrl . '.gitbook/assets/', |
|
219 | - 'src="' . $baseUrl . 'en/assets/', |
|
220 | - "src='" . $baseUrl . 'en/assets/', |
|
221 | - 'src="' . $baseUrl . 'assets/', |
|
222 | - "src='" . $baseUrl . 'assets/' |
|
217 | + 'src="'.$baseUrl.'.gitbook/assets/', |
|
218 | + "src='".$baseUrl.'.gitbook/assets/', |
|
219 | + 'src="'.$baseUrl.'en/assets/', |
|
220 | + "src='".$baseUrl.'en/assets/', |
|
221 | + 'src="'.$baseUrl.'assets/', |
|
222 | + "src='".$baseUrl.'assets/' |
|
223 | 223 | ]; |
224 | 224 | $contentClean = \str_replace($arrSearch, $arrReplace, $contentClean); |
225 | 225 | |
226 | 226 | //replace known missing images |
227 | 227 | $arrSearch = [ |
228 | - 'src="' . \XOOPS_URL . '/screenshot.jpg', |
|
229 | - 'src="' . \XOOPS_URL . '/sd-099-theme-surprice.gif', |
|
230 | - 'src="' . \XOOPS_URL . '/shot.gif', |
|
231 | - 'src="' . \XOOPS_URL . '/shot.jpg', |
|
232 | - 'src="' . \XOOPS_URL . '/theme_preview.png', |
|
228 | + 'src="'.\XOOPS_URL.'/screenshot.jpg', |
|
229 | + 'src="'.\XOOPS_URL.'/sd-099-theme-surprice.gif', |
|
230 | + 'src="'.\XOOPS_URL.'/shot.gif', |
|
231 | + 'src="'.\XOOPS_URL.'/shot.jpg', |
|
232 | + 'src="'.\XOOPS_URL.'/theme_preview.png', |
|
233 | 233 | 'src="https://github.com/xoops/newbb-tutorial/tree/54ef6104e66b74e8c6dea683d3cce70ceafdd739/assets/image001.jpg', |
234 | 234 | 'src="https://github.com/xoops/repairshop-tutorial/tree/719d6d32dea221b3e980fd3d6222f179ac898394/en/assets/img_2.jpg', |
235 | 235 | 'src="https://github.com/xoops/xoops-mylinks-tutorial/tree/d30c30645d48c5ead51399ff711c25935cbd0495/en/assets/forkit.png', |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | 'src="https://insight.sensiolabs.com/projects/7ada0220-a68e-4369-aef0-950172630ff8/mini.png', |
301 | 301 | 'src="https://xoops.org/images/translations-github-blue.svg', |
302 | 302 | ]; |
303 | - $contentClean = \str_replace($arrSearch, 'src="' . \WGGITHUB_IMAGE_URL . '/blank.gif', $contentClean); |
|
303 | + $contentClean = \str_replace($arrSearch, 'src="'.\WGGITHUB_IMAGE_URL.'/blank.gif', $contentClean); |
|
304 | 304 | |
305 | 305 | return $contentClean; |
306 | 306 | } |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | // Get instance of module |
33 | 33 | $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
34 | 34 | $repositoriesHandler = $helper->getHandler('Repositories'); |
35 | - $repoId = (int)$itemId; |
|
35 | + $repoId = (int) $itemId; |
|
36 | 36 | $repositoriesObj = $repositoriesHandler->get($repoId); |
37 | - $repositoriesObj->setVar('repo_comments', (int)$itemNumb); |
|
37 | + $repositoriesObj->setVar('repo_comments', (int) $itemNumb); |
|
38 | 38 | if ($repositoriesHandler->insert($repositoriesObj)) { |
39 | 39 | return true; |
40 | 40 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $tags = []; |
61 | 61 | $tags['ITEM_NAME'] = $repoName; |
62 | - $tags['ITEM_URL'] = \XOOPS_URL . '/modules/wggithub/repositories.php?op=show&repo_id=' . $repoId; |
|
62 | + $tags['ITEM_URL'] = \XOOPS_URL.'/modules/wggithub/repositories.php?op=show&repo_id='.$repoId; |
|
63 | 63 | $notificationHandler = \xoops_getHandler('notification'); |
64 | 64 | // Event modify notification |
65 | 65 | $notificationHandler->triggerEvent('global', 0, 'global_comment', $tags); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | //\defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined'); |
27 | 27 | |
28 | -require_once \dirname(__DIR__, 4) . '/mainfile.php'; |
|
28 | +require_once \dirname(__DIR__, 4).'/mainfile.php'; |
|
29 | 29 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
30 | 30 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
31 | 31 | \xoops_loadLanguage('filechecker', $moduleDirName); |
@@ -57,24 +57,24 @@ discard block |
||
57 | 57 | if (null === $original_file_path) { |
58 | 58 | if (self::fileExists($file_path)) { |
59 | 59 | $path_status = "<img src='$pathIcon16/1.png' >"; |
60 | - $path_status .= "$file_path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_AVAILABLE') . ') '; |
|
60 | + $path_status .= "$file_path (".\constant('CO_'.$moduleDirNameUpper.'_'.'FC_AVAILABLE').') '; |
|
61 | 61 | } else { |
62 | 62 | $path_status = "<img src='$pathIcon16/0.png' >"; |
63 | - $path_status .= "$file_path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_NOTAVAILABLE') . ') '; |
|
63 | + $path_status .= "$file_path (".\constant('CO_'.$moduleDirNameUpper.'_'.'FC_NOTAVAILABLE').') '; |
|
64 | 64 | } |
65 | 65 | } else { |
66 | 66 | if (self::compareFiles($file_path, $original_file_path)) { |
67 | 67 | $path_status = "<img src='$pathIcon16/1.png' >"; |
68 | - $path_status .= "$file_path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_AVAILABLE') . ') '; |
|
68 | + $path_status .= "$file_path (".\constant('CO_'.$moduleDirNameUpper.'_'.'FC_AVAILABLE').') '; |
|
69 | 69 | } else { |
70 | 70 | $path_status = "<img src='$pathIcon16/0.png' >"; |
71 | - $path_status .= "$file_path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_NOTAVAILABLE') . ') '; |
|
72 | - $path_status .= "<form action='" . $_SERVER['SCRIPT_NAME'] . "' method='post'>"; |
|
71 | + $path_status .= "$file_path (".\constant('CO_'.$moduleDirNameUpper.'_'.'FC_NOTAVAILABLE').') '; |
|
72 | + $path_status .= "<form action='".$_SERVER['SCRIPT_NAME']."' method='post'>"; |
|
73 | 73 | $path_status .= "<input type='hidden' name='op' value='copyfile'>"; |
74 | 74 | $path_status .= "<input type='hidden' name='file_path' value='$file_path'>"; |
75 | 75 | $path_status .= "<input type='hidden' name='original_file_path' value='$original_file_path'>"; |
76 | 76 | $path_status .= "<input type='hidden' name='redirect' value='$redirectFile'>"; |
77 | - $path_status .= "<button class='submit' onClick='this.form.submit();'>" . \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_CREATETHEFILE') . '</button>'; |
|
77 | + $path_status .= "<button class='submit' onClick='this.form.submit();'>".\constant('CO_'.$moduleDirNameUpper.'_'.'FC_CREATETHEFILE').'</button>'; |
|
78 | 78 | $path_status .= '</form>'; |
79 | 79 | } |
80 | 80 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | $target = \str_replace('..', '', $target); |
141 | 141 | |
142 | - return @\chmod($target, (int)$mode); |
|
142 | + return @\chmod($target, (int) $mode); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if (\Xmf\Request::hasVar('redirect', 'POST')) { |
156 | 156 | $redirect = $_POST['redirect']; |
157 | 157 | } |
158 | - $msg = FileChecker::copyFile($original_file_path, $file_path) ? \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_FILECOPIED') : \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_FILENOTCOPIED'); |
|
159 | - \redirect_header($redirect, 2, $msg . ': ' . $file_path); |
|
158 | + $msg = FileChecker::copyFile($original_file_path, $file_path) ? \constant('CO_'.$moduleDirNameUpper.'_'.'FC_FILECOPIED') : \constant('CO_'.$moduleDirNameUpper.'_'.'FC_FILENOTCOPIED'); |
|
159 | + \redirect_header($redirect, 2, $msg.': '.$file_path); |
|
160 | 160 | break; |
161 | 161 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | use XoopsModules\Wggithub; |
25 | 25 | |
26 | 26 | |
27 | -require_once \dirname(__DIR__, 4) . '/mainfile.php'; |
|
27 | +require_once \dirname(__DIR__, 4).'/mainfile.php'; |
|
28 | 28 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
29 | 29 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
30 | 30 | \xoops_loadLanguage('directorychecker', $moduleDirName); |
@@ -56,38 +56,38 @@ discard block |
||
56 | 56 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
57 | 57 | if (!@\is_dir($path)) { |
58 | 58 | $path_status = "<img src='$pathIcon16/0.png' >"; |
59 | - $path_status .= "$path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_NOTAVAILABLE') . ') '; |
|
60 | - $path_status .= "<form action='" . $_SERVER['SCRIPT_NAME'] . "' method='post'>"; |
|
59 | + $path_status .= "$path (".\constant('CO_'.$moduleDirNameUpper.'_'.'DC_NOTAVAILABLE').') '; |
|
60 | + $path_status .= "<form action='".$_SERVER['SCRIPT_NAME']."' method='post'>"; |
|
61 | 61 | $path_status .= "<input type='hidden' name='op' value='createdir'>"; |
62 | 62 | $path_status .= "<input type='hidden' name='path' value='$path'>"; |
63 | 63 | $path_status .= "<input type='hidden' name='redirect' value='$redirectFile'>"; |
64 | - $path_status .= "<button class='submit' onClick='this.form.submit();'>" . \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_CREATETHEDIR') . '</button>'; |
|
64 | + $path_status .= "<button class='submit' onClick='this.form.submit();'>".\constant('CO_'.$moduleDirNameUpper.'_'.'DC_CREATETHEDIR').'</button>'; |
|
65 | 65 | $path_status .= '</form>'; |
66 | 66 | } elseif (@\is_writable($path)) { |
67 | 67 | $path_status = "<img src='$pathIcon16/1.png' >"; |
68 | - $path_status .= "$path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_AVAILABLE') . ') '; |
|
68 | + $path_status .= "$path (".\constant('CO_'.$moduleDirNameUpper.'_'.'DC_AVAILABLE').') '; |
|
69 | 69 | $currentMode = \mb_substr(\decoct(\fileperms($path)), 2); |
70 | 70 | if ($currentMode != \decoct($mode)) { |
71 | 71 | $path_status = "<img src='$pathIcon16/0.png' >"; |
72 | - $path_status .= $path . \sprintf(\constant('CO_' . $moduleDirNameUpper . '_' . 'DC_NOTWRITABLE'), \decoct($mode), $currentMode); |
|
73 | - $path_status .= "<form action='" . $_SERVER['SCRIPT_NAME'] . "' method='post'>"; |
|
72 | + $path_status .= $path.\sprintf(\constant('CO_'.$moduleDirNameUpper.'_'.'DC_NOTWRITABLE'), \decoct($mode), $currentMode); |
|
73 | + $path_status .= "<form action='".$_SERVER['SCRIPT_NAME']."' method='post'>"; |
|
74 | 74 | $path_status .= "<input type='hidden' name='op' value='setdirperm'>"; |
75 | 75 | $path_status .= "<input type='hidden' name='mode' value='$mode'>"; |
76 | 76 | $path_status .= "<input type='hidden' name='path' value='$path'>"; |
77 | 77 | $path_status .= "<input type='hidden' name='redirect' value='$redirectFile'>"; |
78 | - $path_status .= "<button class='submit' onClick='this.form.submit();'>" . \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_SETMPERM') . '</button>'; |
|
78 | + $path_status .= "<button class='submit' onClick='this.form.submit();'>".\constant('CO_'.$moduleDirNameUpper.'_'.'DC_SETMPERM').'</button>'; |
|
79 | 79 | $path_status .= '</form>'; |
80 | 80 | } |
81 | 81 | } else { |
82 | 82 | $currentMode = \mb_substr(\decoct(\fileperms($path)), 2); |
83 | 83 | $path_status = "<img src='$pathIcon16/0.png' >"; |
84 | - $path_status .= $path . \sprintf(\constant('CO_' . $moduleDirNameUpper . '_' . 'DC_NOTWRITABLE'), \decoct($mode), $currentMode); |
|
85 | - $path_status .= "<form action='" . $_SERVER['SCRIPT_NAME'] . "' method='post'>"; |
|
84 | + $path_status .= $path.\sprintf(\constant('CO_'.$moduleDirNameUpper.'_'.'DC_NOTWRITABLE'), \decoct($mode), $currentMode); |
|
85 | + $path_status .= "<form action='".$_SERVER['SCRIPT_NAME']."' method='post'>"; |
|
86 | 86 | $path_status .= "<input type='hidden' name='op' value='setdirperm'>"; |
87 | 87 | $path_status .= "<input type='hidden' name='mode' value='$mode'>"; |
88 | 88 | $path_status .= "<input type='hidden' name='path' value='$path'>"; |
89 | 89 | $path_status .= "<input type='hidden' name='redirect' value='$redirectFile'>"; |
90 | - $path_status .= "<button class='submit' onClick='this.form.submit();'>" . \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_SETMPERM') . '</button>'; |
|
90 | + $path_status .= "<button class='submit' onClick='this.form.submit();'>".\constant('CO_'.$moduleDirNameUpper.'_'.'DC_SETMPERM').'</button>'; |
|
91 | 91 | $path_status .= '</form>'; |
92 | 92 | } |
93 | 93 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | { |
119 | 119 | $target = \str_replace('..', '', $target); |
120 | 120 | |
121 | - return @\chmod($target, (int)$mode); |
|
121 | + return @\chmod($target, (int) $mode); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | if (\Xmf\Request::hasVar('redirect', 'POST')) { |
142 | 142 | $redirect = $_POST['redirect']; |
143 | 143 | } |
144 | - $msg = DirectoryChecker::createDirectory($path) ? \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_DIRCREATED') : \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_DIRNOTCREATED'); |
|
145 | - \redirect_header($redirect, 2, $msg . ': ' . $path); |
|
144 | + $msg = DirectoryChecker::createDirectory($path) ? \constant('CO_'.$moduleDirNameUpper.'_'.'DC_DIRCREATED') : \constant('CO_'.$moduleDirNameUpper.'_'.'DC_DIRNOTCREATED'); |
|
145 | + \redirect_header($redirect, 2, $msg.': '.$path); |
|
146 | 146 | break; |
147 | 147 | case 'setdirperm': |
148 | 148 | if (\Xmf\Request::hasVar('path', 'POST')) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | if (\Xmf\Request::hasVar('mode', 'POST')) { |
155 | 155 | $mode = $_POST['mode']; |
156 | 156 | } |
157 | - $msg = DirectoryChecker::setDirectoryPermissions($path, $mode) ? \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_PERMSET') : \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_PERMNOTSET'); |
|
158 | - \redirect_header($redirect, 2, $msg . ': ' . $path); |
|
157 | + $msg = DirectoryChecker::setDirectoryPermissions($path, $mode) ? \constant('CO_'.$moduleDirNameUpper.'_'.'DC_PERMSET') : \constant('CO_'.$moduleDirNameUpper.'_'.'DC_PERMNOTSET'); |
|
158 | + \redirect_header($redirect, 2, $msg.': '.$path); |
|
159 | 159 | break; |
160 | 160 | } |