Completed
Push — master ( a4e09c...825da9 )
by Michael
01:51
created
instr.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
admin/cat.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             // Пытаемся удалить категорию
Please login to merge, or discard this patch.
admin/instr.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 инструкции
Please login to merge, or discard this patch.
admin/admin_header.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
admin/menu.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
admin/ajax.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
submit.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -15,17 +15,17 @@  discard block
 block discarded – undo
15 15
 $time = time();
16 16
 
17 17
 // ID инструкции
18
-$instrid = isset($_GET['instrid']) ? (int)$_GET['instrid'] : 0;
19
-$instrid = isset($_POST['instrid']) ? (int)$_POST['instrid'] : $instrid;
18
+$instrid = isset($_GET['instrid']) ? (int) $_GET['instrid'] : 0;
19
+$instrid = isset($_POST['instrid']) ? (int) $_POST['instrid'] : $instrid;
20 20
 // ID страницы
21
-$pageid = isset($_GET['pageid']) ? (int)$_GET['pageid'] : 0;
22
-$pageid = isset($_POST['pageid']) ? (int)$_POST['pageid'] : $pageid;
21
+$pageid = isset($_GET['pageid']) ? (int) $_GET['pageid'] : 0;
22
+$pageid = isset($_POST['pageid']) ? (int) $_POST['pageid'] : $pageid;
23 23
 // ID категории
24
-$cid = isset($_POST['cid']) ? (int)$_POST['cid'] : 0;
24
+$cid = isset($_POST['cid']) ? (int) $_POST['cid'] : 0;
25 25
 // Вес
26
-$weight = isset($_POST['weight']) ? (int)$_POST['weight'] : 0;
26
+$weight = isset($_POST['weight']) ? (int) $_POST['weight'] : 0;
27 27
 //
28
-$pid = isset($_POST['pid']) ? (int)$_POST['pid'] : 0;
28
+$pid = isset($_POST['pid']) ? (int) $_POST['pid'] : 0;
29 29
 
30 30
 // Права на добавление
31 31
 $cat_submit = Xoopsmodules\instruction\Utility::getItemIds($moduleDirName . '_submit');
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             // Объект инструкции
56 56
             $objInsinstr = $instructionHandler->get($instrid);
57 57
             // Можно ли редактировать инструкцию в данной категории
58
-            if (!in_array($objInsinstr->getVar('cid'), $cat_edit)) {
58
+            if ( ! in_array($objInsinstr->getVar('cid'), $cat_edit)) {
59 59
                 redirect_header('index.php', 3, _MD_INSTRUCTION_NOPERM_EDITPAGE);
60 60
             }
61 61
             // Создание новой страницы
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             // Объект инструкции
69 69
             $objInsinstr = $instructionHandler->get($instrid);
70 70
             // Можно ли добавлять инструкции в данной категории
71
-            if (!in_array($objInsinstr->getVar('cid'), $cat_submit)) {
71
+            if ( ! in_array($objInsinstr->getVar('cid'), $cat_submit)) {
72 72
                 redirect_header('index.php', 3, _MD_INSTRUCTION_NOPERM_SUBMITPAGE);
73 73
             }
74 74
         } else {
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     case 'savepage':
104 104
 
105 105
         // Проверка
106
-        if (!$GLOBALS['xoopsSecurity']->check()) {
106
+        if ( ! $GLOBALS['xoopsSecurity']->check()) {
107 107
             redirect_header('index.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
108 108
         }
109 109
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             // Объект инструкции
117 117
             $objInsinstr = $instructionHandler->get($objInspage->getVar('instrid'));
118 118
             // Можно ли редактировать инструкцию в данной категории
119
-            if (!in_array($objInsinstr->getVar('cid'), $cat_edit)) {
119
+            if ( ! in_array($objInsinstr->getVar('cid'), $cat_edit)) {
120 120
                 redirect_header('index.php', 3, _MD_INSTRUCTION_NOPERM_EDITPAGE);
121 121
             }
122 122
         } elseif ($instrid) {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             // Объект инструкции
125 125
             $objInsinstr = $instructionHandler->get($instrid);
126 126
             // Можно ли добавлять инструкции в данной категории
127
-            if (!in_array($objInsinstr->getVar('cid'), $cat_submit)) {
127
+            if ( ! in_array($objInsinstr->getVar('cid'), $cat_submit)) {
128 128
                 redirect_header('index.php', 3, _MD_INSTRUCTION_NOPERM_SUBMITPAGE);
129 129
             }
130 130
 
@@ -153,18 +153,18 @@  discard block
 block discarded – undo
153 153
         $objInspage->setVar('description', $_POST['description']);
154 154
 
155 155
         // Проверка категорий
156
-        if (!$pageid && !$instrid) {
157
-            $err         = true;
156
+        if ( ! $pageid && ! $instrid) {
157
+            $err = true;
158 158
             $message_err .= _MD_INSTRUCTION_ERR_INSTR . '<br>';
159 159
         }
160 160
         // Проверка веса
161 161
         if (0 == $weight) {
162
-            $err         = true;
162
+            $err = true;
163 163
             $message_err .= _MD_INSTRUCTION_ERR_WEIGHT . '<br>';
164 164
         }
165 165
         // Проверка родительской страницы
166 166
         if ($pageid && ($pageid == $pid)) {
167
-            $err         = true;
167
+            $err = true;
168 168
             $message_err .= _MD_INSTRUCTION_ERR_PPAGE . '<br>';
169 169
         }
170 170
         // Если были ошибки
Please login to merge, or discard this patch.
page.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 // Получаем данные
22 22
 // ID страницы
23
-$pageid = isset($_GET['id']) ? (int)$_GET['id'] : 0;
23
+$pageid = isset($_GET['id']) ? (int) $_GET['id'] : 0;
24 24
 // Без кэша
25 25
 $nocache = Xoopsmodules\instruction\Utility::cleanVars($_GET, 'nocache', 0, 'int');
26 26
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
 // Права на просмотр инструкции
61 61
 $categories = Xoopsmodules\instruction\Utility::getItemIds();
62
-if (!in_array($objInsinstr->getVar('cid'), $categories)) {
62
+if ( ! in_array($objInsinstr->getVar('cid'), $categories)) {
63 63
     redirect_header(XOOPS_URL . '/modules/' . $moduleDirName . '/', 3, _NOPERM);
64 64
     exit();
65 65
 }
Please login to merge, or discard this patch.
preloads/autoloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 /**
4 4
  * @see http://www.php-fig.org/psr/psr-4/examples/
5 5
  */
6
-spl_autoload_register(function ($class) {
6
+spl_autoload_register(function($class) {
7 7
     // project-specific namespace prefix
8 8
     $prefix = 'Xoopsmodules\\instruction\\';
9 9
 
Please login to merge, or discard this patch.