@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $moduleDirName = basename(dirname(__DIR__)); |
| 23 | 23 | $capsDirName = strtoupper($moduleDirName); |
| 24 | 24 | |
| 25 | -if (!defined($capsDirName . '_DIRNAME')) { |
|
| 25 | +if ( ! defined($capsDirName . '_DIRNAME')) { |
|
| 26 | 26 | //if (!defined(constant($capsDirName . '_DIRNAME'))) { |
| 27 | 27 | define($capsDirName . '_DIRNAME', $GLOBALS['xoopsModule']->dirname()); |
| 28 | 28 | define($capsDirName . '_PATH', XOOPS_ROOT_PATH . '/modules/' . constant($capsDirName . '_DIRNAME')); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | //Configurator |
| 38 | -return (object)[ |
|
| 38 | +return (object) [ |
|
| 39 | 39 | 'name' => strtoupper($moduleDirName) . ' Module Configurator', |
| 40 | 40 | 'paths' => [ |
| 41 | 41 | 'dirname' => $moduleDirName, |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * @author XOOPS Development Team |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | -if (!defined('INSTRUCTION_MODULE_PATH')) { |
|
| 20 | +if ( ! defined('INSTRUCTION_MODULE_PATH')) { |
|
| 21 | 21 | define('INSTRUCTION_DIRNAME', basename(dirname(__DIR__))); |
| 22 | 22 | define('INSTRUCTION_URL', XOOPS_URL . '/modules/' . INSTRUCTION_DIRNAME); |
| 23 | 23 | define('INSTRUCTION_IMAGE_URL', INSTRUCTION_URL . '/assets/images/'); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $instruction = Instruction::getInstance(); |
| 46 | 46 | $instruction->loadLanguage('common'); |
| 47 | 47 | |
| 48 | -if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
|
| 48 | +if ( ! isset($GLOBALS['xoopsTpl']) || ! ($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
|
| 49 | 49 | require_once $GLOBALS['xoops']->path('class/template.php'); |
| 50 | 50 | $xoopsTpl = new XoopsTpl(); |
| 51 | 51 | } |
@@ -3,14 +3,14 @@ discard block |
||
| 3 | 3 | // Информация об теге |
| 4 | 4 | function instruction_tag_iteminfo(&$items) |
| 5 | 5 | { |
| 6 | - if (empty($items) || !is_array($items)) { |
|
| 6 | + if (empty($items) || ! is_array($items)) { |
|
| 7 | 7 | return false; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | $items_id = []; |
| 11 | 11 | foreach (array_keys($items) as $cat_id) { |
| 12 | 12 | foreach (array_keys($items[$cat_id]) as $item_id) { |
| 13 | - $items_id[] = (int)$item_id; |
|
| 13 | + $items_id[] = (int) $item_id; |
|
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | . ' OR aa.status < 1' |
| 63 | 63 | . ' )'; |
| 64 | 64 | endif; |
| 65 | - if (!$result = $linkHandler->db->queryF($sql)) { |
|
| 65 | + if ( ! $result = $linkHandler->db->queryF($sql)) { |
|
| 66 | 66 | //xoops_error($linkHandler->db->error()); |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | |
| 10 | 10 | $sql = 'SELECT p.pageid, p.title, p.uid, p.datecreated, i.title FROM ' . $GLOBALS['xoopsDB']->prefix('instruction_page') . ' p, ' . $GLOBALS['xoopsDB']->prefix('instruction_instr') . ' i WHERE i.instrid = p.instrid AND i.status > 0 AND p.status > 0 AND p.type > 0'; |
| 11 | 11 | if (0 != $userid) { |
| 12 | - $sql .= ' AND p.uid = ' . (int)$userid . ' '; |
|
| 12 | + $sql .= ' AND p.uid = ' . (int) $userid . ' '; |
|
| 13 | 13 | //return NULL; |
| 14 | 14 | } |
| 15 | 15 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | // Получаем данные |
| 21 | 21 | // ID страницы |
| 22 | -$pageid = isset($_GET['id']) ? (int)$_GET['id'] : 0; |
|
| 22 | +$pageid = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 23 | 23 | // Без кэша |
| 24 | 24 | $nocache = InstructionUtility::cleanVars($_GET, 'nocache', 0, 'int'); |
| 25 | 25 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | // Права на просмотр инструкции |
| 60 | 60 | $categories = InstructionUtility::getItemIds(); |
| 61 | -if (!in_array($objInsinstr->getVar('cid'), $categories)) { |
|
| 61 | +if ( ! in_array($objInsinstr->getVar('cid'), $categories)) { |
|
| 62 | 62 | redirect_header(XOOPS_URL . '/modules/' . $moduleDirName . '/', 3, _NOPERM); |
| 63 | 63 | exit(); |
| 64 | 64 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $html .= "<ul>\n"; |
| 43 | 43 | // |
| 44 | 44 | $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
| 45 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
| 45 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
| 46 | 46 | if (function_exists('gd_info')) { |
| 47 | 47 | if ($gdlib = true === gd_info()) { |
| 48 | 48 | $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
| 57 | 57 | // |
| 58 | 58 | $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
| 59 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
| 59 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
| 60 | 60 | // |
| 61 | 61 | $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
| 62 | 62 | $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | break; |
| 52 | 52 | } |
| 53 | 53 | } else { |
| 54 | - if ((int)$v > 0) { // handles versions like x.x.x.0_RC2 |
|
| 54 | + if ((int) $v > 0) { // handles versions like x.x.x.0_RC2 |
|
| 55 | 55 | $success = false; |
| 56 | 56 | break; |
| 57 | 57 | } |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | */ |
| 64 | 64 | public function render() |
| 65 | 65 | { |
| 66 | - if (!isset($GLOBALS['xoTheme']) || !is_object($GLOBALS['xoTheme'])) { |
|
| 66 | + if ( ! isset($GLOBALS['xoTheme']) || ! is_object($GLOBALS['xoTheme'])) { |
|
| 67 | 67 | require_once $GLOBALS['xoops']->path('class/theme.php'); |
| 68 | 68 | $GLOBALS['xoTheme'] = new xos_opal_Theme(); |
| 69 | 69 | } |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | public static function createFolder($folder) |
| 27 | 27 | { |
| 28 | 28 | try { |
| 29 | - if (!file_exists($folder)) { |
|
| 30 | - if (!mkdir($folder) && !is_dir($folder)) { |
|
| 29 | + if ( ! file_exists($folder)) { |
|
| 30 | + if ( ! mkdir($folder) && ! is_dir($folder)) { |
|
| 31 | 31 | throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder)); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | public static function deleteDirectory($src) |
| 83 | 83 | { |
| 84 | 84 | // Only continue if user is a 'global' Admin |
| 85 | - if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) { |
|
| 85 | + if ( ! ($GLOBALS['xoopsUser'] instanceof XoopsUser) || ! $GLOBALS['xoopsUser']->isAdmin()) { |
|
| 86 | 86 | return false; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | $fileInfo = new SplFileInfo("{$src}/{$v}"); |
| 97 | 97 | if ($fileInfo->isDir()) { |
| 98 | 98 | // recursively handle subdirectories |
| 99 | - if (!$success = self::deleteDirectory($fileInfo->getRealPath())) { |
|
| 99 | + if ( ! $success = self::deleteDirectory($fileInfo->getRealPath())) { |
|
| 100 | 100 | break; |
| 101 | 101 | } |
| 102 | 102 | } else { |
| 103 | 103 | // delete the file |
| 104 | - if (!($success = unlink($fileInfo->getRealPath()))) { |
|
| 104 | + if ( ! ($success = unlink($fileInfo->getRealPath()))) { |
|
| 105 | 105 | break; |
| 106 | 106 | } |
| 107 | 107 | } |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | public static function rrmdir($src) |
| 131 | 131 | { |
| 132 | 132 | // Only continue if user is a 'global' Admin |
| 133 | - if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) { |
|
| 133 | + if ( ! ($GLOBALS['xoopsUser'] instanceof XoopsUser) || ! $GLOBALS['xoopsUser']->isAdmin()) { |
|
| 134 | 134 | return false; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // If source is not a directory stop processing |
| 138 | - if (!is_dir($src)) { |
|
| 138 | + if ( ! is_dir($src)) { |
|
| 139 | 139 | return false; |
| 140 | 140 | } |
| 141 | 141 | |
@@ -147,15 +147,15 @@ discard block |
||
| 147 | 147 | if ($fObj->isFile()) { |
| 148 | 148 | $filename = $fObj->getPathname(); |
| 149 | 149 | $fObj = null; // clear this iterator object to close the file |
| 150 | - if (!unlink($filename)) { |
|
| 150 | + if ( ! unlink($filename)) { |
|
| 151 | 151 | return false; // couldn't delete the file |
| 152 | 152 | } |
| 153 | - } elseif (!$fObj->isDot() && $fObj->isDir()) { |
|
| 153 | + } elseif ( ! $fObj->isDot() && $fObj->isDir()) { |
|
| 154 | 154 | // Try recursively on directory |
| 155 | 155 | self::rrmdir($fObj->getPathname()); |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | - $iterator = null; // clear iterator Obj to close file/directory |
|
| 158 | + $iterator = null; // clear iterator Obj to close file/directory |
|
| 159 | 159 | return rmdir($src); // remove the directory & return results |
| 160 | 160 | } |
| 161 | 161 | |
@@ -170,17 +170,17 @@ discard block |
||
| 170 | 170 | public static function rmove($src, $dest) |
| 171 | 171 | { |
| 172 | 172 | // Only continue if user is a 'global' Admin |
| 173 | - if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) { |
|
| 173 | + if ( ! ($GLOBALS['xoopsUser'] instanceof XoopsUser) || ! $GLOBALS['xoopsUser']->isAdmin()) { |
|
| 174 | 174 | return false; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | // If source is not a directory stop processing |
| 178 | - if (!is_dir($src)) { |
|
| 178 | + if ( ! is_dir($src)) { |
|
| 179 | 179 | return false; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | // If the destination directory does not exist and could not be created stop processing |
| 183 | - if (!is_dir($dest) && !mkdir($dest, 0755)) { |
|
| 183 | + if ( ! is_dir($dest) && ! mkdir($dest, 0755)) { |
|
| 184 | 184 | return false; |
| 185 | 185 | } |
| 186 | 186 | |
@@ -189,13 +189,13 @@ discard block |
||
| 189 | 189 | foreach ($iterator as $fObj) { |
| 190 | 190 | if ($fObj->isFile()) { |
| 191 | 191 | rename($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
| 192 | - } elseif (!$fObj->isDot() && $fObj->isDir()) { |
|
| 192 | + } elseif ( ! $fObj->isDot() && $fObj->isDir()) { |
|
| 193 | 193 | // Try recursively on directory |
| 194 | 194 | self::rmove($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
| 195 | 195 | // rmdir($fObj->getPath()); // now delete the directory |
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | - $iterator = null; // clear iterator Obj to close file/directory |
|
| 198 | + $iterator = null; // clear iterator Obj to close file/directory |
|
| 199 | 199 | return rmdir($src); // remove the directory & return results |
| 200 | 200 | } |
| 201 | 201 | |
@@ -213,17 +213,17 @@ discard block |
||
| 213 | 213 | public static function rcopy($src, $dest) |
| 214 | 214 | { |
| 215 | 215 | // Only continue if user is a 'global' Admin |
| 216 | - if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) { |
|
| 216 | + if ( ! ($GLOBALS['xoopsUser'] instanceof XoopsUser) || ! $GLOBALS['xoopsUser']->isAdmin()) { |
|
| 217 | 217 | return false; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | // If source is not a directory stop processing |
| 221 | - if (!is_dir($src)) { |
|
| 221 | + if ( ! is_dir($src)) { |
|
| 222 | 222 | return false; |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | // If the destination directory does not exist and could not be created stop processing |
| 226 | - if (!is_dir($dest) && !mkdir($dest, 0755)) { |
|
| 226 | + if ( ! is_dir($dest) && ! mkdir($dest, 0755)) { |
|
| 227 | 227 | return false; |
| 228 | 228 | } |
| 229 | 229 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | foreach ($iterator as $fObj) { |
| 233 | 233 | if ($fObj->isFile()) { |
| 234 | 234 | copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
| 235 | - } elseif (!$fObj->isDot() && $fObj->isDir()) { |
|
| 235 | + } elseif ( ! $fObj->isDot() && $fObj->isDir()) { |
|
| 236 | 236 | self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
| 237 | 237 | } |
| 238 | 238 | } |