@@ -59,7 +59,7 @@ |
||
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 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | // Если есть категория |
64 | 64 | if ($cid) { |
65 | 65 | // Если нельзя просматривать эту категорию |
66 | - if (!in_array($cid, $categories)) { |
|
66 | + if ( ! in_array($cid, $categories)) { |
|
67 | 67 | redirect_header('index.php', 3, _MD_INSTRUCTION_NOPERM_CAT); |
68 | 68 | } |
69 | 69 | $criteria->add(new \Criteria('cid', $cid, '=')); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // Объект инструкции |
54 | 54 | $objInsinstr = $instructionHandler->get($instrid); |
55 | 55 | // Можно ли редактировать инструкцию в данной категории |
56 | - if (!in_array($objInsinstr->getVar('cid'), $cat_edit)) { |
|
56 | + if ( ! in_array($objInsinstr->getVar('cid'), $cat_edit)) { |
|
57 | 57 | redirect_header('index.php', 3, _MD_INSTRUCTION_NOPERM_EDITPAGE); |
58 | 58 | } |
59 | 59 | // Создание новой страницы |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | // Объект инструкции |
67 | 67 | $objInsinstr = $instructionHandler->get($instrid); |
68 | 68 | // Можно ли добавлять инструкции в данной категории |
69 | - if (!in_array($objInsinstr->getVar('cid'), $cat_submit)) { |
|
69 | + if ( ! in_array($objInsinstr->getVar('cid'), $cat_submit)) { |
|
70 | 70 | redirect_header('index.php', 3, _MD_INSTRUCTION_NOPERM_SUBMITPAGE); |
71 | 71 | } |
72 | 72 | } else { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | case 'savepage': |
102 | 102 | |
103 | 103 | // Проверка |
104 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
104 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
105 | 105 | redirect_header('index.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
106 | 106 | } |
107 | 107 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | // Объект инструкции |
115 | 115 | $objInsinstr = $instructionHandler->get($objInspage->getVar('instrid')); |
116 | 116 | // Можно ли редактировать инструкцию в данной категории |
117 | - if (!in_array($objInsinstr->getVar('cid'), $cat_edit)) { |
|
117 | + if ( ! in_array($objInsinstr->getVar('cid'), $cat_edit)) { |
|
118 | 118 | redirect_header('index.php', 3, _MD_INSTRUCTION_NOPERM_EDITPAGE); |
119 | 119 | } |
120 | 120 | } elseif ($instrid) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | // Объект инструкции |
123 | 123 | $objInsinstr = $instructionHandler->get($instrid); |
124 | 124 | // Можно ли добавлять инструкции в данной категории |
125 | - if (!in_array($objInsinstr->getVar('cid'), $cat_submit)) { |
|
125 | + if ( ! in_array($objInsinstr->getVar('cid'), $cat_submit)) { |
|
126 | 126 | redirect_header('index.php', 3, _MD_INSTRUCTION_NOPERM_SUBMITPAGE); |
127 | 127 | } |
128 | 128 | |
@@ -151,18 +151,18 @@ discard block |
||
151 | 151 | $objInspage->setVar('description', Request::getText('description', '', 'POST')); |
152 | 152 | |
153 | 153 | // Проверка категорий |
154 | - if (!$pageid && !$instrid) { |
|
155 | - $err = true; |
|
154 | + if ( ! $pageid && ! $instrid) { |
|
155 | + $err = true; |
|
156 | 156 | $message_err .= _MD_INSTRUCTION_ERR_INSTR . '<br>'; |
157 | 157 | } |
158 | 158 | // Проверка веса |
159 | 159 | if (0 == $weight) { |
160 | - $err = true; |
|
160 | + $err = true; |
|
161 | 161 | $message_err .= _MD_INSTRUCTION_ERR_WEIGHT . '<br>'; |
162 | 162 | } |
163 | 163 | // Проверка родительской страницы |
164 | 164 | if ($pageid && ($pageid == $pid)) { |
165 | - $err = true; |
|
165 | + $err = true; |
|
166 | 166 | $message_err .= _MD_INSTRUCTION_ERR_PPAGE . '<br>'; |
167 | 167 | } |
168 | 168 | // Если были ошибки |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $html .= "<ul>\n"; |
44 | 44 | // |
45 | 45 | $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
46 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
46 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
47 | 47 | if (function_exists('gd_info')) { |
48 | 48 | if (true === ($gdlib = gd_info())) { |
49 | 49 | $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
58 | 58 | // |
59 | 59 | $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
60 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
60 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
61 | 61 | // |
62 | 62 | $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
63 | 63 | $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | public static function createFolder($folder) |
29 | 29 | { |
30 | 30 | try { |
31 | - if (!file_exists($folder)) { |
|
32 | - if (!mkdir($folder) && !is_dir($folder)) { |
|
31 | + if ( ! file_exists($folder)) { |
|
32 | + if ( ! mkdir($folder) && ! is_dir($folder)) { |
|
33 | 33 | throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder)); |
34 | 34 | } |
35 | 35 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public static function recurseCopy($src, $dst) |
60 | 60 | { |
61 | 61 | $dir = opendir($src); |
62 | - if (!mkdir($dst) && !is_dir($dst)) { |
|
62 | + if ( ! mkdir($dst) && ! is_dir($dst)) { |
|
63 | 63 | throw new \RuntimeException('The directory ' . $dst . ' could not be created.'); |
64 | 64 | } |
65 | 65 | while (false !== ($file = readdir($dir))) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public static function deleteDirectory($src) |
89 | 89 | { |
90 | 90 | // Only continue if user is a 'global' Admin |
91 | - if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) { |
|
91 | + if ( ! ($GLOBALS['xoopsUser'] instanceof \XoopsUser) || ! $GLOBALS['xoopsUser']->isAdmin()) { |
|
92 | 92 | return false; |
93 | 93 | } |
94 | 94 | |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | $fileInfo = new \SplFileInfo("{$src}/{$v}"); |
103 | 103 | if ($fileInfo->isDir()) { |
104 | 104 | // recursively handle subdirectories |
105 | - if (!$success = self::deleteDirectory($fileInfo->getRealPath())) { |
|
105 | + if ( ! $success = self::deleteDirectory($fileInfo->getRealPath())) { |
|
106 | 106 | break; |
107 | 107 | } |
108 | 108 | } else { |
109 | 109 | // delete the file |
110 | - if (!($success = unlink($fileInfo->getRealPath()))) { |
|
110 | + if ( ! ($success = unlink($fileInfo->getRealPath()))) { |
|
111 | 111 | break; |
112 | 112 | } |
113 | 113 | } |
@@ -136,12 +136,12 @@ discard block |
||
136 | 136 | public static function rrmdir($src) |
137 | 137 | { |
138 | 138 | // Only continue if user is a 'global' Admin |
139 | - if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) { |
|
139 | + if ( ! ($GLOBALS['xoopsUser'] instanceof \XoopsUser) || ! $GLOBALS['xoopsUser']->isAdmin()) { |
|
140 | 140 | return false; |
141 | 141 | } |
142 | 142 | |
143 | 143 | // If source is not a directory stop processing |
144 | - if (!is_dir($src)) { |
|
144 | + if ( ! is_dir($src)) { |
|
145 | 145 | return false; |
146 | 146 | } |
147 | 147 | |
@@ -153,15 +153,15 @@ discard block |
||
153 | 153 | if ($fObj->isFile()) { |
154 | 154 | $filename = $fObj->getPathname(); |
155 | 155 | $fObj = null; // clear this iterator object to close the file |
156 | - if (!unlink($filename)) { |
|
156 | + if ( ! unlink($filename)) { |
|
157 | 157 | return false; // couldn't delete the file |
158 | 158 | } |
159 | - } elseif (!$fObj->isDot() && $fObj->isDir()) { |
|
159 | + } elseif ( ! $fObj->isDot() && $fObj->isDir()) { |
|
160 | 160 | // Try recursively on directory |
161 | 161 | self::rrmdir($fObj->getPathname()); |
162 | 162 | } |
163 | 163 | } |
164 | - $iterator = null; // clear iterator Obj to close file/directory |
|
164 | + $iterator = null; // clear iterator Obj to close file/directory |
|
165 | 165 | return rmdir($src); // remove the directory & return results |
166 | 166 | } |
167 | 167 | |
@@ -176,17 +176,17 @@ discard block |
||
176 | 176 | public static function rmove($src, $dest) |
177 | 177 | { |
178 | 178 | // Only continue if user is a 'global' Admin |
179 | - if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) { |
|
179 | + if ( ! ($GLOBALS['xoopsUser'] instanceof \XoopsUser) || ! $GLOBALS['xoopsUser']->isAdmin()) { |
|
180 | 180 | return false; |
181 | 181 | } |
182 | 182 | |
183 | 183 | // If source is not a directory stop processing |
184 | - if (!is_dir($src)) { |
|
184 | + if ( ! is_dir($src)) { |
|
185 | 185 | return false; |
186 | 186 | } |
187 | 187 | |
188 | 188 | // If the destination directory does not exist and could not be created stop processing |
189 | - if (!is_dir($dest) && !mkdir($dest, 0755)) { |
|
189 | + if ( ! is_dir($dest) && ! mkdir($dest, 0755)) { |
|
190 | 190 | return false; |
191 | 191 | } |
192 | 192 | |
@@ -195,13 +195,13 @@ discard block |
||
195 | 195 | foreach ($iterator as $fObj) { |
196 | 196 | if ($fObj->isFile()) { |
197 | 197 | rename($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
198 | - } elseif (!$fObj->isDot() && $fObj->isDir()) { |
|
198 | + } elseif ( ! $fObj->isDot() && $fObj->isDir()) { |
|
199 | 199 | // Try recursively on directory |
200 | 200 | self::rmove($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
201 | 201 | // rmdir($fObj->getPath()); // now delete the directory |
202 | 202 | } |
203 | 203 | } |
204 | - $iterator = null; // clear iterator Obj to close file/directory |
|
204 | + $iterator = null; // clear iterator Obj to close file/directory |
|
205 | 205 | return rmdir($src); // remove the directory & return results |
206 | 206 | } |
207 | 207 | |
@@ -219,17 +219,17 @@ discard block |
||
219 | 219 | public static function rcopy($src, $dest) |
220 | 220 | { |
221 | 221 | // Only continue if user is a 'global' Admin |
222 | - if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) { |
|
222 | + if ( ! ($GLOBALS['xoopsUser'] instanceof \XoopsUser) || ! $GLOBALS['xoopsUser']->isAdmin()) { |
|
223 | 223 | return false; |
224 | 224 | } |
225 | 225 | |
226 | 226 | // If source is not a directory stop processing |
227 | - if (!is_dir($src)) { |
|
227 | + if ( ! is_dir($src)) { |
|
228 | 228 | return false; |
229 | 229 | } |
230 | 230 | |
231 | 231 | // If the destination directory does not exist and could not be created stop processing |
232 | - if (!is_dir($dest) && !mkdir($dest, 0755)) { |
|
232 | + if ( ! is_dir($dest) && ! mkdir($dest, 0755)) { |
|
233 | 233 | return false; |
234 | 234 | } |
235 | 235 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | foreach ($iterator as $fObj) { |
239 | 239 | if ($fObj->isFile()) { |
240 | 240 | copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
241 | - } elseif (!$fObj->isDot() && $fObj->isDir()) { |
|
241 | + } elseif ( ! $fObj->isDot() && $fObj->isDir()) { |
|
242 | 242 | self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
243 | 243 | } |
244 | 244 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | //if (($GLOBALS['xoopsUser'] instanceof \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 |
||
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 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $time = time(); |
20 | 20 | |
21 | 21 | // Опция |
22 | -$op = Request::getString( 'op', 'main', 'POST'); |
|
22 | +$op = Request::getString('op', 'main', 'POST'); |
|
23 | 23 | |
24 | 24 | // Выбор |
25 | 25 | switch ($op) { |
@@ -33,28 +33,28 @@ discard block |
||
33 | 33 | $message_err = ''; |
34 | 34 | |
35 | 35 | // |
36 | - $title = Request::getString( 'title', '', 'POST'); |
|
37 | - $pid = Request::getInt( 'pid', 0, 'POST'); |
|
38 | - $weight = Request::getInt( 'weight', 0, 'POST'); |
|
39 | - $hometext = Request::getString( 'hometext', '', 'POST'); |
|
40 | - $footnote = Request::getString( 'footnote', '', 'POST'); |
|
41 | - $status = Request::getInt( 'status', 0, 'POST'); |
|
42 | - $type = Request::getInt( 'type', 0, 'POST'); |
|
43 | - $keywords = Request::getString( 'keywords', '', 'POST'); |
|
44 | - $description = Request::getString( 'description', '', 'POST'); |
|
45 | - $dosmiley = (Request::getInt( 'dosmiley', 0, 'POST') > 0) ? 1 : 0; |
|
46 | - $doxcode = (Request::getInt( 'doxcode', 0, 'POST') > 0) ? 1 : 0; |
|
47 | - $dobr = (Request::getInt( 'dobr', 0, 'POST') > 0) ? 1 : 0; |
|
48 | - $dohtml = (Request::getInt( 'dohtml', 0, 'POST') > 0) ? 1 : 0; |
|
36 | + $title = Request::getString('title', '', 'POST'); |
|
37 | + $pid = Request::getInt('pid', 0, 'POST'); |
|
38 | + $weight = Request::getInt('weight', 0, 'POST'); |
|
39 | + $hometext = Request::getString('hometext', '', 'POST'); |
|
40 | + $footnote = Request::getString('footnote', '', 'POST'); |
|
41 | + $status = Request::getInt('status', 0, 'POST'); |
|
42 | + $type = Request::getInt('type', 0, 'POST'); |
|
43 | + $keywords = Request::getString('keywords', '', 'POST'); |
|
44 | + $description = Request::getString('description', '', 'POST'); |
|
45 | + $dosmiley = (Request::getInt('dosmiley', 0, 'POST') > 0) ? 1 : 0; |
|
46 | + $doxcode = (Request::getInt('doxcode', 0, 'POST') > 0) ? 1 : 0; |
|
47 | + $dobr = (Request::getInt('dobr', 0, 'POST') > 0) ? 1 : 0; |
|
48 | + $dohtml = (Request::getInt('dohtml', 0, 'POST') > 0) ? 1 : 0; |
|
49 | 49 | //$dohtml = Request::getInt( 'dohtml', 0, 'POST' ); |
50 | 50 | //$dosmiley = Request::getInt( 'dosmiley', 0, 'POST' ); |
51 | 51 | //$doxcode = Request::getInt( 'doxcode', 0, 'POST' ); |
52 | 52 | //$dobr = Request::getInt( 'dobr', 0, 'POST' ); |
53 | - $pageid = Request::getInt( 'pageid', 0, 'POST'); |
|
54 | - $instrid = Request::getInt( 'instrid', 0, 'POST'); |
|
53 | + $pageid = Request::getInt('pageid', 0, 'POST'); |
|
54 | + $instrid = Request::getInt('instrid', 0, 'POST'); |
|
55 | 55 | |
56 | 56 | // Проверка |
57 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
57 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
58 | 58 | $err = true; |
59 | 59 | $err_txt = implode(', ', $GLOBALS['xoopsSecurity']->getErrors()); |
60 | 60 | $message_err .= $err_txt . '<br>' . _AM_INSTR_TRY_AGAIN . '<br>'; |
@@ -114,28 +114,28 @@ discard block |
||
114 | 114 | $objInspage->setVar('dobr', $dobr); |
115 | 115 | |
116 | 116 | // Проверка категорий |
117 | - if (!$pageid && !$instrid) { |
|
118 | - $err = true; |
|
117 | + if ( ! $pageid && ! $instrid) { |
|
118 | + $err = true; |
|
119 | 119 | $message_err .= _AM_INSTRUCTION_ERR_INSTR . '<br>'; |
120 | 120 | } |
121 | 121 | // Проверка веса |
122 | 122 | if (0 == $weight) { |
123 | - $err = true; |
|
123 | + $err = true; |
|
124 | 124 | $message_err .= _AM_INSTRUCTION_ERR_WEIGHT . '<br>'; |
125 | 125 | } |
126 | 126 | // Проверка родительской страницы |
127 | 127 | if ($pageid && ($pageid == $pid)) { |
128 | - $err = true; |
|
128 | + $err = true; |
|
129 | 129 | $message_err .= _AM_INSTRUCTION_ERR_PPAGE . '<br>'; |
130 | 130 | } |
131 | 131 | // Проверка названия |
132 | - if (!$title) { |
|
133 | - $err = true; |
|
132 | + if ( ! $title) { |
|
133 | + $err = true; |
|
134 | 134 | $message_err .= _AM_INSTR_ERR_TITLE . '<br>'; |
135 | 135 | } |
136 | 136 | // Проверка основного текста |
137 | - if (!$hometext) { |
|
138 | - $err = true; |
|
137 | + if ( ! $hometext) { |
|
138 | + $err = true; |
|
139 | 139 | $message_err .= _AM_INSTR_ERR_HOMETEXT . '<br>'; |
140 | 140 | } |
141 | 141 |
@@ -100,7 +100,7 @@ discard block |
||
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 | // Если мы редактируем |
@@ -118,20 +118,20 @@ discard block |
||
118 | 118 | // Дата обновления |
119 | 119 | $objInstructioncat->setVar('dateupdated', $time); |
120 | 120 | $objInstructioncat->setVar('pid', $pid); |
121 | - $objInstructioncat->setVar('title', Request::getString( 'title', '', 'POST')); |
|
122 | - $objInstructioncat->setVar('description', Request::getString( 'description', '', 'POST')); |
|
121 | + $objInstructioncat->setVar('title', Request::getString('title', '', 'POST')); |
|
122 | + $objInstructioncat->setVar('description', Request::getString('description', '', 'POST')); |
|
123 | 123 | $objInstructioncat->setVar('weight', $weight); |
124 | - $objInstructioncat->setVar('metakeywords', Request::getString( 'metakeywords', '', 'POST')); |
|
125 | - $objInstructioncat->setVar('metadescription', Request::getString( 'metadescription', '', 'POST')); |
|
124 | + $objInstructioncat->setVar('metakeywords', Request::getString('metakeywords', '', 'POST')); |
|
125 | + $objInstructioncat->setVar('metadescription', Request::getString('metadescription', '', 'POST')); |
|
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 | // Если были ошибки |
@@ -182,19 +182,19 @@ discard block |
||
182 | 182 | // Добавляем права |
183 | 183 | // Права на просмотр |
184 | 184 | if (Request::hasVar('groups_instr_view', 'POST')) { |
185 | - foreach (Request::getArray('groups_instr_view','', 'POST') as $onegroup_id) { |
|
185 | + foreach (Request::getArray('groups_instr_view', '', 'POST') as $onegroup_id) { |
|
186 | 186 | $gpermHandler->addRight('instruction_view', $new_cid, $onegroup_id, $GLOBALS['xoopsModule']->getVar('mid')); |
187 | 187 | } |
188 | 188 | } |
189 | 189 | // Права на добавление |
190 | 190 | if (Request::hasVar('groups_instr_submit', 'POST')) { |
191 | - foreach (Request::getArray('groups_instr_submit','', 'POST') as $onegroup_id) { |
|
191 | + foreach (Request::getArray('groups_instr_submit', '', 'POST') as $onegroup_id) { |
|
192 | 192 | $gpermHandler->addRight('instruction_submit', $new_cid, $onegroup_id, $GLOBALS['xoopsModule']->getVar('mid')); |
193 | 193 | } |
194 | 194 | } |
195 | 195 | // Права на редактирование |
196 | 196 | if (Request::hasVar('groups_instr_edit', 'POST')) { |
197 | - foreach (Request::getArray('groups_instr_edit','', 'POST') as $onegroup_id) { |
|
197 | + foreach (Request::getArray('groups_instr_edit', '', 'POST') as $onegroup_id) { |
|
198 | 198 | $gpermHandler->addRight('instruction_edit', $new_cid, $onegroup_id, $GLOBALS['xoopsModule']->getVar('mid')); |
199 | 199 | } |
200 | 200 | } |
@@ -237,7 +237,7 @@ discard block |
||
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 |
||
253 | 253 | } |
254 | 254 | |
255 | 255 | // Нажали ли мы на кнопку OK |
256 | - $ok = Request::getInt( 'ok', 0, 'POST'); |
|
256 | + $ok = Request::getInt('ok', 0, 'POST'); |
|
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 | // Пытаемся удалить категорию |
@@ -22,21 +22,21 @@ discard block |
||
22 | 22 | $time = time(); |
23 | 23 | |
24 | 24 | // ID инструкции |
25 | -$instrid = Request::getInt( 'instrid', 0); |
|
25 | +$instrid = Request::getInt('instrid', 0); |
|
26 | 26 | // ID страницы |
27 | -$pageid = Request::getInt( 'pageid', 0); |
|
27 | +$pageid = Request::getInt('pageid', 0); |
|
28 | 28 | // ID категории |
29 | -$cid = Request::getInt( 'cid', 0); |
|
29 | +$cid = Request::getInt('cid', 0); |
|
30 | 30 | // Вес |
31 | -$weight = Request::getInt( 'weight', 0, 'POST'); |
|
31 | +$weight = Request::getInt('weight', 0, 'POST'); |
|
32 | 32 | // |
33 | -$pid = Request::getInt( 'pid', 0); |
|
33 | +$pid = Request::getInt('pid', 0); |
|
34 | 34 | // |
35 | -$start = Request::getInt( 'start', 0, 'GET'); |
|
35 | +$start = Request::getInt('start', 0, 'GET'); |
|
36 | 36 | // |
37 | 37 | $limit = xoops_getModuleOption('perpageadmin', 'instruction'); |
38 | 38 | |
39 | -$op = Request::getString('op', Request::getString('op', 'main', 'GET'), 'POST'); |
|
39 | +$op = Request::getString('op', Request::getString('op', 'main', 'GET'), 'POST'); |
|
40 | 40 | |
41 | 41 | // Выбор |
42 | 42 | switch ($op) { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | // Получаем объект категории |
61 | 61 | $objInscat = $categoryHandler->get($cid); |
62 | 62 | // Если нет такой категории |
63 | - if (!is_object($objInscat)) { |
|
63 | + if ( ! is_object($objInscat)) { |
|
64 | 64 | redirect_header('cat.php', 3, _AM_INSTRUCTION_ERR_CATNOTSELECT); |
65 | 65 | } |
66 | 66 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | case 'saveinstr': |
167 | 167 | |
168 | 168 | // Проверка |
169 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
169 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
170 | 170 | redirect_header('instr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
171 | 171 | } |
172 | 172 | // Если мы редактируем |
@@ -183,32 +183,32 @@ discard block |
||
183 | 183 | $err = false; |
184 | 184 | $message_err = ''; |
185 | 185 | // |
186 | - $instr_title = Request::getString( 'title', '', 'POST'); |
|
187 | - $instr_description = Request::getString( 'description', '', 'POST'); |
|
186 | + $instr_title = Request::getString('title', '', 'POST'); |
|
187 | + $instr_description = Request::getString('description', '', 'POST'); |
|
188 | 188 | |
189 | 189 | // Дата обновления |
190 | 190 | $objInsinstr->setVar('dateupdated', $time); |
191 | 191 | // |
192 | 192 | $objInsinstr->setVar('cid', $cid); |
193 | 193 | $objInsinstr->setVar('title', $instr_title); |
194 | - $objInsinstr->setVar('status', Request::getInt( 'status', 0)); |
|
194 | + $objInsinstr->setVar('status', Request::getInt('status', 0)); |
|
195 | 195 | $objInsinstr->setVar('description', $instr_description); |
196 | - $objInsinstr->setVar('metakeywords', Request::getString( 'metakeywords', '')); |
|
197 | - $objInsinstr->setVar('metadescription', Request::getString( 'metadescription', '')); |
|
196 | + $objInsinstr->setVar('metakeywords', Request::getString('metakeywords', '')); |
|
197 | + $objInsinstr->setVar('metadescription', Request::getString('metadescription', '')); |
|
198 | 198 | |
199 | 199 | // Проверка категорий |
200 | - if (!$cid) { |
|
201 | - $err = true; |
|
200 | + if ( ! $cid) { |
|
201 | + $err = true; |
|
202 | 202 | $message_err .= _AM_INSTRUCTION_ERR_CAT . '<br>'; |
203 | 203 | } |
204 | 204 | // Проверка названия |
205 | - if (!$instr_title) { |
|
206 | - $err = true; |
|
205 | + if ( ! $instr_title) { |
|
206 | + $err = true; |
|
207 | 207 | $message_err .= _AM_INSTR_ERR_TITLE . '<br>'; |
208 | 208 | } |
209 | 209 | // Проверка основного текста |
210 | - if (!$instr_description) { |
|
211 | - $err = true; |
|
210 | + if ( ! $instr_description) { |
|
211 | + $err = true; |
|
212 | 212 | $message_err .= _AM_INSTR_ERR_DESCRIPTION . '<br>'; |
213 | 213 | } |
214 | 214 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | // Тэги |
233 | 233 | if (xoops_getModuleOption('usetag', 'instruction')) { |
234 | 234 | $tagHandler = xoops_getModuleHandler('tag', 'tag'); |
235 | - $tagHandler->updateByItem(Request::getArray( 'tag', '', 'POST'), $instrid_new, $GLOBALS['xoopsModule']->getVar('dirname'), 0); |
|
235 | + $tagHandler->updateByItem(Request::getArray('tag', '', 'POST'), $instrid_new, $GLOBALS['xoopsModule']->getVar('dirname'), 0); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | // Если мы редактируем |
@@ -308,12 +308,12 @@ discard block |
||
308 | 308 | $objInsinstr = $instructionHandler->get($instrid); |
309 | 309 | |
310 | 310 | // Нажали ли мы на кнопку OK |
311 | - $ok = Request::getInt( 'ok', 0, 'POST'); |
|
311 | + $ok = Request::getInt('ok', 0, 'POST'); |
|
312 | 312 | // |
313 | 313 | if ($ok) { |
314 | 314 | |
315 | 315 | // Проверка |
316 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
316 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
317 | 317 | redirect_header('instr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
318 | 318 | } |
319 | 319 | // Находим все страницы, пренадлежащие этой инструкции |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | $message_err = ''; |
401 | 401 | |
402 | 402 | // Проверка сессии |
403 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
403 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
404 | 404 | $err = true; |
405 | 405 | $err_txt = implode(', ', $GLOBALS['xoopsSecurity']->getErrors()); |
406 | 406 | $message_err .= $err_txt . '<br>'; |
@@ -422,8 +422,8 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | // |
425 | - $page_title = Request::getString( 'title', '', 'POST'); |
|
426 | - $page_hometext = Request::getString( 'hometext', '', 'POST'); |
|
425 | + $page_title = Request::getString('title', '', 'POST'); |
|
426 | + $page_hometext = Request::getString('hometext', '', 'POST'); |
|
427 | 427 | |
428 | 428 | // Родительская страница |
429 | 429 | $objInspage->setVar('pid', $pid); |
@@ -436,20 +436,20 @@ discard block |
||
436 | 436 | // Основной текст |
437 | 437 | $objInspage->setVar('hometext', $page_hometext); |
438 | 438 | // Сноска |
439 | - $objInspage->setVar('footnote', Request::getString( 'footnote', '', 'POST')); |
|
439 | + $objInspage->setVar('footnote', Request::getString('footnote', '', 'POST')); |
|
440 | 440 | // Статус |
441 | - $objInspage->setVar('status', Request::getInt( 'status', 0, 'POST')); |
|
441 | + $objInspage->setVar('status', Request::getInt('status', 0, 'POST')); |
|
442 | 442 | // Тип |
443 | - $objInspage->setVar('type', Request::getInt( 'type', 0, 'POST')); |
|
443 | + $objInspage->setVar('type', Request::getInt('type', 0, 'POST')); |
|
444 | 444 | // Мета-теги описания |
445 | - $objInspage->setVar('keywords', Request::getString( 'keywords', '', 'POST')); |
|
445 | + $objInspage->setVar('keywords', Request::getString('keywords', '', 'POST')); |
|
446 | 446 | // Мета-теги ключевых слов |
447 | - $objInspage->setVar('description', Request::getString( 'description', '', 'POST')); |
|
447 | + $objInspage->setVar('description', Request::getString('description', '', 'POST')); |
|
448 | 448 | // |
449 | - $dosmiley = (Request::getInt( 'dosmiley', 0, 'POST') > 0) ? 1 : 0; |
|
450 | - $doxcode = (Request::getInt( 'doxcode', 0, 'POST') > 0) ? 1 : 0; |
|
451 | - $dobr = (Request::getInt( 'dobr', 0, 'POST') > 0) ? 1 : 0; |
|
452 | - $dohtml = (Request::getInt( 'dohtml', 0, 'POST') > 0) ? 1 : 0; |
|
449 | + $dosmiley = (Request::getInt('dosmiley', 0, 'POST') > 0) ? 1 : 0; |
|
450 | + $doxcode = (Request::getInt('doxcode', 0, 'POST') > 0) ? 1 : 0; |
|
451 | + $dobr = (Request::getInt('dobr', 0, 'POST') > 0) ? 1 : 0; |
|
452 | + $dohtml = (Request::getInt('dohtml', 0, 'POST') > 0) ? 1 : 0; |
|
453 | 453 | //$doimage = ( isset( $_POST['doimage'] ) && intval( $_POST['doimage'] ) > 0 ) ? 1 : 0; |
454 | 454 | $objInspage->setVar('dohtml', $dohtml); |
455 | 455 | $objInspage->setVar('dosmiley', $dosmiley); |
@@ -458,28 +458,28 @@ discard block |
||
458 | 458 | $objInspage->setVar('dobr', $dobr); |
459 | 459 | |
460 | 460 | // |
461 | - if (!$pageid && !$instrid) { |
|
462 | - $err = true; |
|
461 | + if ( ! $pageid && ! $instrid) { |
|
462 | + $err = true; |
|
463 | 463 | $message_err .= _AM_INSTRUCTION_ERR_INSTR . '<br>'; |
464 | 464 | } |
465 | 465 | // Проверка веса |
466 | 466 | if (0 == $weight) { |
467 | - $err = true; |
|
467 | + $err = true; |
|
468 | 468 | $message_err .= _AM_INSTRUCTION_ERR_WEIGHT . '<br>'; |
469 | 469 | } |
470 | 470 | // Проверка родительской страницы |
471 | 471 | if ($pageid && ($pageid == $pid)) { |
472 | - $err = true; |
|
472 | + $err = true; |
|
473 | 473 | $message_err .= _AM_INSTRUCTION_ERR_PPAGE . '<br>'; |
474 | 474 | } |
475 | 475 | // Проверка названия |
476 | - if (!$page_title) { |
|
477 | - $err = true; |
|
476 | + if ( ! $page_title) { |
|
477 | + $err = true; |
|
478 | 478 | $message_err .= _AM_INSTR_ERR_TITLE . '<br>'; |
479 | 479 | } |
480 | 480 | // Проверка основного текста |
481 | - if (!$page_hometext) { |
|
482 | - $err = true; |
|
481 | + if ( ! $page_hometext) { |
|
482 | + $err = true; |
|
483 | 483 | $message_err .= _AM_INSTR_ERR_HOMETEXT . '<br>'; |
484 | 484 | } |
485 | 485 | |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | // Если мы добавляем |
510 | 510 | } else { |
511 | 511 | // Инкримент комментов |
512 | - $pageHandler->updateposts($uid, Request::getInt( 'status', 0, 'POST'), 'add'); |
|
512 | + $pageHandler->updateposts($uid, Request::getInt('status', 0, 'POST'), 'add'); |
|
513 | 513 | // Редирект |
514 | 514 | redirect_header($redirect_url, 3, _AM_INSTRUCTION_PAGEADDED); |
515 | 515 | } |
@@ -542,12 +542,12 @@ discard block |
||
542 | 542 | |
543 | 543 | $objInspage = $pageHandler->get($pageid); |
544 | 544 | // Нажали ли мы на кнопку OK |
545 | - $ok = Request::getInt( 'ok', 0, 'POST'); |
|
545 | + $ok = Request::getInt('ok', 0, 'POST'); |
|
546 | 546 | // Если мы нажали на кнопку |
547 | 547 | if ($ok) { |
548 | 548 | |
549 | 549 | // Проверка |
550 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
550 | + if ( ! $GLOBALS['xoopsSecurity']->check()) { |
|
551 | 551 | redirect_header('instr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
552 | 552 | } |
553 | 553 | // ID инструкции |