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

+23 -19
View File
@@ -11,28 +11,36 @@
namespace IPS\Dispatcher;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use DomainException;
use IPS\Output;
use IPS\Request;
use IPS\Session;
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;
}
/**
* Dispatcher that doesn't really dispatch but sets things up for external scripts like Pages external blocks
*/
class _External extends \IPS\Dispatcher\Standard
class External extends Standard
{
/**
* Controller Location
*/
public $controllerLocation = 'front';
public string $controllerLocation = 'front';
/**
* Init
*
* @return void
*/
public function init()
public function init() : void
{
/* Base CSS */
static::baseCss();
@@ -46,11 +54,11 @@ class _External extends \IPS\Dispatcher\Standard
parent::init();
/* Don't update sessions for this hit as it will wipe location data */
\IPS\Session::i()->noUpdate();
Session::i()->noUpdate();
}
catch ( \DomainException $e )
catch ( DomainException $e )
{
\IPS\Output::i()->error( $e->getMessage(), '2S100/' . $e->getCode(), $e->getCode() === 4 ? 403 : 404, '' );
Output::i()->error( $e->getMessage(), '2S100/' . $e->getCode(), $e->getCode() === 4 ? 403 : 404, '' );
}
}
@@ -59,15 +67,15 @@ class _External extends \IPS\Dispatcher\Standard
*
* @return void
*/
protected static function baseJs()
protected static function baseJs() : void
{
parent::baseJs();
/* Stuff for output */
if ( !\IPS\Request::i()->isAjax() )
if ( !Request::i()->isAjax() )
{
\IPS\Output::i()->globalControllers[] = 'core.front.core.app';
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front.js' ) );
Output::i()->globalControllers[] = 'core.front.core.app';
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'front.js' ) );
}
}
@@ -76,18 +84,14 @@ class _External extends \IPS\Dispatcher\Standard
*
* @return void
*/
public static function baseCss()
public static function baseCss() : void
{
parent::baseCss();
/* Stuff for output */
if ( !\IPS\Request::i()->isAjax() )
if ( !Request::i()->isAjax() )
{
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'core.css', 'core', 'front' ) );
if ( \IPS\Theme::i()->settings['responsive'] )
{
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'core_responsive.css', 'core', 'front' ) );
}
Output::i()->cssFiles = array_merge( Output::i()->cssFiles, Theme::i()->css( 'core.css', 'core', 'front' ) );
}
}
}