Version 5.0.13

This commit is contained in:
Neo committed 2025-12-19 19:04:57 -08:00
1 parent b89858b2ff
commit 5efe744c5f
1407 files changed
+69690 -30177

No files matched your search

+13 -32
View File
@@ -19,6 +19,7 @@ use InvalidArgumentException;
use IPS\Application;
use IPS\Content\Search\SearchContent;
use IPS\core\Alerts\Alert;
use IPS\core\DataLayer;
use IPS\core\IndexNow;
use IPS\core\Rss;
use IPS\Data\Cache;
@@ -27,6 +28,7 @@ use IPS\Data\Store;
use IPS\DateTime;
use IPS\Db;
use IPS\Developer;
use IPS\Dispatcher;
use IPS\Http\Url;
use IPS\Http\Url\Friendly;
use IPS\Http\Url\Internal;
@@ -513,7 +515,7 @@ class Front extends Standard
{
foreach( Application::applications() as $directory => $application )
{
if ( $application->_enabled )
if ( $application->enabled )
{
if( method_exists( $application, 'convertLegacyParameters' ) )
{
@@ -561,32 +563,6 @@ class Front extends Standard
}
}
catch ( UnderflowException $e ) {}
if ( Output::i()->allowDefaultWidgets )
{
$defaultAreas = [];
foreach ( Widget::appDefaults( $this->application ) as $widget )
{
$areaKey = $widget['default_area'];
/* If another app has already defined this area or the area has been filled by the page builder, don't overwrite it */
if ( isset( $widgets[ $areaKey ] ) and !isset( $defaultAreas[ $areaKey ] ) )
{
continue;
}
$widget['unique'] = $widget['key'];
if ( !isset( $widgets[ $areaKey ] ) )
{
$defaultAreas[ $areaKey ] = 1;
$widgets[ $areaKey ] = Area::create( $widget['default_area'], [ $widget ] );
}
else
{
$widgets[ $areaKey ]->addWidget( $widget );
}
}
}
if ( count( $widgets ) )
{
@@ -682,11 +658,14 @@ class Front extends Standard
/* Meta tags */
Output::i()->buildMetaTags();
/* Data Attributes */
Output::i()->setBodyAttributes();
/* Check MFA */
$this->checkMfa();
/* Check Alerts */
$this->checkAlerts();
static::checkAlerts( $this );
/* Loader Extension */
foreach( Application::allExtensions( 'core', 'Loader' ) as $loader )
@@ -888,7 +867,7 @@ FILE;
if ( !Request::i()->isAjax() )
{
Output::i()->globalControllers[] = 'core.front.core.app';
if ( Settings::i()->core_datalayer_enabled )
if ( DataLayer::enabled() )
{
Output::i()->globalControllers[] = 'core.front.core.dataLayer';
}
@@ -965,11 +944,13 @@ FILE;
}
/**
* Check and process alerts for the logged-in member.
*
*
* @param Dispatcher $dispatcher The dispatcher instance controlling the current request.
*
* @return void
*/
public function checkAlerts() : void
public static function checkAlerts( Dispatcher $dispatcher ) : void
{
/* Don't get in the way of validating members */
if ( Member::loggedIn()->members_bitoptions['validating'] )
@@ -985,7 +966,7 @@ FILE;
/* Don't get in the way of the ModCP, registering, logging in, etc */
$ignoreControllers = [ 'modcp', 'register', 'login', 'redirect', 'cookies', 'lostpass' ];
if( !Request::i()->isAjax() and !in_array( $this->controller, $ignoreControllers ) AND $alert = Alert::getNextAlertForMember( Member::loggedIn() ) )
if( !Request::i()->isAjax() and !in_array( $dispatcher->controller, $ignoreControllers ) AND $alert = Alert::getNextAlertForMember( Member::loggedIn() ) )
{
$alert->viewed( Member::loggedIn() );