Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

@@ -12,35 +12,49 @@
namespace IPS\nexus\modules\admin\reports;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use InvalidArgumentException;
use IPS\Dispatcher;
use IPS\Dispatcher\Controller;
use IPS\core\Statistics\Chart;
use IPS\Helpers\Chart\Dynamic;
use IPS\Http\Url;
use IPS\Member;
use IPS\nexus\Money;
use IPS\Output;
use IPS\Request;
use IPS\Theme;
use function defined;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Markets Report
*/
class _markets extends \IPS\Dispatcher\Controller
class markets extends Controller
{
/**
* @brief Has been CSRF-protected
*/
public static $csrfProtected = TRUE;
public static bool $csrfProtected = TRUE;
/**
* @brief Allow MySQL RW separation for efficiency
*/
public static $allowRWSeparation = TRUE;
public static bool $allowRWSeparation = TRUE;
/**
* Execute
*
* @return void
*/
public function execute()
public function execute() : void
{
\IPS\Dispatcher::i()->checkAcpPermission( 'markets_manage' );
Dispatcher::i()->checkAcpPermission( 'markets_manage' );
parent::execute();
}
@@ -49,37 +63,37 @@ class _markets extends \IPS\Dispatcher\Controller
*
* @return void
*/
protected function manage()
protected function manage() : void
{
$tabs['count'] = 'nexus_report_count';
foreach ( \IPS\nexus\Money::currencies() as $currency )
foreach ( Money::currencies() as $currency )
{
$tabs[ $currency ] = \IPS\Member::loggedIn()->language()->addToStack( 'nexus_report_income', FALSE, array( 'sprintf' => array( $currency ) ) );
$tabs[ $currency ] = Member::loggedIn()->language()->addToStack( 'nexus_report_income', FALSE, array( 'sprintf' => array( $currency ) ) );
}
\IPS\Request::i()->tab ??= 'count';
$activeTab = ( array_key_exists( \IPS\Request::i()->tab, $tabs ) ) ? \IPS\Request::i()->tab : 'count';
$extension = \IPS\core\Statistics\Chart::loadFromExtension( 'nexus', 'Market' );
$chart = $extension->getChart( \IPS\Http\Url::internal( "app=nexus&module=reports&controller=markets&tab={$activeTab}" ) );
Request::i()->tab ??= 'count';
$activeTab = ( array_key_exists( Request::i()->tab, $tabs ) ) ? Request::i()->tab : 'count';
$extension = Chart::loadFromExtension( 'nexus', 'Market' );
$chart = $extension->getChart( Url::internal( "app=nexus&module=reports&controller=markets&tab={$activeTab}" ) );
if ( $activeTab !== 'count' )
{
try
{
$extension->setCurrency( $chart, $activeTab );
}
catch( \InvalidArgumentException ) {}
catch( InvalidArgumentException ) {}
}
if ( \IPS\Request::i()->isAjax() )
/* @var Dynamic $chart */
if ( Request::i()->isAjax() )
{
\IPS\Output::i()->output = (string) $chart;
Output::i()->output = (string) $chart;
}
else
{
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__nexus_reports_markets');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->tabs( $tabs, $activeTab, (string) $chart, \IPS\Http\Url::internal( "app=nexus&module=reports&controller=markets" ) );
Output::i()->title = Member::loggedIn()->language()->addToStack('menu__nexus_reports_markets');
Output::i()->output = Theme::i()->getTemplate( 'global', 'core' )->tabs( $tabs, $activeTab, (string) $chart, Url::internal( "app=nexus&module=reports&controller=markets" ) );
}
}
}