Completed
Push — master ( 55b92e...48ecb4 )
by Michael
01:50
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/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.