@@ -19,33 +19,33 @@ |
||
| 19 | 19 | defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); |
| 20 | 20 | |
| 21 | 21 | // get path to icons |
| 22 | -$pathIcon32=''; |
|
| 22 | +$pathIcon32 = ''; |
|
| 23 | 23 | if (class_exists('Xmf\Module\Admin', true)) { |
| 24 | 24 | $pathIcon32 = \Xmf\Module\Admin::menuIconPath(''); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | -$adminmenu=array(); |
|
| 27 | +$adminmenu = array(); |
|
| 28 | 28 | // Index |
| 29 | 29 | $adminmenu[] = array( |
| 30 | - 'title' => _MI_XWHOOPS_HOME , |
|
| 31 | - 'link' => 'admin/index.php' , |
|
| 32 | - 'icon' => $pathIcon32.'home.png' |
|
| 33 | -) ; |
|
| 30 | + 'title' => _MI_XWHOOPS_HOME, |
|
| 31 | + 'link' => 'admin/index.php', |
|
| 32 | + 'icon' => $pathIcon32 . 'home.png' |
|
| 33 | +); |
|
| 34 | 34 | // About |
| 35 | 35 | $adminmenu[] = array( |
| 36 | - 'title' => _MI_XWHOOPS_ABOUT , |
|
| 37 | - 'link' => 'admin/about.php' , |
|
| 38 | - 'icon' => $pathIcon32.'about.png' |
|
| 36 | + 'title' => _MI_XWHOOPS_ABOUT, |
|
| 37 | + 'link' => 'admin/about.php', |
|
| 38 | + 'icon' => $pathIcon32 . 'about.png' |
|
| 39 | 39 | ); |
| 40 | 40 | // Permissions |
| 41 | 41 | $adminmenu[] = array( |
| 42 | - 'title' => _MI_XWHOOPS_PERMISSIONS , |
|
| 43 | - 'link' => 'admin/permissions.php' , |
|
| 44 | - 'icon' => $pathIcon32.'permissions.png' |
|
| 42 | + 'title' => _MI_XWHOOPS_PERMISSIONS, |
|
| 43 | + 'link' => 'admin/permissions.php', |
|
| 44 | + 'icon' => $pathIcon32 . 'permissions.png' |
|
| 45 | 45 | ); |
| 46 | 46 | // Test |
| 47 | 47 | $adminmenu[] = array( |
| 48 | - 'title' => _MI_XWHOOPS_EXAMPLE , |
|
| 49 | - 'link' => 'admin/index.php?do=example' , |
|
| 50 | - 'icon' => $pathIcon32.'exec.png' |
|
| 48 | + 'title' => _MI_XWHOOPS_EXAMPLE, |
|
| 49 | + 'link' => 'admin/index.php?do=example', |
|
| 50 | + 'icon' => $pathIcon32 . 'exec.png' |
|
| 51 | 51 | ); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | try { |
| 16 | 16 | new \NoSuchClass($this->message); |
| 17 | - } catch (Throwable $e) { |
|
| 17 | + } catch (Throwable $e) { |
|
| 18 | 18 | throw new RuntimeException('Example Exception, follow how we got here.', 100, $e); |
| 19 | 19 | } |
| 20 | 20 | } |
@@ -33,16 +33,16 @@ |
||
| 33 | 33 | $permHelper = new Permission(); |
| 34 | 34 | if ($permHelper) { |
| 35 | 35 | // this is the name and item we are going to work with |
| 36 | - $permissionName='use_xwhoops'; |
|
| 37 | - $permissionItemId=0; |
|
| 36 | + $permissionName = 'use_xwhoops'; |
|
| 37 | + $permissionItemId = 0; |
|
| 38 | 38 | |
| 39 | 39 | // if this is a post operation get our variables |
| 40 | 40 | if ('POST' === Request::getMethod()) { |
| 41 | 41 | if (!$GLOBALS['xoopsSecurity']->check()) { |
| 42 | 42 | redirect_header(XOOPS_URL . '/', 3, $GLOBALS['xoopsSecurity']->getErrors()); |
| 43 | 43 | } |
| 44 | - $name=$permHelper->defaultFieldName($permissionName, $permissionItemId); |
|
| 45 | - $groups=Request::getVar($name, array(), 'POST'); |
|
| 44 | + $name = $permHelper->defaultFieldName($permissionName, $permissionItemId); |
|
| 45 | + $groups = Request::getVar($name, array(), 'POST'); |
|
| 46 | 46 | $permHelper->savePermissionForItem($permissionName, $permissionItemId, $groups); |
| 47 | 47 | xoops_result(_MA_XWHOOPS_FORM_PROCESSED, _MA_XWHOOPS_PERMISSION_FORM); |
| 48 | 48 | } |
@@ -36,19 +36,19 @@ |
||
| 36 | 36 | $whoops->register(); |
| 37 | 37 | $handler->addDataTableCallback( |
| 38 | 38 | _LOGGER_QUERIES, |
| 39 | - function () { |
|
| 39 | + function() { |
|
| 40 | 40 | $logger = XoopsLogger::getInstance(); |
| 41 | 41 | if (false == $logger->renderingEnabled) { |
| 42 | - return ['XoopsLogger' => 'off']; // logger is off so data is incomplete |
|
| 42 | + return ['XoopsLogger' => 'off']; // logger is off so data is incomplete |
|
| 43 | 43 | } |
| 44 | 44 | $queries = []; |
| 45 | - $count=1; |
|
| 46 | - foreach($logger->queries as $key => $q) { |
|
| 47 | - $error = (null===$q['errno'] ? '' : $q['errno'].' ') . (null===$q['error'] ? '' : $q['error']); |
|
| 45 | + $count = 1; |
|
| 46 | + foreach ($logger->queries as $key => $q) { |
|
| 47 | + $error = (null === $q['errno'] ? '' : $q['errno'] . ' ') . (null === $q['error'] ? '' : $q['error']); |
|
| 48 | 48 | $queryTime = isset($q['query_time']) ? sprintf('%0.6f', $q['query_time']) : ''; |
| 49 | 49 | $queryKey = (string) $count++ . ' - ' . $queryTime; |
| 50 | 50 | if (null !== $q['errno']) { |
| 51 | - $queryKey = (string) $count .' - Error' ; |
|
| 51 | + $queryKey = (string) $count . ' - Error'; |
|
| 52 | 52 | } |
| 53 | 53 | $queries[$queryKey] = htmlentities($q['sql']) . ' ' . $error; |
| 54 | 54 | } |
@@ -6,12 +6,12 @@ |
||
| 6 | 6 | * @author Richard Griffith <[email protected]> |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -define('_MI_XWHOOPS_NAME','xWhoops'); |
|
| 10 | -define('_MI_XWHOOPS_DESCRIPTION','Whoops for XOOPS'); |
|
| 9 | +define('_MI_XWHOOPS_NAME', 'xWhoops'); |
|
| 10 | +define('_MI_XWHOOPS_DESCRIPTION', 'Whoops for XOOPS'); |
|
| 11 | 11 | |
| 12 | -define('_MI_XWHOOPS_HOME','Home'); |
|
| 13 | -define('_MI_XWHOOPS_ABOUT','About'); |
|
| 14 | -define('_MI_XWHOOPS_PERMISSIONS','Permissions'); |
|
| 15 | -define('_MI_XWHOOPS_EXAMPLE','Example'); |
|
| 12 | +define('_MI_XWHOOPS_HOME', 'Home'); |
|
| 13 | +define('_MI_XWHOOPS_ABOUT', 'About'); |
|
| 14 | +define('_MI_XWHOOPS_PERMISSIONS', 'Permissions'); |
|
| 15 | +define('_MI_XWHOOPS_EXAMPLE', 'Example'); |
|
| 16 | 16 | |
| 17 | 17 | define('_MI_XWHOOPS_NEEDS_COMPOSER', 'xWhoops needs to have "composer install" run to work. See the help page.'); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | * @author Richard Griffith <[email protected]> |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | -define('_MA_XWHOOPS_PERMISSION_FORM','xWhoops Usage Permissions'); |
|
| 19 | -define('_MA_XWHOOPS_PERMISSION_GROUPS','Select groups that may use xWhoops'); |
|
| 20 | -define('_MA_XWHOOPS_FORM_SUBMIT','Save'); |
|
| 21 | -define('_MA_XWHOOPS_FORM_PROCESSED','Permissions updated.'); |
|
| 18 | +define('_MA_XWHOOPS_PERMISSION_FORM', 'xWhoops Usage Permissions'); |
|
| 19 | +define('_MA_XWHOOPS_PERMISSION_GROUPS', 'Select groups that may use xWhoops'); |
|
| 20 | +define('_MA_XWHOOPS_FORM_SUBMIT', 'Save'); |
|
| 21 | +define('_MA_XWHOOPS_FORM_PROCESSED', 'Permissions updated.'); |
|