Completed
Push — master ( 5fe85d...a4e09c )
by Michael
01:40
created
class/page.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         // Находим все страницы данной инструкции
74 74
         $criteria->add(new Criteria('instrid', $instrid_page, '='));
75 75
         // Если мы редактируем, то убрать текущую страницу из списка выбора родительской
76
-        if (!$this->isNew()) {
76
+        if ( ! $this->isNew()) {
77 77
             $criteria->add(new Criteria('pageid', $this->getVar('pageid'), '<>'));
78 78
         }
79 79
         $criteria->setSort('weight');
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $form->addElement($option_tray);
129 129
 
130 130
         // Если мы редактируем страницу
131
-        if (!$this->isNew()) {
131
+        if ( ! $this->isNew()) {
132 132
             $form->addElement(new XoopsFormHidden('pageid', $this->getVar('pageid')));
133 133
         } else {
134 134
             $form->addElement(new XoopsFormHidden('pageid', 0));
Please login to merge, or discard this patch.
class/category.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $instructioncatHandler = xoops_getModuleHandler('category', 'instruction');
84 84
         $criteria              = new CriteriaCompo();
85 85
         // Если мы редактируем, то убрать текущую категорию из списка выбора родительской
86
-        if (!$this->isNew()) {
86
+        if ( ! $this->isNew()) {
87 87
             $criteria->add(new Criteria('cid', $this->getVar('cid'), '<>'));
88 88
         }
89 89
         $criteria->setSort('weight ASC, title');
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         // Права на просмотр
129 129
         $groups_ids = [];
130 130
         // Если мы редактируем
131
-        if (!$this->isNew()) {
131
+        if ( ! $this->isNew()) {
132 132
             $groups_ids        = $gpermHandler->getGroupIds('instruction_view', $this->getVar('cid'), $GLOBALS['xoopsModule']->getVar('mid'));
133 133
             $groups_ids        = array_values($groups_ids);
134 134
             $groups_instr_view = new XoopsFormCheckBox(_AM_INSTRUCTION_PERM_VIEW, 'groups_instr_view', $groups_ids);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
         // Права на отправку
142 142
         $groups_ids = [];
143
-        if (!$this->isNew()) {
143
+        if ( ! $this->isNew()) {
144 144
             $groups_ids          = $gpermHandler->getGroupIds('instruction_submit', $this->getVar('cid'), $GLOBALS['xoopsModule']->getVar('mid'));
145 145
             $groups_ids          = array_values($groups_ids);
146 146
             $groups_instr_submit = new XoopsFormCheckBox(_AM_INSTRUCTION_PERM_SUBMIT, 'groups_instr_submit', $groups_ids);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
         // Права на редактирование
154 154
         $groups_ids = [];
155
-        if (!$this->isNew()) {
155
+        if ( ! $this->isNew()) {
156 156
             $groups_ids        = $gpermHandler->getGroupIds('instruction_edit', $this->getVar('cid'), $GLOBALS['xoopsModule']->getVar('mid'));
157 157
             $groups_ids        = array_values($groups_ids);
158 158
             $groups_instr_edit = new XoopsFormCheckBox(_AM_INSTRUCTION_PERM_EDIT, 'groups_instr_edit', $groups_ids);
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         // ==========================================================
167 167
 
168 168
         // Если мы редактируем категорию
169
-        if (!$this->isNew()) {
169
+        if ( ! $this->isNew()) {
170 170
             $form->addElement(new XoopsFormHidden('cid', $this->getVar('cid')));
171 171
             //$form->addElement( new XoopsFormHidden( 'catmodify', true));
172 172
         }
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
     public function updateDateupdated($cid = 0, $time = null)
197 197
     {
198 198
         // Если не передали время
199
-        $time = null === $time ? time() : (int)$time;
199
+        $time = null === $time ? time() : (int) $time;
200 200
         //
201
-        $sql = sprintf('UPDATE `%s` SET `dateupdated` = %u WHERE `cid` = %u', $this->table, $time, (int)$cid);
201
+        $sql = sprintf('UPDATE `%s` SET `dateupdated` = %u WHERE `cid` = %u', $this->table, $time, (int) $cid);
202 202
         //
203 203
         return $this->db->query($sql);
204 204
     }
Please login to merge, or discard this patch.
class/utility.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
                 break;
65 65
             case 'int':
66 66
             default:
67
-                $ret = isset($global[$key]) ? (int)$global[$key] : (int)$default;
67
+                $ret = isset($global[$key]) ? (int) $global[$key] : (int) $default;
68 68
                 break;
69 69
         }
70 70
         if (false === $ret) {
Please login to merge, or discard this patch.
class/tree.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $prefix_curr .= $prefix_orig;
79 79
         }
80 80
 
81
-        if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
81
+        if (isset($this->tree[$key]['child']) && ! empty($this->tree[$key]['child'])) {
82 82
             foreach ($this->tree[$key]['child'] as $childkey) {
83 83
                 $this->_makePagesAdminOptions($childkey, $ret, $prefix_orig, $objInsinstr, $class, $prefix_curr);
84 84
             }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             $prefix_curr .= $prefix_orig;
173 173
         }
174 174
 
175
-        if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
175
+        if (isset($this->tree[$key]['child']) && ! empty($this->tree[$key]['child'])) {
176 176
             foreach ($this->tree[$key]['child'] as $childkey) {
177 177
                 $this->_makeCatsAdminOptions($childkey, $ret, $prefix_orig, $cidinstrids, $class, $prefix_curr);
178 178
             }
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
         }
290 290
 
291 291
         // Рекурсия
292
-        if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
292
+        if (isset($this->tree[$key]['child']) && ! empty($this->tree[$key]['child'])) {
293 293
             foreach ($this->tree[$key]['child'] as $childkey) {
294 294
                 $this->_makePagesUserTree($childkey, $ret, $currpageid, $lastpageids, $level);
295 295
             }
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
         }
351 351
 
352 352
         // Рекурсия
353
-        if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
353
+        if (isset($this->tree[$key]['child']) && ! empty($this->tree[$key]['child'])) {
354 354
             foreach ($this->tree[$key]['child'] as $childkey) {
355 355
                 $this->_makePagesUserCalc($childkey, $currpageid, $prevpages, $nextpages, $lastpageids, $level);
356 356
             }
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 // Стили
22 22
 $xoTheme->addStylesheet(XOOPS_URL . '/modules/' . $moduleDirName . '/assets/css/style.css');
23 23
 //
24
-$cid = isset($_GET['cid']) ? (int)$_GET['cid'] : 0;
24
+$cid = isset($_GET['cid']) ? (int) $_GET['cid'] : 0;
25 25
 //
26
-$start = isset($_GET['start']) ? (int)$_GET['start'] : 0;
26
+$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
27 27
 //
28 28
 $limit = xoops_getModuleOption('perpagemain', 'instruction');
29 29
 // Права на просмотр
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 // Если есть категория
53 53
 if ($cid) {
54 54
     // Если нельзя просматривать эту категорию
55
-    if (!in_array($cid, $categories)) {
55
+    if ( ! in_array($cid, $categories)) {
56 56
         redirect_header('index.php', 3, _MD_INSTRUCTION_NOPERM_CAT);
57 57
     }
58 58
     $criteria->add(new Criteria('cid', $cid, '='));
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
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 if ($xoopsUser) {
11 11
     $modulepermHandler = xoops_getHandler('groupperm');
12
-    if (!$modulepermHandler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
12
+    if ( ! $modulepermHandler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
13 13
         redirect_header(XOOPS_URL, 1, _NOPERM);
14 14
         exit();
15 15
     }
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 /** @var Xmf\Module\Admin $adminObject */
27 27
 $adminObject = \Xmf\Module\Admin::getInstance();
28 28
 
29
-if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) {
29
+if ( ! isset($GLOBALS['xoopsTpl']) || ! ($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) {
30 30
     require_once $GLOBALS['xoops']->path('class/template.php');
31 31
     $xoopsTpl = new XoopsTpl();
32 32
 }
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
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!isset($moduleDirName)) {
3
+if ( ! isset($moduleDirName)) {
4 4
     $moduleDirName = basename(dirname(__DIR__));
5 5
 }
6 6
 
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
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
         $type        = InstructionUtility::cleanVars($_POST, 'type', 0, 'int');
39 39
         $keywords    = InstructionUtility::cleanVars($_POST, 'keywords', '', 'string');
40 40
         $description = InstructionUtility::cleanVars($_POST, 'description', '', 'string');
41
-        $dosmiley    = (isset($_POST['dosmiley']) && (int)$_POST['dosmiley'] > 0) ? 1 : 0;
42
-        $doxcode     = (isset($_POST['doxcode']) && (int)$_POST['doxcode'] > 0) ? 1 : 0;
43
-        $dobr        = (isset($_POST['dobr']) && (int)$_POST['dobr'] > 0) ? 1 : 0;
44
-        $dohtml      = (isset($_POST['dohtml']) && (int)$_POST['dohtml'] > 0) ? 1 : 0;
41
+        $dosmiley    = (isset($_POST['dosmiley']) && (int) $_POST['dosmiley'] > 0) ? 1 : 0;
42
+        $doxcode     = (isset($_POST['doxcode']) && (int) $_POST['doxcode'] > 0) ? 1 : 0;
43
+        $dobr        = (isset($_POST['dobr']) && (int) $_POST['dobr'] > 0) ? 1 : 0;
44
+        $dohtml      = (isset($_POST['dohtml']) && (int) $_POST['dohtml'] > 0) ? 1 : 0;
45 45
         //$dohtml      = InstructionUtility::cleanVars( $_POST, 'dohtml', 0, 'int' );
46 46
         //$dosmiley    = InstructionUtility::cleanVars( $_POST, 'dosmiley', 0, 'int' );
47 47
         //$doxcode     = InstructionUtility::cleanVars( $_POST, 'doxcode', 0, 'int' );
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $instrid = InstructionUtility::cleanVars($_POST, 'instrid', 0, 'int');
51 51
 
52 52
         // Проверка
53
-        if (!$GLOBALS['xoopsSecurity']->check()) {
53
+        if ( ! $GLOBALS['xoopsSecurity']->check()) {
54 54
             $err         = true;
55 55
             $err_txt     = implode(', ', $GLOBALS['xoopsSecurity']->getErrors());
56 56
             $message_err .= $err_txt . '<br>' . _AM_INSTR_TRY_AGAIN . '<br>';
@@ -110,28 +110,28 @@  discard block
 block discarded – undo
110 110
         $objInspage->setVar('dobr', $dobr);
111 111
 
112 112
         // Проверка категорий
113
-        if (!$pageid && !$instrid) {
114
-            $err         = true;
113
+        if ( ! $pageid && ! $instrid) {
114
+            $err = true;
115 115
             $message_err .= _AM_INSTRUCTION_ERR_INSTR . '<br>';
116 116
         }
117 117
         // Проверка веса
118 118
         if (0 == $weight) {
119
-            $err         = true;
119
+            $err = true;
120 120
             $message_err .= _AM_INSTRUCTION_ERR_WEIGHT . '<br>';
121 121
         }
122 122
         // Проверка родительской страницы
123 123
         if ($pageid && ($pageid == $pid)) {
124
-            $err         = true;
124
+            $err = true;
125 125
             $message_err .= _AM_INSTRUCTION_ERR_PPAGE . '<br>';
126 126
         }
127 127
         // Проверка названия
128
-        if (!$title) {
129
-            $err         = true;
128
+        if ( ! $title) {
129
+            $err = true;
130 130
             $message_err .= _AM_INSTR_ERR_TITLE . '<br>';
131 131
         }
132 132
         // Проверка основного текста
133
-        if (!$hometext) {
134
-            $err         = true;
133
+        if ( ! $hometext) {
134
+            $err = true;
135 135
             $message_err .= _AM_INSTR_ERR_HOMETEXT . '<br>';
136 136
         }
137 137
 
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
@@ -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.