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

@@ -11,62 +11,73 @@
namespace IPS\core\modules\admin\activitystats;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use Exception;
use IPS\Application;
use IPS\core\modules\admin\stats\overview as StatsOverview;
use IPS\Member;
use IPS\Output;
use IPS\Request;
use IPS\Theme;
use function defined;
use function is_array;
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;
}
/**
* Content overview statistics
*/
class _overview extends \IPS\core\modules\admin\stats\overview
class overview extends StatsOverview
{
/**
* @brief Has been CSRF-protected
*/
public static $csrfProtected = TRUE;
public static bool $csrfProtected = TRUE;
/**
* @brief Template group to use to output
*/
protected $templateGroup = 'activitystats';
protected string $templateGroup = 'activitystats';
/**
* @brief Allow MySQL RW separation for efficiency
*/
public static $allowRWSeparation = TRUE;
public static bool $allowRWSeparation = TRUE;
/**
* Create the general page layout, but we will load the individual cells via AJAX to ensure there are no performance concerns loading the page
*
* @return void
*/
protected function manage()
protected function manage() : void
{
$formHtml = $this->form->customTemplate( array( \IPS\Theme::i()->getTemplate( 'stats' ), 'filtersOverviewForm' ) );
$blocks = \IPS\Application::allExtensions( 'core', 'OverviewStatistics', TRUE, 'core', 'Registrations' );
$formHtml = $this->form->customTemplate( array( Theme::i()->getTemplate( 'stats' ), 'filtersOverviewForm' ) );
$blocks = Application::allExtensions( 'core', 'OverviewStatistics', TRUE, 'core', 'Registrations' );
$excludedApps = array();
if( isset( \IPS\Request::i()->cookie['overviewExcludedApps'] ) )
if( isset( Request::i()->cookie['overviewExcludedApps'] ) )
{
try
{
$excludedApps = json_decode( \IPS\Request::i()->cookie['overviewExcludedApps'] );
$excludedApps = json_decode( Request::i()->cookie['overviewExcludedApps'] );
if( !\is_array( $excludedApps ) )
if( !is_array( $excludedApps ) )
{
$excludedApps = array();
}
}
catch( \Exception $e ){}
catch( Exception $e ){}
}
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_stats.js', 'core' ) );
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'system/statistics.css', 'core', 'admin' ) );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__core_stats_overview');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( $this->templateGroup )->overview( $formHtml, $blocks, $excludedApps );
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'admin_stats.js', 'core' ) );
Output::i()->cssFiles = array_merge( Output::i()->cssFiles, Theme::i()->css( 'system/statistics.css', 'core', 'admin' ) );
Output::i()->title = Member::loggedIn()->language()->addToStack('menu__core_stats_overview');
Output::i()->output = Theme::i()->getTemplate( $this->templateGroup )->overview( $formHtml, $blocks, $excludedApps );
}
/**
@@ -74,15 +85,15 @@ class _overview extends \IPS\core\modules\admin\stats\overview
*
* @return void
*/
protected function loadBlockForm()
protected function loadBlockForm() : void
{
$blocks = \IPS\Application::allExtensions( 'core', 'OverviewStatistics', TRUE, 'core', 'Registrations' );
$blocks = Application::allExtensions( 'core', 'OverviewStatistics', TRUE, 'core', 'Registrations' );
if( !isset( $blocks[ \IPS\Request::i()->blockKey ] ) )
if( !isset( $blocks[ Request::i()->blockKey ] ) )
{
\IPS\Output::i()->error( 'stats_overview_block_not_found', '2C416/1', 404, '' );
Output::i()->error( 'stats_overview_block_not_found', '2C416/1', 404, '' );
}
\IPS\Output::i()->output = $blocks[ \IPS\Request::i()->blockKey ]->getBlockForm( \IPS\Request::i()->subBlockKey );
Output::i()->output = $blocks[ Request::i()->blockKey ]->getBlockForm( Request::i()->subBlockKey );
}
}