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

+20 -7
View File
@@ -25,6 +25,7 @@ use Throwable;
use UnderflowException;
use IPS\Widget\StaticCache;
use IPS\Widget;
use IPS\cms\Databases\Dispatcher as DatabaseDispatcher;
use function defined;
/* To prevent PHP errors (extending class does not exist) revealing path */
@@ -103,12 +104,8 @@ class tableofcontents extends StaticCache
{
parent::__construct( $uniqueKey, $configuration, $access, $orientation, $layout );
$data = Dispatcher::i()->getLocationData();
if ( @$data['app'] === 'cms' and @$data['module'] === 'pages' and @$data['controller'] === 'page' and $page = page::getPage() )
{
@$data['id'] = $page->id;
}
$location = static::getLocationHash( @$data['app'], @$data['module'], @$data['controller'], @$data['id'] );
$data = $this->getLocationData();
$location = static::getLocationHash( @$data['app'], @$data['module'], @$data['controller'], @$data['key'] );
$this->cacheKey = "widget_{$this->key}_" . $this->uniqueKey . '_' . md5( Member::loggedIn()->language()->id . "_" . $orientation) . ( $this->canEdit() ? '_canEdit_' : '_cannotEdit_' ) . '_' . $location;
}
@@ -231,7 +228,23 @@ class tableofcontents extends StaticCache
}
}
$data = Dispatcher::i()->getLocationData();
if ( $data['app'] === 'cms' and $data['module'] === 'pages' and $data['controller'] === 'page' and $page = page::getPage() )
$recordId = null;
try
{
if ( DatabaseDispatcher::i() instanceof DatabaseDispatcher and DatabaseDispatcher::i()->recordId and DatabaseDispatcher::i()->databaseId )
{
$recordId = DatabaseDispatcher::i()->recordId;
}
}
catch ( OutOfRangeException | OutOfBoundsException ){}
if ( $recordId )
{
$data['key'] = "IPS\\cms\\Records" . DatabaseDispatcher::i()->databaseId . '_' . $recordId;
}
else if ( $data['app'] === 'cms' and $data['module'] === 'pages' and $data['controller'] === 'page' and $page = page::getPage() )
{
$data['key'] = (string) $page->id;
}