Completed
Push — master ( 8239ac...55b92e )
by Michael
01:49
created
admin/instr.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             // Получаем объект категории
60 60
             $objInscat = $inscatHandler->get($cid);
61 61
             // Если нет такой категории
62
-            if (!is_object($objInscat)) {
62
+            if ( ! is_object($objInscat)) {
63 63
                 redirect_header('cat.php', 3, _AM_INSTRUCTION_ERR_CATNOTSELECT);
64 64
             }
65 65
         }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     case 'saveinstr':
170 170
 
171 171
         // Проверка
172
-        if (!$GLOBALS['xoopsSecurity']->check()) {
172
+        if ( ! $GLOBALS['xoopsSecurity']->check()) {
173 173
             redirect_header('instr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
174 174
         }
175 175
         // Если мы редактируем
@@ -200,18 +200,18 @@  discard block
 block discarded – undo
200 200
         $objInsinstr->setVar('metadescription', $_POST['metadescription']);
201 201
 
202 202
         // Проверка категорий
203
-        if (!$cid) {
204
-            $err         = true;
203
+        if ( ! $cid) {
204
+            $err = true;
205 205
             $message_err .= _AM_INSTRUCTION_ERR_CAT . '<br>';
206 206
         }
207 207
         // Проверка названия
208
-        if (!$instr_title) {
209
-            $err         = true;
208
+        if ( ! $instr_title) {
209
+            $err = true;
210 210
             $message_err .= _AM_INSTR_ERR_TITLE . '<br>';
211 211
         }
212 212
         // Проверка основного текста
213
-        if (!$instr_description) {
214
-            $err         = true;
213
+        if ( ! $instr_description) {
214
+            $err = true;
215 215
             $message_err .= _AM_INSTR_ERR_DESCRIPTION . '<br>';
216 216
         }
217 217
 
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
         $objInsinstr = $insinstrHandler->get($instrid);
316 316
 
317 317
         // Нажали ли мы на кнопку OK
318
-        $ok = isset($_POST['ok']) ? (int)$_POST['ok'] : 0;
318
+        $ok = isset($_POST['ok']) ? (int) $_POST['ok'] : 0;
319 319
         //
320 320
         if ($ok) {
321 321
 
322 322
             // Проверка
323
-            if (!$GLOBALS['xoopsSecurity']->check()) {
323
+            if ( ! $GLOBALS['xoopsSecurity']->check()) {
324 324
                 redirect_header('instr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
325 325
             }
326 326
             // Находим все страницы, пренадлежащие этой инструкции
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         $message_err = '';
412 412
 
413 413
         // Проверка сессии
414
-        if (!$GLOBALS['xoopsSecurity']->check()) {
414
+        if ( ! $GLOBALS['xoopsSecurity']->check()) {
415 415
             $err         = true;
416 416
             $err_txt     = implode(', ', $GLOBALS['xoopsSecurity']->getErrors());
417 417
             $message_err .= $err_txt . '<br>';
@@ -457,10 +457,10 @@  discard block
 block discarded – undo
457 457
         // Мета-теги ключевых слов
458 458
         $objInspage->setVar('description', InstructionUtility::cleanVars($_POST, 'description', '', 'string'));
459 459
         //
460
-        $dosmiley = (isset($_POST['dosmiley']) && (int)$_POST['dosmiley'] > 0) ? 1 : 0;
461
-        $doxcode  = (isset($_POST['doxcode']) && (int)$_POST['doxcode'] > 0) ? 1 : 0;
462
-        $dobr     = (isset($_POST['dobr']) && (int)$_POST['dobr'] > 0) ? 1 : 0;
463
-        $dohtml   = (isset($_POST['dohtml']) && (int)$_POST['dohtml'] > 0) ? 1 : 0;
460
+        $dosmiley = (isset($_POST['dosmiley']) && (int) $_POST['dosmiley'] > 0) ? 1 : 0;
461
+        $doxcode  = (isset($_POST['doxcode']) && (int) $_POST['doxcode'] > 0) ? 1 : 0;
462
+        $dobr     = (isset($_POST['dobr']) && (int) $_POST['dobr'] > 0) ? 1 : 0;
463
+        $dohtml   = (isset($_POST['dohtml']) && (int) $_POST['dohtml'] > 0) ? 1 : 0;
464 464
         //$doimage = ( isset( $_POST['doimage'] ) && intval( $_POST['doimage'] ) > 0 ) ? 1 : 0;
465 465
         $objInspage->setVar('dohtml', $dohtml);
466 466
         $objInspage->setVar('dosmiley', $dosmiley);
@@ -469,28 +469,28 @@  discard block
 block discarded – undo
469 469
         $objInspage->setVar('dobr', $dobr);
470 470
 
471 471
         //
472
-        if (!$pageid && !$instrid) {
473
-            $err         = true;
472
+        if ( ! $pageid && ! $instrid) {
473
+            $err = true;
474 474
             $message_err .= _AM_INSTRUCTION_ERR_INSTR . '<br>';
475 475
         }
476 476
         // Проверка веса
477 477
         if (0 == $weight) {
478
-            $err         = true;
478
+            $err = true;
479 479
             $message_err .= _AM_INSTRUCTION_ERR_WEIGHT . '<br>';
480 480
         }
481 481
         // Проверка родительской страницы
482 482
         if ($pageid && ($pageid == $pid)) {
483
-            $err         = true;
483
+            $err = true;
484 484
             $message_err .= _AM_INSTRUCTION_ERR_PPAGE . '<br>';
485 485
         }
486 486
         // Проверка названия
487
-        if (!$page_title) {
488
-            $err         = true;
487
+        if ( ! $page_title) {
488
+            $err = true;
489 489
             $message_err .= _AM_INSTR_ERR_TITLE . '<br>';
490 490
         }
491 491
         // Проверка основного текста
492
-        if (!$page_hometext) {
493
-            $err         = true;
492
+        if ( ! $page_hometext) {
493
+            $err = true;
494 494
             $message_err .= _AM_INSTR_ERR_HOMETEXT . '<br>';
495 495
         }
496 496
 
@@ -555,12 +555,12 @@  discard block
 block discarded – undo
555 555
 
556 556
         $objInspage = $inspageHandler->get($pageid);
557 557
         // Нажали ли мы на кнопку OK
558
-        $ok = isset($_POST['ok']) ? (int)$_POST['ok'] : 0;
558
+        $ok = isset($_POST['ok']) ? (int) $_POST['ok'] : 0;
559 559
         // Если мы нажали на кнопку
560 560
         if ($ok) {
561 561
 
562 562
             // Проверка
563
-            if (!$GLOBALS['xoopsSecurity']->check()) {
563
+            if ( ! $GLOBALS['xoopsSecurity']->check()) {
564 564
                 redirect_header('instr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
565 565
             }
566 566
             // ID инструкции
Please login to merge, or discard this patch.
instr.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 $inscatHandler   = xoops_getModuleHandler('category', 'instruction');
12 12
 $inspageHandler  = xoops_getModuleHandler('page', 'instruction');
13 13
 
14
-$instrid = isset($_GET['id']) ? (int)$_GET['id'] : 0;
14
+$instrid = isset($_GET['id']) ? (int) $_GET['id'] : 0;
15 15
 
16 16
 // Существует ли такая инструкция
17 17
 $criteria = new CriteriaCompo();
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 // Права на просмотр инструкции
42 42
 $categories = InstructionUtility::getItemIds();
43
-if (!in_array($objInsinstr->getVar('cid'), $categories)) {
43
+if ( ! in_array($objInsinstr->getVar('cid'), $categories)) {
44 44
     redirect_header(XOOPS_URL . '/modules/' . $moduleDirName . '/', 3, _NOPERM);
45 45
     exit();
46 46
 }
Please login to merge, or discard this patch.