-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for use in XOOPS/XoopsCore25 2.5.11
- Loading branch information
1 parent
1dbcd95
commit a99c7d6
Showing
13 changed files
with
69 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
xWhoops | ||
======= | ||
xWhoops25 | ||
========= | ||
|
||
A XOOPS 2.6.0 extension that brings [whoops](https://github.com/filp/whoops) error display to XOOPS. It is especially handy for diagnosing failures brought on by unhandled errors, so you can more properly handle them. | ||
A XOOPS 2.5.11+ extension that brings [whoops](https://github.com/filp/whoops) error display to XOOPS. It is especially handy for diagnosing failures brought on by unhandled errors, so you can more properly handle them. | ||
|
||
Administrators will always have access to the extended diagnotics, and other groups can also be granted access. | ||
|
||
Outside of the control panel, there is no user interface. It will "just work" when needed. | ||
|
||
To add *xwhoops* to your XoopsCore use: | ||
``` | ||
composer require geekwright/xwhoops | ||
``` | ||
To add *xwhoops25* to your XoopsCore25, follow these steps | ||
- download the distribution archive of your choice | ||
- explode the archive into your system's modules directory | ||
- rename the new directory to xwhoops25 | ||
- open a terminal into that folder and execute | ||
```composer install``` | ||
- install the xwhoops25 module in the system administration module page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
use Xmf\Module\Admin; | ||
|
||
/** | ||
* @copyright 2019 XOOPS Project (https://xoops.org) | ||
* @copyright 2019-2021 XOOPS Project (https://xoops.org) | ||
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) | ||
* @author Richard Griffith <[email protected]> | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,9 @@ | |
*/ | ||
|
||
/** | ||
* @copyright 2019 XOOPS Project (https://xoops.org) | ||
* @copyright 2019-2021 XOOPS Project (https://xoops.org) | ||
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) | ||
* @author Richard Griffith <[email protected]> | ||
*/ | ||
|
||
$xoops->footer(); | ||
xoops_cp_footer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,25 @@ | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
*/ | ||
|
||
use Xmf\Language; | ||
|
||
/** | ||
* @copyright 2019 XOOPS Project (https://xoops.org) | ||
* @copyright 2019-2021 XOOPS Project (https://xoops.org) | ||
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) | ||
* @author Richard Griffith <[email protected]> | ||
*/ | ||
|
||
require_once dirname(__DIR__, 3) . '/include/cp_header.php'; | ||
$xoops = Xoops::getInstance(); | ||
$xoops->header(); | ||
$path = dirname(__DIR__, 3); | ||
require_once $path . '/mainfile.php'; | ||
require_once $path . '/include/cp_functions.php'; | ||
require_once $path . '/include/cp_header.php'; | ||
|
||
class_exists('\Xmf\Module\Admin') or die('XMF is required.'); | ||
|
||
global $xoopsModule; | ||
|
||
$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); | ||
|
||
Language::load('main', $thisModuleDir); | ||
|
||
xoops_cp_header(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
use Xmf\Module\Admin; | ||
|
||
/** | ||
* @copyright 2019 XOOPS Project (https://xoops.org) | ||
* @copyright 2019-2021 XOOPS Project (https://xoops.org) | ||
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) | ||
* @author Richard Griffith <[email protected]> | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
*/ | ||
|
||
/** | ||
* @copyright 2019 XOOPS Project (https://xoops.org) | ||
* @copyright 2019-2021 XOOPS Project (https://xoops.org) | ||
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) | ||
* @author Richard Griffith <[email protected]> | ||
*/ | ||
|
@@ -36,10 +36,10 @@ | |
'title' => _MI_XWHOOPS_ADMENU2 , | ||
'link' => 'admin/about.php' , | ||
'icon' => $pathIcon32.'about.png' | ||
) ; | ||
|
||
); | ||
// Permissions | ||
$adminmenu[] = array( | ||
'title' => _MI_XWHOOPS_ADMENU3 , | ||
'link' => 'admin/permissions.php' , | ||
'icon' => 'permissions.png' | ||
) ; | ||
'title' => _MI_XWHOOPS_ADMENU3 , | ||
'link' => 'admin/permissions.php' , | ||
'icon' => $pathIcon32.'permissions.png' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
*/ | ||
|
||
/** | ||
* @copyright 2019 XOOPS Project (https://xoops.org) | ||
* @copyright 2019-2021 XOOPS Project (https://xoops.org) | ||
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) | ||
* @author Richard Griffith <[email protected]> | ||
*/ | ||
|
@@ -24,6 +24,8 @@ | |
|
||
include_once __DIR__ . '/admin_header.php'; | ||
|
||
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; | ||
|
||
$moduleAdmin = Admin::getInstance(); | ||
$moduleAdmin->displayNavigation('permissions.php'); | ||
|
||
|
@@ -35,14 +37,16 @@ | |
$permissionItemId=0; | ||
|
||
// if this is a post operation get our variables | ||
if ('POST'===Request::getMethod()) { | ||
if ('POST' === Request::getMethod()) { | ||
if (!$GLOBALS['xoopsSecurity']->check()) { | ||
redirect_header(XOOPS_URL . '/', 3, $GLOBALS['xoopsSecurity']->getErrors()); | ||
} | ||
$name=$permHelper->defaultFieldName($permissionName, $permissionItemId); | ||
$groups=Request::getVar($name, array(), 'POST'); | ||
$permHelper->savePermissionForItem($permissionName, $permissionItemId, $groups); | ||
echo $xoops->alert('success', _MA_XWHOOPS_FORM_PROCESSED, _MA_XWHOOPS_PERMISSION_FORM); | ||
xoops_result(_MA_XWHOOPS_FORM_PROCESSED, _MA_XWHOOPS_PERMISSION_FORM); | ||
} | ||
|
||
$form = new \Xoops\Form\ThemeForm(_MA_XWHOOPS_PERMISSION_FORM, 'form', '', 'POST'); | ||
$form = new XoopsThemeForm(_MA_XWHOOPS_PERMISSION_FORM, 'form', '', 'POST', true); | ||
$permElement = $permHelper->getGroupSelectFormForItem( | ||
$permissionName, | ||
$permissionItemId, | ||
|
@@ -52,7 +56,7 @@ | |
); | ||
|
||
$form->addElement($permElement); | ||
$form->addElement(new \Xoops\Form\Button('', 'submit', _MA_XWHOOPS_FORM_SUBMIT, 'submit')); | ||
$form->addElement(new XoopsFormButton('', 'submit', _MA_XWHOOPS_FORM_SUBMIT, 'submit')); | ||
|
||
echo $form->render(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
v0.1.0 | ||
================================= | ||
- Original release of xWhoops | ||
v0.2 | ||
================================ | ||
- Forked from geekwright/xwhoops | ||
- Adapted to XoopsCore25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
*/ | ||
|
||
/** | ||
* @copyright 2019 XOOPS Project (https://xoops.org) | ||
* @copyright 2019-2021 XOOPS Project (https://xoops.org) | ||
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) | ||
* @author Richard Griffith <[email protected]> | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright 2019 XOOPS Project (https://xoops.org) | ||
* @copyright 2019-2021 XOOPS Project (https://xoops.org) | ||
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) | ||
* @author Richard Griffith <[email protected]> | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
<?php | ||
|
||
use Xmf\Module\Helper\Permission; | ||
use Xoops\Core\PreloadItem; | ||
|
||
|
||
/** | ||
* @copyright 2019 XOOPS Project (https://xoops.org) | ||
* @copyright 2019-2021 XOOPS Project (https://xoops.org) | ||
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) | ||
* @author Richard Griffith <[email protected]> | ||
*/ | ||
class XwhoopsPreload extends PreloadItem | ||
class Xwhoops25CorePreload extends XoopsPreloadItem | ||
{ | ||
/** | ||
* eventCoreIncludeCommonAuthSuccess | ||
|
@@ -18,7 +17,12 @@ class XwhoopsPreload extends PreloadItem | |
*/ | ||
public static function eventCoreIncludeCommonAuthSuccess() | ||
{ | ||
$permissionHelper = new Permission('xwhoops'); | ||
$autoloader = dirname(__DIR__) . '/vendor/autoload.php'; | ||
if (!file_exists($autoloader)) { | ||
trigger_error("xwhoops25/vendor/autoload.php not found, was 'composer install' done?"); | ||
} | ||
require_once $autoloader; | ||
$permissionHelper = new Permission('xwhoops25'); | ||
if ($permissionHelper) { | ||
$permissionName = 'use_xwhoops'; | ||
$permissionItemId = 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters