Completed
Push — master ( 8239ac...55b92e )
by Michael
01:49
created
class/instruction.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         $form->addElement(new XoopsFormText(_AM_INSTRUCTION_METADESCRIPTIONC, 'metadescription', 50, 255, $this->getVar('metadescription')), false);
97 97
 
98 98
         // Если мы редактируем категорию
99
-        if (!$this->isNew()) {
99
+        if ( ! $this->isNew()) {
100 100
             $form->addElement(new XoopsFormHidden('instrid', $this->getVar('instrid')));
101 101
         }
102 102
         //
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
     public function updateDateupdated($instrid = 0, $time = null)
119 119
     {
120 120
         // Если не передали время
121
-        $time = null === $time ? time() : (int)$time;
121
+        $time = null === $time ? time() : (int) $time;
122 122
         //
123
-        $sql = sprintf('UPDATE `%s` SET `dateupdated` = %u WHERE `instrid` = %u', $this->table, $time, (int)$instrid);
123
+        $sql = sprintf('UPDATE `%s` SET `dateupdated` = %u WHERE `instrid` = %u', $this->table, $time, (int) $instrid);
124 124
         //
125 125
         return $this->db->query($sql);
126 126
     }
Please login to merge, or discard this patch.
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/cat.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     case 'savecat':
103 103
 
104 104
         // Проверка
105
-        if (!$GLOBALS['xoopsSecurity']->check()) {
105
+        if ( ! $GLOBALS['xoopsSecurity']->check()) {
106 106
             redirect_header('cat.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
107 107
         }
108 108
         // Если мы редактируем
@@ -128,12 +128,12 @@  discard block
 block discarded – undo
128 128
 
129 129
         // Проверка веса
130 130
         if (0 == $weight) {
131
-            $err         = true;
131
+            $err = true;
132 132
             $message_err .= _AM_INSTRUCTION_ERR_WEIGHT . '<br>';
133 133
         }
134 134
         // Проверка категорий
135 135
         if ($cid && ($cid == $pid)) {
136
-            $err         = true;
136
+            $err = true;
137 137
             $message_err .= _AM_INSTRUCTION_ERR_PCAT . '<br>';
138 138
         }
139 139
         // Если были ошибки
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
         $objInscat = $instructioncatHandler->get($cid);
243 243
         // Если нет такой категории
244
-        if (!is_object($objInscat)) {
244
+        if ( ! is_object($objInscat)) {
245 245
             redirect_header('cat.php', 3, _AM_INSTRUCTION_ERR_CATNOTSELECT);
246 246
         }
247 247
 
@@ -257,12 +257,12 @@  discard block
 block discarded – undo
257 257
         }
258 258
 
259 259
         // Нажали ли мы на кнопку OK
260
-        $ok = isset($_POST['ok']) ? (int)$_POST['ok'] : 0;
260
+        $ok = isset($_POST['ok']) ? (int) $_POST['ok'] : 0;
261 261
         // Если мы нажали на кнопку
262 262
         if ($ok) {
263 263
 
264 264
             // Проверка
265
-            if (!$GLOBALS['xoopsSecurity']->check()) {
265
+            if ( ! $GLOBALS['xoopsSecurity']->check()) {
266 266
                 redirect_header('cat.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
267 267
             }
268 268
             // Пытаемся удалить категорию
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.