@@ -32,9 +32,9 @@ |
||
| 32 | 32 | public function updateDateupdated($instrid = 0, $time = null) |
| 33 | 33 | { |
| 34 | 34 | // Если не передали время |
| 35 | - $time = null === $time ? time() : (int)$time; |
|
| 35 | + $time = null === $time ? time() : (int) $time; |
|
| 36 | 36 | // |
| 37 | - $sql = sprintf('UPDATE `%s` SET `dateupdated` = %u WHERE `instrid` = %u', $this->table, $time, (int)$instrid); |
|
| 37 | + $sql = sprintf('UPDATE `%s` SET `dateupdated` = %u WHERE `instrid` = %u', $this->table, $time, (int) $instrid); |
|
| 38 | 38 | // |
| 39 | 39 | return $this->db->query($sql); |
| 40 | 40 | } |
@@ -7,14 +7,14 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | function instruction_tag_iteminfo(&$items) |
| 9 | 9 | { |
| 10 | - if (empty($items) || !is_array($items)) { |
|
| 10 | + if (empty($items) || ! is_array($items)) { |
|
| 11 | 11 | return false; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | $items_id = []; |
| 15 | 15 | foreach (array_keys($items) as $cat_id) { |
| 16 | 16 | foreach (array_keys($items[$cat_id]) as $item_id) { |
| 17 | - $items_id[] = (int)$item_id; |
|
| 17 | + $items_id[] = (int) $item_id; |
|
| 18 | 18 | } |
| 19 | 19 | } |
| 20 | 20 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | . ' OR aa.status < 1' |
| 71 | 71 | . ' )'; |
| 72 | 72 | endif; |
| 73 | - if (!$result = $linkHandler->db->queryF($sql)) { |
|
| 73 | + if ( ! $result = $linkHandler->db->queryF($sql)) { |
|
| 74 | 74 | //xoops_error($linkHandler->db->error()); |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | |
| 70 | 70 | $debug = false; |
| 71 | 71 | |
| 72 | -if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) { |
|
| 72 | +if ( ! isset($GLOBALS['xoopsTpl']) || ! ($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) { |
|
| 73 | 73 | require_once $GLOBALS['xoops']->path('class/template.php'); |
| 74 | 74 | $xoopsTpl = new \XoopsTpl(); |
| 75 | 75 | } |
@@ -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 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 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 | |