@@ -15,7 +15,7 @@ |
||
| 15 | 15 | class InstructionHandler extends \XoopsPersistableObjectHandler |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * @param null|mixed $db |
|
| 18 | + * @param null|\XoopsDatabase $db |
|
| 19 | 19 | */ |
| 20 | 20 | public function __construct(\XoopsDatabase $db = null) |
| 21 | 21 | { |
@@ -32,9 +32,9 @@ |
||
| 32 | 32 | public function updateDateupdated($instrid = 0, $time = null) |
| 33 | 33 | { |
| 34 | 34 | // Если не передали время |
| 35 | - $time = null === $time ? time() : (int)$time; |
|
| 35 | + $time = null === $time ? time() : (int) $time; |
|
| 36 | 36 | // |
| 37 | - $sql = sprintf('UPDATE `%s` SET `dateupdated` = %u WHERE `instrid` = %u', $this->table, $time, (int)$instrid); |
|
| 37 | + $sql = sprintf('UPDATE `%s` SET `dateupdated` = %u WHERE `instrid` = %u', $this->table, $time, (int) $instrid); |
|
| 38 | 38 | // |
| 39 | 39 | return $this->db->query($sql); |
| 40 | 40 | } |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | // } |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * @param $key |
|
| 27 | - * @param $ret |
|
| 28 | - * @param $prefix_orig |
|
| 26 | + * @param integer $key |
|
| 27 | + * @param string $ret |
|
| 28 | + * @param string $prefix_orig |
|
| 29 | 29 | * @param $objInsinstr |
| 30 | 30 | * @param string $class |
| 31 | 31 | * @param string $prefix_curr |
@@ -140,9 +140,9 @@ discard block |
||
| 140 | 140 | // ================================== |
| 141 | 141 | |
| 142 | 142 | /** |
| 143 | - * @param $key |
|
| 144 | - * @param $ret |
|
| 145 | - * @param $prefix_orig |
|
| 143 | + * @param integer $key |
|
| 144 | + * @param string $ret |
|
| 145 | + * @param string $prefix_orig |
|
| 146 | 146 | * @param array $cidinstrids |
| 147 | 147 | * @param string $class |
| 148 | 148 | * @param string $prefix_curr |
@@ -239,8 +239,8 @@ discard block |
||
| 239 | 239 | // ====================================== |
| 240 | 240 | |
| 241 | 241 | /** |
| 242 | - * @param $key |
|
| 243 | - * @param $ret |
|
| 242 | + * @param integer $key |
|
| 243 | + * @param string $ret |
|
| 244 | 244 | * @param int $currpageid |
| 245 | 245 | * @param array $lastpageids |
| 246 | 246 | * @param int $level |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | // Находим предыдущую и следующую страницы. |
| 351 | 351 | // Находим последнии страницы на каждом уровне. |
| 352 | 352 | /** |
| 353 | - * @param $key |
|
| 353 | + * @param integer $key |
|
| 354 | 354 | * @param int $currpageid |
| 355 | 355 | * @param array $prevpages |
| 356 | 356 | * @param array $nextpages |
@@ -46,8 +46,8 @@ |
||
| 46 | 46 | // Редактор |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * @param $caption |
|
| 50 | - * @param $name |
|
| 49 | + * @param string $caption |
|
| 50 | + * @param string $name |
|
| 51 | 51 | * @param string $value |
| 52 | 52 | * @return bool|\XoopsFormEditor |
| 53 | 53 | */ |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | //$categoryHandler = xoops_getModuleHandler('category', 'instruction'); |
| 13 | 13 | //$pageHandler = xoops_getModuleHandler('page', 'instruction'); |
| 14 | 14 | |
| 15 | -$instrid = isset($_GET['id']) ? (int)$_GET['id'] : 0; |
|
| 15 | +$instrid = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 16 | 16 | |
| 17 | 17 | // Существует ли такая инструкция |
| 18 | 18 | $criteria = new \CriteriaCompo(); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | // Права на просмотр инструкции |
| 43 | 43 | $categories = Xoopsmodules\instruction\Utility::getItemIds(); |
| 44 | -if (!in_array($objInsinstr->getVar('cid'), $categories)) { |
|
| 44 | +if ( ! in_array($objInsinstr->getVar('cid'), $categories)) { |
|
| 45 | 45 | redirect_header(XOOPS_URL . '/modules/' . $moduleDirName . '/', 3, _NOPERM); |
| 46 | 46 | exit(); |
| 47 | 47 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | case 'savecat': |
| 101 | 101 | |
| 102 | 102 | // Проверка |
| 103 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 103 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
| 104 | 104 | redirect_header('cat.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
| 105 | 105 | } |
| 106 | 106 | // Если мы редактируем |
@@ -126,12 +126,12 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | // Проверка веса |
| 128 | 128 | if (0 == $weight) { |
| 129 | - $err = true; |
|
| 129 | + $err = true; |
|
| 130 | 130 | $message_err .= _AM_INSTRUCTION_ERR_WEIGHT . '<br>'; |
| 131 | 131 | } |
| 132 | 132 | // Проверка категорий |
| 133 | 133 | if ($cid && ($cid == $pid)) { |
| 134 | - $err = true; |
|
| 134 | + $err = true; |
|
| 135 | 135 | $message_err .= _AM_INSTRUCTION_ERR_PCAT . '<br>'; |
| 136 | 136 | } |
| 137 | 137 | // Если были ошибки |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | $objInscat = $categoryHandler->get($cid); |
| 239 | 239 | // Если нет такой категории |
| 240 | - if (!is_object($objInscat)) { |
|
| 240 | + if ( ! is_object($objInscat)) { |
|
| 241 | 241 | redirect_header('cat.php', 3, _AM_INSTRUCTION_ERR_CATNOTSELECT); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -253,12 +253,12 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | // Нажали ли мы на кнопку OK |
| 256 | - $ok = isset($_POST['ok']) ? (int)$_POST['ok'] : 0; |
|
| 256 | + $ok = isset($_POST['ok']) ? (int) $_POST['ok'] : 0; |
|
| 257 | 257 | // Если мы нажали на кнопку |
| 258 | 258 | if ($ok) { |
| 259 | 259 | |
| 260 | 260 | // Проверка |
| 261 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 261 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
| 262 | 262 | redirect_header('cat.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
| 263 | 263 | } |
| 264 | 264 | // Пытаемся удалить категорию |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | // Получаем объект категории |
| 62 | 62 | $objInscat = $categoryHandler->get($cid); |
| 63 | 63 | // Если нет такой категории |
| 64 | - if (!is_object($objInscat)) { |
|
| 64 | + if ( ! is_object($objInscat)) { |
|
| 65 | 65 | redirect_header('cat.php', 3, _AM_INSTRUCTION_ERR_CATNOTSELECT); |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | case 'saveinstr': |
| 168 | 168 | |
| 169 | 169 | // Проверка |
| 170 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 170 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
| 171 | 171 | redirect_header('instr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
| 172 | 172 | } |
| 173 | 173 | // Если мы редактируем |
@@ -198,18 +198,18 @@ discard block |
||
| 198 | 198 | $objInsinstr->setVar('metadescription', $_POST['metadescription']); |
| 199 | 199 | |
| 200 | 200 | // Проверка категорий |
| 201 | - if (!$cid) { |
|
| 202 | - $err = true; |
|
| 201 | + if ( ! $cid) { |
|
| 202 | + $err = true; |
|
| 203 | 203 | $message_err .= _AM_INSTRUCTION_ERR_CAT . '<br>'; |
| 204 | 204 | } |
| 205 | 205 | // Проверка названия |
| 206 | - if (!$instr_title) { |
|
| 207 | - $err = true; |
|
| 206 | + if ( ! $instr_title) { |
|
| 207 | + $err = true; |
|
| 208 | 208 | $message_err .= _AM_INSTR_ERR_TITLE . '<br>'; |
| 209 | 209 | } |
| 210 | 210 | // Проверка основного текста |
| 211 | - if (!$instr_description) { |
|
| 212 | - $err = true; |
|
| 211 | + if ( ! $instr_description) { |
|
| 212 | + $err = true; |
|
| 213 | 213 | $message_err .= _AM_INSTR_ERR_DESCRIPTION . '<br>'; |
| 214 | 214 | } |
| 215 | 215 | |
@@ -309,12 +309,12 @@ discard block |
||
| 309 | 309 | $objInsinstr = $instructionHandler->get($instrid); |
| 310 | 310 | |
| 311 | 311 | // Нажали ли мы на кнопку OK |
| 312 | - $ok = isset($_POST['ok']) ? (int)$_POST['ok'] : 0; |
|
| 312 | + $ok = isset($_POST['ok']) ? (int) $_POST['ok'] : 0; |
|
| 313 | 313 | // |
| 314 | 314 | if ($ok) { |
| 315 | 315 | |
| 316 | 316 | // Проверка |
| 317 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 317 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
| 318 | 318 | redirect_header('instr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
| 319 | 319 | } |
| 320 | 320 | // Находим все страницы, пренадлежащие этой инструкции |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | $message_err = ''; |
| 402 | 402 | |
| 403 | 403 | // Проверка сессии |
| 404 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 404 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
| 405 | 405 | $err = true; |
| 406 | 406 | $err_txt = implode(', ', $GLOBALS['xoopsSecurity']->getErrors()); |
| 407 | 407 | $message_err .= $err_txt . '<br>'; |
@@ -447,10 +447,10 @@ discard block |
||
| 447 | 447 | // Мета-теги ключевых слов |
| 448 | 448 | $objInspage->setVar('description', Xoopsmodules\instruction\Utility::cleanVars($_POST, 'description', '', 'string')); |
| 449 | 449 | // |
| 450 | - $dosmiley = (isset($_POST['dosmiley']) && (int)$_POST['dosmiley'] > 0) ? 1 : 0; |
|
| 451 | - $doxcode = (isset($_POST['doxcode']) && (int)$_POST['doxcode'] > 0) ? 1 : 0; |
|
| 452 | - $dobr = (isset($_POST['dobr']) && (int)$_POST['dobr'] > 0) ? 1 : 0; |
|
| 453 | - $dohtml = (isset($_POST['dohtml']) && (int)$_POST['dohtml'] > 0) ? 1 : 0; |
|
| 450 | + $dosmiley = (isset($_POST['dosmiley']) && (int) $_POST['dosmiley'] > 0) ? 1 : 0; |
|
| 451 | + $doxcode = (isset($_POST['doxcode']) && (int) $_POST['doxcode'] > 0) ? 1 : 0; |
|
| 452 | + $dobr = (isset($_POST['dobr']) && (int) $_POST['dobr'] > 0) ? 1 : 0; |
|
| 453 | + $dohtml = (isset($_POST['dohtml']) && (int) $_POST['dohtml'] > 0) ? 1 : 0; |
|
| 454 | 454 | //$doimage = ( isset( $_POST['doimage'] ) && intval( $_POST['doimage'] ) > 0 ) ? 1 : 0; |
| 455 | 455 | $objInspage->setVar('dohtml', $dohtml); |
| 456 | 456 | $objInspage->setVar('dosmiley', $dosmiley); |
@@ -459,28 +459,28 @@ discard block |
||
| 459 | 459 | $objInspage->setVar('dobr', $dobr); |
| 460 | 460 | |
| 461 | 461 | // |
| 462 | - if (!$pageid && !$instrid) { |
|
| 463 | - $err = true; |
|
| 462 | + if ( ! $pageid && ! $instrid) { |
|
| 463 | + $err = true; |
|
| 464 | 464 | $message_err .= _AM_INSTRUCTION_ERR_INSTR . '<br>'; |
| 465 | 465 | } |
| 466 | 466 | // Проверка веса |
| 467 | 467 | if (0 == $weight) { |
| 468 | - $err = true; |
|
| 468 | + $err = true; |
|
| 469 | 469 | $message_err .= _AM_INSTRUCTION_ERR_WEIGHT . '<br>'; |
| 470 | 470 | } |
| 471 | 471 | // Проверка родительской страницы |
| 472 | 472 | if ($pageid && ($pageid == $pid)) { |
| 473 | - $err = true; |
|
| 473 | + $err = true; |
|
| 474 | 474 | $message_err .= _AM_INSTRUCTION_ERR_PPAGE . '<br>'; |
| 475 | 475 | } |
| 476 | 476 | // Проверка названия |
| 477 | - if (!$page_title) { |
|
| 478 | - $err = true; |
|
| 477 | + if ( ! $page_title) { |
|
| 478 | + $err = true; |
|
| 479 | 479 | $message_err .= _AM_INSTR_ERR_TITLE . '<br>'; |
| 480 | 480 | } |
| 481 | 481 | // Проверка основного текста |
| 482 | - if (!$page_hometext) { |
|
| 483 | - $err = true; |
|
| 482 | + if ( ! $page_hometext) { |
|
| 483 | + $err = true; |
|
| 484 | 484 | $message_err .= _AM_INSTR_ERR_HOMETEXT . '<br>'; |
| 485 | 485 | } |
| 486 | 486 | |
@@ -543,12 +543,12 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | $objInspage = $pageHandler->get($pageid); |
| 545 | 545 | // Нажали ли мы на кнопку OK |
| 546 | - $ok = isset($_POST['ok']) ? (int)$_POST['ok'] : 0; |
|
| 546 | + $ok = isset($_POST['ok']) ? (int) $_POST['ok'] : 0; |
|
| 547 | 547 | // Если мы нажали на кнопку |
| 548 | 548 | if ($ok) { |
| 549 | 549 | |
| 550 | 550 | // Проверка |
| 551 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 551 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
| 552 | 552 | redirect_header('instr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
| 553 | 553 | } |
| 554 | 554 | // ID инструкции |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | //if (is_object($GLOBALS['xoopsUser'])) { |
| 14 | 14 | if ($GLOBALS['xoopsUser'] instanceof XoopsUser) { |
| 15 | - if (!$helper->isUserAdmin()) { |
|
| 15 | + if ( ! $helper->isUserAdmin()) { |
|
| 16 | 16 | $helper->redirect(XOOPS_URL . '/', 3, _NOPERM); |
| 17 | 17 | } |
| 18 | 18 | } else { |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | /** @var Xmf\Module\Admin $adminObject */ |
| 23 | 23 | $adminObject = \Xmf\Module\Admin::getInstance(); |
| 24 | 24 | |
| 25 | -if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
|
| 25 | +if ( ! isset($GLOBALS['xoopsTpl']) || ! ($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
|
| 26 | 26 | require_once $GLOBALS['xoops']->path('class/template.php'); |
| 27 | 27 | $xoopsTpl = new \XoopsTpl(); |
| 28 | 28 | } |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Xoopsmodules\instruction; |
| 4 | 4 | |
| 5 | -if (!isset($moduleDirName)) { |
|
| 5 | +if ( ! isset($moduleDirName)) { |
|
| 6 | 6 | $moduleDirName = basename(dirname(__DIR__)); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | $type = Xoopsmodules\instruction\Utility::cleanVars($_POST, 'type', 0, 'int'); |
| 42 | 42 | $keywords = Xoopsmodules\instruction\Utility::cleanVars($_POST, 'keywords', '', 'string'); |
| 43 | 43 | $description = Xoopsmodules\instruction\Utility::cleanVars($_POST, 'description', '', 'string'); |
| 44 | - $dosmiley = (isset($_POST['dosmiley']) && (int)$_POST['dosmiley'] > 0) ? 1 : 0; |
|
| 45 | - $doxcode = (isset($_POST['doxcode']) && (int)$_POST['doxcode'] > 0) ? 1 : 0; |
|
| 46 | - $dobr = (isset($_POST['dobr']) && (int)$_POST['dobr'] > 0) ? 1 : 0; |
|
| 47 | - $dohtml = (isset($_POST['dohtml']) && (int)$_POST['dohtml'] > 0) ? 1 : 0; |
|
| 44 | + $dosmiley = (isset($_POST['dosmiley']) && (int) $_POST['dosmiley'] > 0) ? 1 : 0; |
|
| 45 | + $doxcode = (isset($_POST['doxcode']) && (int) $_POST['doxcode'] > 0) ? 1 : 0; |
|
| 46 | + $dobr = (isset($_POST['dobr']) && (int) $_POST['dobr'] > 0) ? 1 : 0; |
|
| 47 | + $dohtml = (isset($_POST['dohtml']) && (int) $_POST['dohtml'] > 0) ? 1 : 0; |
|
| 48 | 48 | //$dohtml = Xoopsmodules\instruction\Utility::cleanVars( $_POST, 'dohtml', 0, 'int' ); |
| 49 | 49 | //$dosmiley = Xoopsmodules\instruction\Utility::cleanVars( $_POST, 'dosmiley', 0, 'int' ); |
| 50 | 50 | //$doxcode = Xoopsmodules\instruction\Utility::cleanVars( $_POST, 'doxcode', 0, 'int' ); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $instrid = Xoopsmodules\instruction\Utility::cleanVars($_POST, 'instrid', 0, 'int'); |
| 54 | 54 | |
| 55 | 55 | // Проверка |
| 56 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 56 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
| 57 | 57 | $err = true; |
| 58 | 58 | $err_txt = implode(', ', $GLOBALS['xoopsSecurity']->getErrors()); |
| 59 | 59 | $message_err .= $err_txt . '<br>' . _AM_INSTR_TRY_AGAIN . '<br>'; |
@@ -113,28 +113,28 @@ discard block |
||
| 113 | 113 | $objInspage->setVar('dobr', $dobr); |
| 114 | 114 | |
| 115 | 115 | // Проверка категорий |
| 116 | - if (!$pageid && !$instrid) { |
|
| 117 | - $err = true; |
|
| 116 | + if ( ! $pageid && ! $instrid) { |
|
| 117 | + $err = true; |
|
| 118 | 118 | $message_err .= _AM_INSTRUCTION_ERR_INSTR . '<br>'; |
| 119 | 119 | } |
| 120 | 120 | // Проверка веса |
| 121 | 121 | if (0 == $weight) { |
| 122 | - $err = true; |
|
| 122 | + $err = true; |
|
| 123 | 123 | $message_err .= _AM_INSTRUCTION_ERR_WEIGHT . '<br>'; |
| 124 | 124 | } |
| 125 | 125 | // Проверка родительской страницы |
| 126 | 126 | if ($pageid && ($pageid == $pid)) { |
| 127 | - $err = true; |
|
| 127 | + $err = true; |
|
| 128 | 128 | $message_err .= _AM_INSTRUCTION_ERR_PPAGE . '<br>'; |
| 129 | 129 | } |
| 130 | 130 | // Проверка названия |
| 131 | - if (!$title) { |
|
| 132 | - $err = true; |
|
| 131 | + if ( ! $title) { |
|
| 132 | + $err = true; |
|
| 133 | 133 | $message_err .= _AM_INSTR_ERR_TITLE . '<br>'; |
| 134 | 134 | } |
| 135 | 135 | // Проверка основного текста |
| 136 | - if (!$hometext) { |
|
| 137 | - $err = true; |
|
| 136 | + if ( ! $hometext) { |
|
| 137 | + $err = true; |
|
| 138 | 138 | $message_err .= _AM_INSTR_ERR_HOMETEXT . '<br>'; |
| 139 | 139 | } |
| 140 | 140 | |