@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * @param bool $post |
| 192 | 192 | * @param string $area |
| 193 | 193 | * @param bool $allow_repost |
| 194 | - * @return bool |
|
| 194 | + * @return null|boolean |
|
| 195 | 195 | */ |
| 196 | 196 | |
| 197 | 197 | public function check($post = true, $area = '', $allow_repost = true) |
@@ -362,9 +362,9 @@ discard block |
||
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | /** |
| 365 | - * @param $key_name |
|
| 365 | + * @param string $key_name |
|
| 366 | 366 | * @param $tmp_array |
| 367 | - * @return array |
|
| 367 | + * @return string[] |
|
| 368 | 368 | */ |
| 369 | 369 | |
| 370 | 370 | public function extract_post_recursive($key_name, $tmp_array) |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | // language file |
| 29 | 29 | |
| 30 | 30 | if (defined('XOOPS_ROOT_PATH') && !empty($xoopsConfig['language']) && !mb_strstr($xoopsConfig['language'], '/')) { |
| 31 | - if (is_file(dirname(__DIR__) . '/language/' . $xoopsConfig['language'] . '/gticket_messages.phtml')) { |
|
| 32 | - include dirname(__DIR__) . '/language/' . $xoopsConfig['language'] . '/gticket_messages.phtml'; |
|
| 31 | + if (is_file(dirname(__DIR__).'/language/'.$xoopsConfig['language'].'/gticket_messages.phtml')) { |
|
| 32 | + include dirname(__DIR__).'/language/'.$xoopsConfig['language'].'/gticket_messages.phtml'; |
|
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | public function getTicketHtml($salt = '', $timeout = 1800, $area = '') |
| 62 | 62 | { |
| 63 | - return '<input type="hidden" name="XOOPS_G_TICKET" value="' . $this->issue($salt, $timeout, $area) . '" />'; |
|
| 63 | + return '<input type="hidden" name="XOOPS_G_TICKET" value="'.$this->issue($salt, $timeout, $area).'" />'; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // returns an object of XoopsFormHidden including theh ticket |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | public function getTicketParamString($salt = '', $noamp = false, $timeout = 1800, $area = '') |
| 119 | 119 | { |
| 120 | - return ($noamp ? '' : '&') . 'XOOPS_G_TICKET=' . $this->issue($salt, $timeout, $area); |
|
| 120 | + return ($noamp ? '' : '&').'XOOPS_G_TICKET='.$this->issue($salt, $timeout, $area); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | // issue a ticket |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | if ('' === $salt) { |
| 137 | 137 | if (version_compare(PHP_VERSION, '7.0.0') >= 0 && function_exists('random_bytes')) { |
| 138 | - $salt = '$2y$07$' . str_replace('+', '.', base64_encode(random_bytes(self::PBKDF2_SALT_BYTES))); |
|
| 138 | + $salt = '$2y$07$'.str_replace('+', '.', base64_encode(random_bytes(self::PBKDF2_SALT_BYTES))); |
|
| 139 | 139 | } elseif (function_exists('mcrypt_create_iv')) { |
| 140 | - $salt = '$2y$07$' . str_replace('+', '.', base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM))); |
|
| 140 | + $salt = '$2y$07$'.str_replace('+', '.', base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM))); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | $appendix_salt = empty($_SERVER['PATH']) ? XOOPS_DB_NAME : $_SERVER['PATH']; |
| 149 | 149 | |
| 150 | - $token = crypt($salt . $usec . $appendix_salt . $sec, $salt); |
|
| 150 | + $token = crypt($salt.$usec.$appendix_salt.$sec, $salt); |
|
| 151 | 151 | |
| 152 | 152 | $this->_latest_token = $token; |
| 153 | 153 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | // paid md5ed token as a ticket |
| 184 | 184 | |
| 185 | - return md5($token . XOOPS_DB_PREFIX); |
|
| 185 | + return md5($token.XOOPS_DB_PREFIX); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | // check a ticket |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | // default lifetime 30min |
| 229 | 229 | |
| 230 | 230 | if ($stub['expire'] >= time()) { |
| 231 | - if (md5($stub['token'] . XOOPS_DB_PREFIX) === $ticket) { |
|
| 231 | + if (md5($stub['token'].XOOPS_DB_PREFIX) === $ticket) { |
|
| 232 | 232 | $found_stub = $stub; |
| 233 | 233 | } else { |
| 234 | 234 | // store the other valid stubs into session |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $_SESSION['XOOPS_G_STUBS'][] = $stub; |
| 237 | 237 | } |
| 238 | 238 | } else { |
| 239 | - if (md5($stub['token'] . XOOPS_DB_PREFIX) === $ticket) { |
|
| 239 | + if (md5($stub['token'].XOOPS_DB_PREFIX) === $ticket) { |
|
| 240 | 240 | // not CSRF but Time-Out |
| 241 | 241 | |
| 242 | 242 | $timeout_flag = true; |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | $table = '<table>'; |
| 323 | 323 | |
| 324 | - $form = '<form action="?' . htmlspecialchars(@$_SERVER['QUERY_STRING'], ENT_QUOTES) . '" method="post" >'; |
|
| 324 | + $form = '<form action="?'.htmlspecialchars(@$_SERVER['QUERY_STRING'], ENT_QUOTES).'" method="post" >'; |
|
| 325 | 325 | |
| 326 | 326 | foreach ($_POST as $key => $val) { |
| 327 | 327 | if ('XOOPS_G_TICKET' == $key) { |
@@ -343,22 +343,22 @@ discard block |
||
| 343 | 343 | $val = stripslashes($val); |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | - $table .= '<tr><th>' . htmlspecialchars($key, ENT_QUOTES) . '</th><td>' . htmlspecialchars($val, ENT_QUOTES) . '</td></tr>' . "\n"; |
|
| 346 | + $table .= '<tr><th>'.htmlspecialchars($key, ENT_QUOTES).'</th><td>'.htmlspecialchars($val, ENT_QUOTES).'</td></tr>'."\n"; |
|
| 347 | 347 | |
| 348 | - $form .= '<input type="hidden" name="' . htmlspecialchars($key, ENT_QUOTES) . '" value="' . htmlspecialchars($val, ENT_QUOTES) . '" />' . "\n"; |
|
| 348 | + $form .= '<input type="hidden" name="'.htmlspecialchars($key, ENT_QUOTES).'" value="'.htmlspecialchars($val, ENT_QUOTES).'" />'."\n"; |
|
| 349 | 349 | } |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | $table .= '</table>'; |
| 353 | 353 | |
| 354 | - $form .= $this->getTicketHtml(__LINE__, 300, $area) . '<input type="submit" value="' . $this->messages['btn_repost'] . '" /></form>'; |
|
| 354 | + $form .= $this->getTicketHtml(__LINE__, 300, $area).'<input type="submit" value="'.$this->messages['btn_repost'].'" /></form>'; |
|
| 355 | 355 | |
| 356 | 356 | error_reporting(0); |
| 357 | 357 | |
| 358 | 358 | while (@ob_get_level() && @ob_end_clean()) { |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - echo '<html><head><title>' . $this->messages['err_general'] . '</title><style>table,td,th {border:solid black 1px; border-collapse:collapse;}</style></head><body>' . sprintf($this->messages['fmt_prompt4repost'], $this->getErrors()) . $table . $form . '</body></html>'; |
|
| 361 | + echo '<html><head><title>'.$this->messages['err_general'].'</title><style>table,td,th {border:solid black 1px; border-collapse:collapse;}</style></head><body>'.sprintf($this->messages['fmt_prompt4repost'], $this->getErrors()).$table.$form.'</body></html>'; |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | /** |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | if (is_array($val)) { |
| 382 | - list($tmp_table, $tmp_form) = $this->extract_post_recursive($key_name . '[' . htmlspecialchars($key, ENT_QUOTES) . ']', $val); |
|
| 382 | + list($tmp_table, $tmp_form) = $this->extract_post_recursive($key_name.'['.htmlspecialchars($key, ENT_QUOTES).']', $val); |
|
| 383 | 383 | |
| 384 | 384 | $table .= $tmp_table; |
| 385 | 385 | |
@@ -389,9 +389,9 @@ discard block |
||
| 389 | 389 | $val = stripslashes($val); |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | - $table .= '<tr><th>' . $key_name . '[' . htmlspecialchars($key, ENT_QUOTES) . ']</th><td>' . htmlspecialchars($val, ENT_QUOTES) . '</td></tr>' . "\n"; |
|
| 392 | + $table .= '<tr><th>'.$key_name.'['.htmlspecialchars($key, ENT_QUOTES).']</th><td>'.htmlspecialchars($val, ENT_QUOTES).'</td></tr>'."\n"; |
|
| 393 | 393 | |
| 394 | - $form .= '<input type="hidden" name="' . $key_name . '[' . htmlspecialchars($key, ENT_QUOTES) . ']" value="' . htmlspecialchars($val, ENT_QUOTES) . '" />' . "\n"; |
|
| 394 | + $form .= '<input type="hidden" name="'.$key_name.'['.htmlspecialchars($key, ENT_QUOTES).']" value="'.htmlspecialchars($val, ENT_QUOTES).'" />'."\n"; |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -451,8 +451,8 @@ discard block |
||
| 451 | 451 | |
| 452 | 452 | public function errorHandler4FindOutput($errNo, $errStr, $errFile, $errLine) |
| 453 | 453 | { |
| 454 | - if (preg_match('?' . preg_quote(XOOPS_ROOT_PATH) . '([^:]+)\:(\d+)?', $errStr, $regs)) { |
|
| 455 | - echo 'Irregular output! check the file ' . htmlspecialchars($regs[1], ENT_QUOTES | ENT_HTML5) . ' line ' . htmlspecialchars($regs[2], ENT_QUOTES | ENT_HTML5); |
|
| 454 | + if (preg_match('?'.preg_quote(XOOPS_ROOT_PATH).'([^:]+)\:(\d+)?', $errStr, $regs)) { |
|
| 455 | + echo 'Irregular output! check the file '.htmlspecialchars($regs[1], ENT_QUOTES | ENT_HTML5).' line '.htmlspecialchars($regs[2], ENT_QUOTES | ENT_HTML5); |
|
| 456 | 456 | } else { |
| 457 | 457 | echo 'Irregular output! check language files etc.'; |
| 458 | 458 | } |
@@ -82,6 +82,12 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | // public function MyXoopsGroupPermForm($title, $modid, $permname, $permdesc) |
| 84 | 84 | |
| 85 | + /** |
|
| 86 | + * @param string $title |
|
| 87 | + * @param integer $modid |
|
| 88 | + * @param string $permname |
|
| 89 | + * @param string $permdesc |
|
| 90 | + */ |
|
| 85 | 91 | public function __construct($title, $modid, $permname, $permdesc) |
| 86 | 92 | { |
| 87 | 93 | // $this->XoopsForm($title, 'groupperm_form', XOOPS_URL.'/modules/system/admin/groupperm.php', 'post'); GIJ |
@@ -121,9 +127,9 @@ discard block |
||
| 121 | 127 | * Add appendix |
| 122 | 128 | * |
| 123 | 129 | * @access public |
| 124 | - * @param $permName |
|
| 125 | - * @param $itemId |
|
| 126 | - * @param $itemName |
|
| 130 | + * @param string $permName |
|
| 131 | + * @param integer $itemId |
|
| 132 | + * @param string $itemName |
|
| 127 | 133 | */ |
| 128 | 134 | |
| 129 | 135 | public function addAppendix($permName, $itemId, $itemName) |
@@ -311,7 +317,7 @@ discard block |
||
| 311 | 317 | /** |
| 312 | 318 | * Constructor |
| 313 | 319 | * @param $caption |
| 314 | - * @param $name |
|
| 320 | + * @param string $name |
|
| 315 | 321 | * @param $groupId |
| 316 | 322 | * @param null $values |
| 317 | 323 | */ |
@@ -486,20 +486,20 @@ |
||
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | $tree .= ' />' |
| 489 | - . $option['name'] |
|
| 490 | - . '<input type="hidden" name="' |
|
| 491 | - . $this->getName() |
|
| 492 | - . '[parents][' |
|
| 493 | - . $option['id'] |
|
| 494 | - . ']" value="' |
|
| 495 | - . implode(':', $parentIds) |
|
| 496 | - . '" /><input type="hidden" name="' |
|
| 497 | - . $this->getName() |
|
| 498 | - . '[itemname][' |
|
| 499 | - . $option['id'] |
|
| 500 | - . ']" value="' |
|
| 501 | - . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5) |
|
| 502 | - . "\" /><br />\n"; |
|
| 489 | + . $option['name'] |
|
| 490 | + . '<input type="hidden" name="' |
|
| 491 | + . $this->getName() |
|
| 492 | + . '[parents][' |
|
| 493 | + . $option['id'] |
|
| 494 | + . ']" value="' |
|
| 495 | + . implode(':', $parentIds) |
|
| 496 | + . '" /><input type="hidden" name="' |
|
| 497 | + . $this->getName() |
|
| 498 | + . '[itemname][' |
|
| 499 | + . $option['id'] |
|
| 500 | + . ']" value="' |
|
| 501 | + . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5) |
|
| 502 | + . "\" /><br />\n"; |
|
| 503 | 503 | |
| 504 | 504 | if (isset($option['children'])) { |
| 505 | 505 | foreach ($option['children'] as $child) { |
@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | exit; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php'; |
|
| 22 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php'; |
|
| 23 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php'; |
|
| 24 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php'; |
|
| 25 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php'; |
|
| 21 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php'; |
|
| 22 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhidden.php'; |
|
| 23 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formbutton.php'; |
|
| 24 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelementtray.php'; |
|
| 25 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/form.php'; |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Renders a form for setting module specific group permissions |
@@ -188,13 +188,13 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | $selected = $grouppermHandler->getItemIds($this->_permName, $i, $this->_modid); |
| 190 | 190 | |
| 191 | - $ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected); |
|
| 191 | + $ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected); |
|
| 192 | 192 | |
| 193 | 193 | $ele->setOptionTree($this->_itemTree); |
| 194 | 194 | |
| 195 | 195 | // GIJ start |
| 196 | 196 | |
| 197 | - $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\[' . $i . '\]/)){elements[i].checked=this.checked;}}};">'); |
|
| 197 | + $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\['.$i.'\]/)){elements[i].checked=this.checked;}}};">'); |
|
| 198 | 198 | |
| 199 | 199 | // GIJ_end |
| 200 | 200 | |
@@ -237,9 +237,9 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | $this->addElement($tray); |
| 239 | 239 | |
| 240 | - $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br />'; |
|
| 240 | + $ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br />'; |
|
| 241 | 241 | |
| 242 | - $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
| 242 | + $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
| 243 | 243 | |
| 244 | 244 | $elements = &$this->getElements(); |
| 245 | 245 | |
@@ -249,21 +249,21 @@ discard block |
||
| 249 | 249 | } elseif (!$elements[$i]->isHidden()) { |
| 250 | 250 | // group name |
| 251 | 251 | |
| 252 | - $ret .= "<tr valign='top' align='" . _GLOBAL_LEFT . "'><td class='head'>" . $elements[$i]->getCaption(); |
|
| 252 | + $ret .= "<tr valign='top' align='"._GLOBAL_LEFT."'><td class='head'>".$elements[$i]->getCaption(); |
|
| 253 | 253 | |
| 254 | 254 | // group description |
| 255 | 255 | |
| 256 | 256 | if ('' != $elements[$i]->getDescription()) { |
| 257 | - $ret .= '<br /><br /><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>'; |
|
| 257 | + $ret .= '<br /><br /><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>'; |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | - $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n"; |
|
| 260 | + $ret .= "</td>\n<td class='even'>\n".$elements[$i]->render()."\n</td></tr>\n"; |
|
| 261 | 261 | } else { |
| 262 | 262 | $ret .= $elements[$i]->render(); |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | - $ret .= '</table>' . $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin') . '</form>'; |
|
| 266 | + $ret .= '</table>'.$xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin').'</form>'; |
|
| 267 | 267 | |
| 268 | 268 | return $ret; |
| 269 | 269 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | |
| 397 | 397 | $checked = $append['selected'] ? 'checked="checked"' : ''; |
| 398 | 398 | |
| 399 | - $name = 'perms[' . $append['permname'] . ']'; |
|
| 399 | + $name = 'perms['.$append['permname'].']'; |
|
| 400 | 400 | |
| 401 | 401 | $itemid = $append['itemid']; |
| 402 | 402 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | |
| 429 | 429 | $this->_renderOptionTree($tree, $this->_optionTree[$topitem], $prefix); |
| 430 | 430 | |
| 431 | - $ret .= $tree . '</td>'; |
|
| 431 | + $ret .= $tree.'</td>'; |
|
| 432 | 432 | |
| 433 | 433 | $cols++; |
| 434 | 434 | } |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | |
| 452 | 452 | public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = []) |
| 453 | 453 | { |
| 454 | - $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="'; |
|
| 454 | + $tree .= $prefix.'<input type="checkbox" name="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" onclick="'; |
|
| 455 | 455 | |
| 456 | 456 | // If there are parent elements, add javascript that will |
| 457 | 457 | |
@@ -460,9 +460,9 @@ discard block |
||
| 460 | 460 | // sure permissions to parent items are added as well. |
| 461 | 461 | |
| 462 | 462 | foreach ($parentIds as $pid) { |
| 463 | - $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']'; |
|
| 463 | + $parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']'; |
|
| 464 | 464 | |
| 465 | - $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if(ele.checked != true) {ele.checked = this.checked;}"; |
|
| 465 | + $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if(ele.checked != true) {ele.checked = this.checked;}"; |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | // If there are child elements, add javascript that will |
@@ -474,9 +474,9 @@ discard block |
||
| 474 | 474 | // is no permission to this item. |
| 475 | 475 | |
| 476 | 476 | foreach ($option['allchild'] as $cid) { |
| 477 | - $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']'; |
|
| 477 | + $child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']'; |
|
| 478 | 478 | |
| 479 | - $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if(this.checked != true) {ele.checked = false;}"; |
|
| 479 | + $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if(this.checked != true) {ele.checked = false;}"; |
|
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | $tree .= '" value="1"'; |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | foreach ($option['children'] as $child) { |
| 506 | 506 | array_push($parentIds, $option['id']); |
| 507 | 507 | |
| 508 | - $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds); |
|
| 508 | + $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.' -', $parentIds); |
|
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | } |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | * @param $xlim |
| 533 | 533 | * @param $yoff |
| 534 | 534 | * @param $ylim |
| 535 | - * @param $nchunks |
|
| 535 | + * @param double $nchunks |
|
| 536 | 536 | * @return array |
| 537 | 537 | */ |
| 538 | 538 | |
@@ -692,10 +692,10 @@ discard block |
||
| 692 | 692 | * |
| 693 | 693 | * Note that XLIM, YLIM are exclusive bounds. All line numbers are |
| 694 | 694 | * origin-0 and discarded lines are not counted. |
| 695 | - * @param $xoff |
|
| 696 | - * @param $xlim |
|
| 697 | - * @param $yoff |
|
| 698 | - * @param $ylim |
|
| 695 | + * @param integer $xoff |
|
| 696 | + * @param integer $xlim |
|
| 697 | + * @param integer $yoff |
|
| 698 | + * @param integer $ylim |
|
| 699 | 699 | */ |
| 700 | 700 | |
| 701 | 701 | public function _compareseq($xoff, $xlim, $yoff, $ylim) |
@@ -145,10 +145,10 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | - * @param $xbeg |
|
| 149 | - * @param $xlen |
|
| 150 | - * @param $ybeg |
|
| 151 | - * @param $ylen |
|
| 148 | + * @param integer $xbeg |
|
| 149 | + * @param integer $xlen |
|
| 150 | + * @param integer $ybeg |
|
| 151 | + * @param integer $ylen |
|
| 152 | 152 | * @param $edits |
| 153 | 153 | * @return string |
| 154 | 154 | */ |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
| 220 | - * @param $header |
|
| 220 | + * @param string $header |
|
| 221 | 221 | * @return string |
| 222 | 222 | */ |
| 223 | 223 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | public function __construct($params = []) |
| 43 | 43 | { |
| 44 | 44 | foreach ($params as $param => $value) { |
| 45 | - $v = '_' . $param; |
|
| 45 | + $v = '_'.$param; |
|
| 46 | 46 | |
| 47 | 47 | if (isset($this->$v)) { |
| 48 | 48 | $this->$v = $value; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $output .= $this->_block($x0, $xi - $x0, $y0, $yi - $y0, $block); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - return $output . $this->_endDiff(); |
|
| 144 | + return $output.$this->_endDiff(); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - return $output . $this->_endBlock(); |
|
| 177 | + return $output.$this->_endBlock(); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
@@ -206,14 +206,14 @@ discard block |
||
| 206 | 206 | public function _blockHeader($xbeg, $xlen, $ybeg, $ylen) |
| 207 | 207 | { |
| 208 | 208 | if ($xlen > 1) { |
| 209 | - $xbeg .= ',' . ($xbeg + $xlen - 1); |
|
| 209 | + $xbeg .= ','.($xbeg + $xlen - 1); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | if ($ylen > 1) { |
| 213 | - $ybeg .= ',' . ($ybeg + $ylen - 1); |
|
| 213 | + $ybeg .= ','.($ybeg + $ylen - 1); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg; |
|
| 216 | + return $xbeg.($xlen ? ($ylen ? 'c' : 'd') : 'a').$ybeg; |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | public function _startBlock($header) |
| 225 | 225 | { |
| 226 | - return $header . "\n"; |
|
| 226 | + return $header."\n"; |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | public function _lines($lines, $prefix = ' ') |
| 245 | 245 | { |
| 246 | - return $prefix . implode("\n$prefix", $lines) . "\n"; |
|
| 246 | + return $prefix.implode("\n$prefix", $lines)."\n"; |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | /** |
@@ -284,6 +284,6 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | public function _changed($orig, $final) |
| 286 | 286 | { |
| 287 | - return $this->_deleted($orig) . "---\n" . $this->_added($final); |
|
| 287 | + return $this->_deleted($orig)."---\n".$this->_added($final); |
|
| 288 | 288 | } |
| 289 | 289 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * @param $lines |
|
| 88 | + * @param string[] $lines |
|
| 89 | 89 | * @param string $prefix |
| 90 | 90 | * @param bool $encode |
| 91 | 91 | * @return string |
@@ -188,8 +188,8 @@ discard block |
||
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
| 191 | - * @param $string |
|
| 192 | - * @param string $newlineEscape |
|
| 191 | + * @param string $string |
|
| 192 | + * @param string string |
|
| 193 | 193 | * @return array |
| 194 | 194 | */ |
| 195 | 195 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | return implode('', $lines); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - return implode("\n", $lines) . "\n"; |
|
| 104 | + return implode("\n", $lines)."\n"; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | array_walk($lines, [&$this, '_encode']); |
| 115 | 115 | |
| 116 | - $lines[0] = $this->_ins_prefix . $lines[0]; |
|
| 116 | + $lines[0] = $this->_ins_prefix.$lines[0]; |
|
| 117 | 117 | |
| 118 | 118 | $lines[count($lines) - 1] .= $this->_ins_suffix; |
| 119 | 119 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | array_walk($lines, [&$this, '_encode']); |
| 132 | 132 | |
| 133 | - $lines[0] = $this->_del_prefix . $lines[0]; |
|
| 133 | + $lines[0] = $this->_del_prefix.$lines[0]; |
|
| 134 | 134 | |
| 135 | 135 | $lines[count($lines) - 1] .= $this->_del_suffix; |
| 136 | 136 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $final[0] = mb_substr($final[0], 1); |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - return $prefix . $this->_deleted($orig) . $this->_added($final); |
|
| 164 | + return $prefix.$this->_deleted($orig).$this->_added($final); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | $text1 = implode("\n", $orig); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | /* Run the diff and get the output. */ |
| 186 | 186 | |
| 187 | - return str_replace($nl, "\n", $renderer->render($diff)) . "\n"; |
|
| 187 | + return str_replace($nl, "\n", $renderer->render($diff))."\n"; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -5,9 +5,9 @@ discard block |
||
| 5 | 5 | // GIJOE <http://www.peak.ne.jp/> // |
| 6 | 6 | // ------------------------------------------------------------------------- // |
| 7 | 7 | |
| 8 | -include_once __DIR__ . '/include/gtickets.php'; |
|
| 9 | -include_once __DIR__ . '/include/altsys_functions.php'; |
|
| 10 | -include_once __DIR__ . '/include/tpls_functions.php'; |
|
| 8 | +include_once __DIR__.'/include/gtickets.php'; |
|
| 9 | +include_once __DIR__.'/include/altsys_functions.php'; |
|
| 10 | +include_once __DIR__.'/include/tpls_functions.php'; |
|
| 11 | 11 | |
| 12 | 12 | // this page can be called only from altsys |
| 13 | 13 | if ('altsys' != $xoopsModule->getVar('dirname')) { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | if ('.zip' == mb_strtolower(mb_substr($orig_filename4check, -4))) { |
| 43 | 43 | // zip |
| 44 | 44 | |
| 45 | - require_once __DIR__ . '/include/Archive_Zip.php'; |
|
| 45 | + require_once __DIR__.'/include/Archive_Zip.php'; |
|
| 46 | 46 | |
| 47 | 47 | $reader = new Archive_Zip($_FILES['tplset_archive']['tmp_name']); |
| 48 | 48 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } elseif ('.tgz' == mb_substr($orig_filename4check, -4) || '.tar.gz' == mb_substr($orig_filename4check, -7)) { |
| 57 | 57 | // tar.gz |
| 58 | 58 | |
| 59 | - require_once XOOPS_ROOT_PATH . '/class/class.tar.php'; |
|
| 59 | + require_once XOOPS_ROOT_PATH.'/class/class.tar.php'; |
|
| 60 | 60 | |
| 61 | 61 | $tar = new tar(); |
| 62 | 62 | |
@@ -184,16 +184,16 @@ |
||
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | $sql = 'INSERT INTO ' |
| 187 | - . $db->prefix('tplfile') |
|
| 188 | - . " SET tpl_file='" |
|
| 189 | - . addslashes(($_POST['tpl_file'])) |
|
| 190 | - . "',tpl_refid=0,tpl_module='" |
|
| 191 | - . addslashes($tpl['tpl_module']) |
|
| 192 | - . "',tpl_tplset='" |
|
| 193 | - . addslashes($tpl['tpl_tplset']) |
|
| 194 | - . "',tpl_lastmodified=UNIX_TIMESTAMP(),tpl_type='" |
|
| 195 | - . addslashes($tpl['tpl_type']) |
|
| 196 | - . "'"; |
|
| 187 | + . $db->prefix('tplfile') |
|
| 188 | + . " SET tpl_file='" |
|
| 189 | + . addslashes(($_POST['tpl_file'])) |
|
| 190 | + . "',tpl_refid=0,tpl_module='" |
|
| 191 | + . addslashes($tpl['tpl_module']) |
|
| 192 | + . "',tpl_tplset='" |
|
| 193 | + . addslashes($tpl['tpl_tplset']) |
|
| 194 | + . "',tpl_lastmodified=UNIX_TIMESTAMP(),tpl_type='" |
|
| 195 | + . addslashes($tpl['tpl_type']) |
|
| 196 | + . "'"; |
|
| 197 | 197 | |
| 198 | 198 | if (!$db->query($sql)) { |
| 199 | 199 | die('SQL Error' . __LINE__); |
@@ -5,13 +5,13 @@ discard block |
||
| 5 | 5 | // GIJOE <http://www.peak.ne.jp/> // |
| 6 | 6 | // ------------------------------------------------------------------------- // |
| 7 | 7 | |
| 8 | -require_once __DIR__ . '/class/AltsysBreadcrumbs.class.php'; |
|
| 9 | -include_once __DIR__ . '/include/gtickets.php'; |
|
| 10 | -include_once __DIR__ . '/include/altsys_functions.php'; |
|
| 11 | -include_once __DIR__ . '/include/tpls_functions.php'; |
|
| 12 | -include_once __DIR__ . '/include/Text_Diff.php'; |
|
| 13 | -include_once __DIR__ . '/include/Text_Diff_Renderer.php'; |
|
| 14 | -include_once __DIR__ . '/include/Text_Diff_Renderer_unified.php'; |
|
| 8 | +require_once __DIR__.'/class/AltsysBreadcrumbs.class.php'; |
|
| 9 | +include_once __DIR__.'/include/gtickets.php'; |
|
| 10 | +include_once __DIR__.'/include/altsys_functions.php'; |
|
| 11 | +include_once __DIR__.'/include/tpls_functions.php'; |
|
| 12 | +include_once __DIR__.'/include/Text_Diff.php'; |
|
| 13 | +include_once __DIR__.'/include/Text_Diff_Renderer.php'; |
|
| 14 | +include_once __DIR__.'/include/Text_Diff_Renderer_unified.php'; |
|
| 15 | 15 | |
| 16 | 16 | // only groups have 'module_admin' of 'altsys' can do that. |
| 17 | 17 | $module_handler = xoops_getHandler('module'); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | // check $xoopsModule |
| 35 | 35 | if (!is_object($xoopsModule)) { |
| 36 | - redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM); |
|
| 36 | + redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // check access right (needs system_admin of tplset) |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | 'tpl_refid' => 0, |
| 58 | 58 | 'tpl_module' => '_custom', |
| 59 | 59 | 'tpl_tplset' => $tpl_tplset, |
| 60 | - 'tpl_file' => '_custom_' . mb_substr(date('YmdHis'), 2, -2) . '.html', |
|
| 60 | + 'tpl_file' => '_custom_'.mb_substr(date('YmdHis'), 2, -2).'.html', |
|
| 61 | 61 | 'tpl_desc' => '', |
| 62 | 62 | 'tpl_lastmodified' => 0, |
| 63 | 63 | 'tpl_lastimported' => 0, |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | $breadcrumbsObj = AltsysBreadcrumbs::getInstance(); |
| 71 | 71 | |
| 72 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN'); |
|
| 72 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN'); |
|
| 73 | 73 | |
| 74 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=_custom', _MYTPLSADMIN_CUSTOMTEMPLATE); |
|
| 74 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=_custom', _MYTPLSADMIN_CUSTOMTEMPLATE); |
|
| 75 | 75 | |
| 76 | 76 | $breadcrumbsObj->appendPath('', '_MYTPLSADMIN_CREATENEWCUSTOMTEMPLATE'); |
| 77 | 77 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | // get information from tplfile table |
| 91 | 91 | |
| 92 | - $sql = 'SELECT * FROM ' . $db->prefix('tplfile') . ' f NATURAL LEFT JOIN ' . $db->prefix('tplsource') . " s WHERE f.tpl_file='$tpl_file4sql' ORDER BY f.tpl_tplset='$tpl_tplset4sql' DESC,f.tpl_tplset='default' DESC"; |
|
| 92 | + $sql = 'SELECT * FROM '.$db->prefix('tplfile').' f NATURAL LEFT JOIN '.$db->prefix('tplsource')." s WHERE f.tpl_file='$tpl_file4sql' ORDER BY f.tpl_tplset='$tpl_tplset4sql' DESC,f.tpl_tplset='default' DESC"; |
|
| 93 | 93 | |
| 94 | 94 | $tpl = $db->fetchArray($db->query($sql)); |
| 95 | 95 | |
@@ -114,19 +114,19 @@ discard block |
||
| 114 | 114 | if ('altsys' != $mydirname && is_object($target_module)) { |
| 115 | 115 | // mytplsform in each modules |
| 116 | 116 | |
| 117 | - $mod_url = XOOPS_URL . '/modules/' . $target_module->getVar('dirname'); |
|
| 117 | + $mod_url = XOOPS_URL.'/modules/'.$target_module->getVar('dirname'); |
|
| 118 | 118 | |
| 119 | 119 | $modinfo = $target_module->getInfo(); |
| 120 | 120 | |
| 121 | - $breadcrumbsObj->appendPath($mod_url . '/' . @$modinfo['adminindex'], $target_mname); |
|
| 121 | + $breadcrumbsObj->appendPath($mod_url.'/'.@$modinfo['adminindex'], $target_mname); |
|
| 122 | 122 | |
| 123 | - $breadcrumbsObj->appendPath($mod_url . '/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', _MD_A_MYTPLSFORM_TPLSADMIN); |
|
| 123 | + $breadcrumbsObj->appendPath($mod_url.'/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', _MD_A_MYTPLSFORM_TPLSADMIN); |
|
| 124 | 124 | } else { |
| 125 | 125 | // mytplsform in altsys |
| 126 | 126 | |
| 127 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN'); |
|
| 127 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN'); |
|
| 128 | 128 | |
| 129 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . htmlspecialchars($tpl['tpl_module'], ENT_QUOTES | ENT_HTML5), $target_mname); |
|
| 129 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.htmlspecialchars($tpl['tpl_module'], ENT_QUOTES | ENT_HTML5), $target_mname); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | $breadcrumbsObj->appendPath('', _MD_A_MYTPLSFORM_EDIT); |
@@ -148,19 +148,19 @@ discard block |
||
| 148 | 148 | // Ticket Check |
| 149 | 149 | |
| 150 | 150 | if (!$xoopsGTicket->check(true, 'altsys_tplsform')) { |
| 151 | - redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); |
|
| 151 | + redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - $result = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_file='$tpl_file4sql' AND tpl_tplset='" . addslashes($tpl['tpl_tplset']) . "'"); |
|
| 154 | + $result = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_file='$tpl_file4sql' AND tpl_tplset='".addslashes($tpl['tpl_tplset'])."'"); |
|
| 155 | 155 | |
| 156 | 156 | while (list($tpl_id) = $db->fetchRow($result)) { |
| 157 | - $sql = 'UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes(($_POST['tpl_source'])) . "' WHERE tpl_id=$tpl_id"; |
|
| 157 | + $sql = 'UPDATE '.$db->prefix('tplsource')." SET tpl_source='".addslashes(($_POST['tpl_source']))."' WHERE tpl_id=$tpl_id"; |
|
| 158 | 158 | |
| 159 | 159 | if (!$db->query($sql)) { |
| 160 | 160 | die('SQL Error'); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $db->query('UPDATE ' . $db->prefix('tplfile') . " SET tpl_lastmodified=UNIX_TIMESTAMP() WHERE tpl_id=$tpl_id"); |
|
| 163 | + $db->query('UPDATE '.$db->prefix('tplfile')." SET tpl_lastmodified=UNIX_TIMESTAMP() WHERE tpl_id=$tpl_id"); |
|
| 164 | 164 | |
| 165 | 165 | altsys_template_touch($tpl_id); |
| 166 | 166 | } |
@@ -168,9 +168,9 @@ discard block |
||
| 168 | 168 | // continue or end ? |
| 169 | 169 | |
| 170 | 170 | if (!empty($_POST['do_modifycont'])) { |
| 171 | - redirect_header('index.php?mode=admin&lib=altsys&page=mytplsform&tpl_file=' . $tpl_file . '&tpl_tplset=' . $tpl_tplset . '&dirname=' . $tpl['tpl_module'] . '#altsys_tplsform_top', 1, _MD_A_MYTPLSFORM_UPDATED); |
|
| 171 | + redirect_header('index.php?mode=admin&lib=altsys&page=mytplsform&tpl_file='.$tpl_file.'&tpl_tplset='.$tpl_tplset.'&dirname='.$tpl['tpl_module'].'#altsys_tplsform_top', 1, _MD_A_MYTPLSFORM_UPDATED); |
|
| 172 | 172 | } else { |
| 173 | - redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_UPDATED); |
|
| 173 | + redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_UPDATED); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | exit; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | // Ticket Check |
| 181 | 181 | |
| 182 | 182 | if (!$xoopsGTicket->check(true, 'altsys_tplsform')) { |
| 183 | - redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); |
|
| 183 | + redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | $sql = 'INSERT INTO ' |
@@ -196,22 +196,22 @@ discard block |
||
| 196 | 196 | . "'"; |
| 197 | 197 | |
| 198 | 198 | if (!$db->query($sql)) { |
| 199 | - die('SQL Error' . __LINE__); |
|
| 199 | + die('SQL Error'.__LINE__); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | $tpl_id = (int)$db->getInsertId(); |
| 203 | 203 | |
| 204 | - $sql = 'INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id=$tpl_id,tpl_source='" . addslashes(($_POST['tpl_source'])) . "'"; |
|
| 204 | + $sql = 'INSERT INTO '.$db->prefix('tplsource')." SET tpl_id=$tpl_id,tpl_source='".addslashes(($_POST['tpl_source']))."'"; |
|
| 205 | 205 | |
| 206 | 206 | if (!$db->query($sql)) { |
| 207 | - die('SQL Error' . __LINE__); |
|
| 207 | + die('SQL Error'.__LINE__); |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | altsys_template_touch($tpl_id); |
| 211 | 211 | |
| 212 | 212 | // continue or end ? |
| 213 | 213 | |
| 214 | - redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_CREATED); |
|
| 214 | + redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_CREATED); |
|
| 215 | 215 | |
| 216 | 216 | exit; |
| 217 | 217 | } |
@@ -220,12 +220,12 @@ discard block |
||
| 220 | 220 | // FORM stage // |
| 221 | 221 | //****************// |
| 222 | 222 | xoops_cp_header(); |
| 223 | -$mymenu_fake_uri = 'index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $mydirname; |
|
| 223 | +$mymenu_fake_uri = 'index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$mydirname; |
|
| 224 | 224 | |
| 225 | 225 | // mymenu |
| 226 | 226 | altsys_include_mymenu(); |
| 227 | 227 | |
| 228 | -echo "<h3 style='text-align:" . _GLOBAL_LEFT . ";'>" . _MD_A_MYTPLSFORM_EDIT . ' : ' . htmlspecialchars($tpl['tpl_type'], ENT_QUOTES) . ' : ' . htmlspecialchars($tpl['tpl_file'], ENT_QUOTES) . ' (' . htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES) . ")</h3>\n"; |
|
| 228 | +echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>"._MD_A_MYTPLSFORM_EDIT.' : '.htmlspecialchars($tpl['tpl_type'], ENT_QUOTES).' : '.htmlspecialchars($tpl['tpl_file'], ENT_QUOTES).' ('.htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES).")</h3>\n"; |
|
| 229 | 229 | |
| 230 | 230 | // diff from file to selected DB template |
| 231 | 231 | $basefilepath = tplsadmin_get_basefilepath($tpl['tpl_module'], $tpl['tpl_type'], $tpl['tpl_file']); |
@@ -243,11 +243,11 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | foreach (explode("\n", $diff_str) as $line) { |
| 245 | 245 | if (0x2d == ord($line)) { |
| 246 | - $diff_from_file4disp .= "<span style='color:red;'>" . $line . "</span>\n"; |
|
| 246 | + $diff_from_file4disp .= "<span style='color:red;'>".$line."</span>\n"; |
|
| 247 | 247 | } elseif (0x2b == ord($line)) { |
| 248 | - $diff_from_file4disp .= "<span style='color:blue;'>" . $line . "</span>\n"; |
|
| 248 | + $diff_from_file4disp .= "<span style='color:blue;'>".$line."</span>\n"; |
|
| 249 | 249 | } else { |
| 250 | - $diff_from_file4disp .= $line . "\n"; |
|
| 250 | + $diff_from_file4disp .= $line."\n"; |
|
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | error_reporting($original_error_level & ~E_NOTICE & ~E_WARNING); |
| 263 | 263 | |
| 264 | - list($default_source) = $db->fetchRow($db->query('SELECT tpl_source FROM ' . $db->prefix('tplfile') . ' NATURAL LEFT JOIN ' . $db->prefix('tplsource') . " WHERE tpl_tplset='default' AND tpl_file='" . addslashes($tpl['tpl_file']) . "' AND tpl_module='" . addslashes($tpl['tpl_module']) . "'")); |
|
| 264 | + list($default_source) = $db->fetchRow($db->query('SELECT tpl_source FROM '.$db->prefix('tplfile').' NATURAL LEFT JOIN '.$db->prefix('tplsource')." WHERE tpl_tplset='default' AND tpl_file='".addslashes($tpl['tpl_file'])."' AND tpl_module='".addslashes($tpl['tpl_module'])."'")); |
|
| 265 | 265 | |
| 266 | 266 | $diff = new Text_Diff(explode("\n", $default_source), explode("\n", $tpl['tpl_source'])); |
| 267 | 267 | |
@@ -271,11 +271,11 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | foreach (explode("\n", $diff_str) as $line) { |
| 273 | 273 | if (0x2d == ord($line)) { |
| 274 | - $diff_from_default4disp .= "<span style='color:red;'>" . $line . "</span>\n"; |
|
| 274 | + $diff_from_default4disp .= "<span style='color:red;'>".$line."</span>\n"; |
|
| 275 | 275 | } elseif (0x2b == ord($line)) { |
| 276 | - $diff_from_default4disp .= "<span style='color:blue;'>" . $line . "</span>\n"; |
|
| 276 | + $diff_from_default4disp .= "<span style='color:blue;'>".$line."</span>\n"; |
|
| 277 | 277 | } else { |
| 278 | - $diff_from_default4disp .= $line . "\n"; |
|
| 278 | + $diff_from_default4disp .= $line."\n"; |
|
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | |
@@ -297,25 +297,25 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | echo " |
| 299 | 299 | <a name='altsys_tplsform_top' id='altsys_tplsform_top'></a> |
| 300 | -<form name='MainForm' id='altsys_tplsform' action='?mode=admin&lib=altsys&page=mytplsform&tpl_file=" . htmlspecialchars($tpl_file, ENT_QUOTES) . '&tpl_tplset=' . htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES) . '&dirname=' . $target_mname . "' method='post'> |
|
| 301 | - " . $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'altsys_tplsform') . " |
|
| 302 | - <textarea name='tpl_source' id='altsys_tpl_source' wrap='off' style='width:600px;height:400px;'>" . htmlspecialchars($tpl['tpl_source'], ENT_QUOTES) . '</textarea> |
|
| 300 | +<form name='MainForm' id='altsys_tplsform' action='?mode=admin&lib=altsys&page=mytplsform&tpl_file=" . htmlspecialchars($tpl_file, ENT_QUOTES).'&tpl_tplset='.htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES).'&dirname='.$target_mname."' method='post'> |
|
| 301 | + " . $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'altsys_tplsform')." |
|
| 302 | + <textarea name='tpl_source' id='altsys_tpl_source' wrap='off' style='width:600px;height:400px;'>" . htmlspecialchars($tpl['tpl_source'], ENT_QUOTES).'</textarea> |
|
| 303 | 303 | <br /> |
| 304 | 304 | '; |
| 305 | 305 | if ('create' == $edit_mode) { |
| 306 | 306 | // create form |
| 307 | 307 | |
| 308 | 308 | echo " |
| 309 | - <label for='tpl_file'>" . _MD_A_MYTPLSFORM_LABEL_TPLFILE . "</label> |
|
| 310 | - <input type='text' name='tpl_file' id='tpl_file' value='" . htmlspecialchars($tpl['tpl_file'], ENT_QUOTES) . "' size='64' /><br /> |
|
| 311 | - <input type='submit' name='do_create' id='do_create' value='" . _MD_A_MYTPLSFORM_BTN_CREATE . "' />\n"; |
|
| 309 | + <label for='tpl_file'>" . _MD_A_MYTPLSFORM_LABEL_TPLFILE."</label> |
|
| 310 | + <input type='text' name='tpl_file' id='tpl_file' value='" . htmlspecialchars($tpl['tpl_file'], ENT_QUOTES)."' size='64' /><br /> |
|
| 311 | + <input type='submit' name='do_create' id='do_create' value='" . _MD_A_MYTPLSFORM_BTN_CREATE."' />\n"; |
|
| 312 | 312 | } else { |
| 313 | 313 | // modify form |
| 314 | 314 | |
| 315 | 315 | echo " |
| 316 | - <input type='submit' name='do_modifycont' id='do_modifycont' value='" . _MD_A_MYTPLSFORM_BTN_MODIFYCONT . "' /> |
|
| 317 | - <input type='submit' name='do_modify' id='do_modify' value='" . _MD_A_MYTPLSFORM_BTN_MODIFYEND . "' /> |
|
| 318 | - <input type='reset' name='reset' value='" . _MD_A_MYTPLSFORM_BTN_RESET . "' /> |
|
| 316 | + <input type='submit' name='do_modifycont' id='do_modifycont' value='" . _MD_A_MYTPLSFORM_BTN_MODIFYCONT."' /> |
|
| 317 | + <input type='submit' name='do_modify' id='do_modify' value='" . _MD_A_MYTPLSFORM_BTN_MODIFYEND."' /> |
|
| 318 | + <input type='reset' name='reset' value='" . _MD_A_MYTPLSFORM_BTN_RESET."' /> |
|
| 319 | 319 | </form>\n"; |
| 320 | 320 | } |
| 321 | 321 | |
@@ -7,8 +7,8 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | error_reporting(0); |
| 9 | 9 | |
| 10 | -include_once __DIR__ . '/include/gtickets.php'; |
|
| 11 | -include_once __DIR__ . '/include/altsys_functions.php'; |
|
| 10 | +include_once __DIR__.'/include/gtickets.php'; |
|
| 11 | +include_once __DIR__.'/include/altsys_functions.php'; |
|
| 12 | 12 | |
| 13 | 13 | // this page can be called only from altsys |
| 14 | 14 | if ('altsys' != $xoopsModule->getVar('dirname')) { |
@@ -19,13 +19,13 @@ discard block |
||
| 19 | 19 | altsys_include_language_file('compilehookadmin'); |
| 20 | 20 | |
| 21 | 21 | if (!empty($_POST['download_zip'])) { |
| 22 | - require_once XOOPS_ROOT_PATH . '/class/zipdownloader.php'; |
|
| 22 | + require_once XOOPS_ROOT_PATH.'/class/zipdownloader.php'; |
|
| 23 | 23 | |
| 24 | 24 | $downloader = new XoopsZipDownloader(); |
| 25 | 25 | |
| 26 | 26 | $do_download = true; |
| 27 | 27 | } elseif (!empty($_POST['download_tgz'])) { |
| 28 | - require_once XOOPS_ROOT_PATH . '/class/tardownloader.php'; |
|
| 28 | + require_once XOOPS_ROOT_PATH.'/class/tardownloader.php'; |
|
| 29 | 29 | |
| 30 | 30 | $downloader = new XoopsTarDownloader(); |
| 31 | 31 | |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | break; |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | -$trs = $xoopsDB->query('SELECT DISTINCT tpl_file,tpl_source,tpl_lastmodified FROM ' . $xoopsDB->prefix('tplfile') . ' NATURAL LEFT JOIN ' . $xoopsDB->prefix('tplsource') . " WHERE tpl_tplset='" . addslashes($tplset) . "' ORDER BY tpl_file"); |
|
| 54 | +$trs = $xoopsDB->query('SELECT DISTINCT tpl_file,tpl_source,tpl_lastmodified FROM '.$xoopsDB->prefix('tplfile').' NATURAL LEFT JOIN '.$xoopsDB->prefix('tplsource')." WHERE tpl_tplset='".addslashes($tplset)."' ORDER BY tpl_file"); |
|
| 55 | 55 | if ($xoopsDB->getRowsNum($trs) <= 0) { |
| 56 | 56 | die(_TPLSADMIN_ERR_INVALIDTPLSET); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | while (list($tpl_file, $tpl_source, $tpl_lastmodified) = $xoopsDB->fetchRow($trs)) { |
| 60 | - $downloader->addFileData($tpl_source, $tplset . '/' . $tpl_file, $tpl_lastmodified); |
|
| 60 | + $downloader->addFileData($tpl_source, $tplset.'/'.$tpl_file, $tpl_lastmodified); |
|
| 61 | 61 | } |
| 62 | 62 | //bugfix by nao-pon ,echo is not necessary for downloader |
| 63 | -$downloader->download('template_' . $tplset, true); |
|
| 63 | +$downloader->download('template_'.$tplset, true); |
|
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | // Keep Block option values when update (by nobunobu) for XOOPS 2.0.x |
| 5 | 5 | global $xoopsDB; |
| 6 | -$query = 'SELECT mid FROM ' . $xoopsDB->prefix('modules') . " WHERE dirname='" . $modversion['dirname'] . "' "; |
|
| 6 | +$query = 'SELECT mid FROM '.$xoopsDB->prefix('modules')." WHERE dirname='".$modversion['dirname']."' "; |
|
| 7 | 7 | $result = $xoopsDB->query($query); |
| 8 | 8 | $record = $xoopsDB->fetchArray($result); |
| 9 | 9 | if ($record) { |
@@ -55,20 +55,20 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | } */ |
| 57 | 57 | |
| 58 | - $sql = 'SELECT * FROM ' . $xoopsDB->prefix('newblocks') . ' WHERE mid=' . $mid . " AND block_type <>'D' AND func_num > $count"; |
|
| 58 | + $sql = 'SELECT * FROM '.$xoopsDB->prefix('newblocks').' WHERE mid='.$mid." AND block_type <>'D' AND func_num > $count"; |
|
| 59 | 59 | |
| 60 | 60 | $fresult = $xoopsDB->query($sql); |
| 61 | 61 | |
| 62 | 62 | while (false !== ($fblock = $xoopsDB->fetchArray($fresult))) { |
| 63 | - $local_msgs[] = 'Non Defined Block <b>' . $fblock['name'] . '</b> will be deleted'; |
|
| 63 | + $local_msgs[] = 'Non Defined Block <b>'.$fblock['name'].'</b> will be deleted'; |
|
| 64 | 64 | |
| 65 | - $sql = 'DELETE FROM ' . $xoopsDB->prefix('newblocks') . " WHERE bid='" . $fblock['bid'] . "'"; |
|
| 65 | + $sql = 'DELETE FROM '.$xoopsDB->prefix('newblocks')." WHERE bid='".$fblock['bid']."'"; |
|
| 66 | 66 | |
| 67 | 67 | $iret = $xoopsDB->query($sql); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | for ($i = 1; $i <= $count; ++$i) { |
| 71 | - $sql = 'SELECT name,options FROM ' . $xoopsDB->prefix('newblocks') . ' WHERE mid=' . $mid . ' AND func_num=' . $i . " AND show_func='" . addslashes($modversion['blocks'][$i]['show_func']) . "' AND func_file='" . addslashes($modversion['blocks'][$i]['file']) . "'"; |
|
| 71 | + $sql = 'SELECT name,options FROM '.$xoopsDB->prefix('newblocks').' WHERE mid='.$mid.' AND func_num='.$i." AND show_func='".addslashes($modversion['blocks'][$i]['show_func'])."' AND func_file='".addslashes($modversion['blocks'][$i]['file'])."'"; |
|
| 72 | 72 | |
| 73 | 73 | $fresult = $xoopsDB->query($sql); |
| 74 | 74 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | if (count($old_vals) == count($def_vals)) { |
| 83 | 83 | $modversion['blocks'][$i]['options'] = $fblock['options']; |
| 84 | 84 | |
| 85 | - $local_msgs[] = "Option's values of the block <b>" . $fblock['name'] . '</b> will be kept. (value = <b>' . $fblock['options'] . '</b>)'; |
|
| 85 | + $local_msgs[] = "Option's values of the block <b>".$fblock['name'].'</b> will be kept. (value = <b>'.$fblock['options'].'</b>)'; |
|
| 86 | 86 | } elseif (count($old_vals) < count($def_vals)) { |
| 87 | 87 | for ($j = 0; $j < count($old_vals); $j++) { |
| 88 | 88 | $def_vals[$j] = $old_vals[$j]; |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $modversion['blocks'][$i]['options'] = implode('|', $def_vals); |
| 92 | 92 | |
| 93 | - $local_msgs[] = "Option's values of the block <b>" . $fblock['name'] . '</b> will be kept and new option(s) are added. (value = <b>' . $modversion['blocks'][$i]['options'] . '</b>)'; |
|
| 93 | + $local_msgs[] = "Option's values of the block <b>".$fblock['name'].'</b> will be kept and new option(s) are added. (value = <b>'.$modversion['blocks'][$i]['options'].'</b>)'; |
|
| 94 | 94 | } else { |
| 95 | - $local_msgs[] = "Option's values of the block <b>" . $fblock['name'] . '</b> will be reset to the default, because of some decrease of options. (value = <b>' . $modversion['blocks'][$i]['options'] . '</b>)'; |
|
| 95 | + $local_msgs[] = "Option's values of the block <b>".$fblock['name'].'</b> will be reset to the default, because of some decrease of options. (value = <b>'.$modversion['blocks'][$i]['options'].'</b>)'; |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | } |