Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -325,6 +325,40 @@ class _Dispatcher extends \IPS\Dispatcher
|
||||
|
||||
/* Execute */
|
||||
$controller->execute();
|
||||
|
||||
/* Data Layer Context */
|
||||
if ( $this->databaseId AND \IPS\Settings::i()->core_datalayer_enabled )
|
||||
{
|
||||
try
|
||||
{
|
||||
$databaseOrCategory = \IPS\cms\Databases::load( $this->databaseId );
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
return $this->finish();
|
||||
}
|
||||
|
||||
/* Use the category instead of the database if there is one */
|
||||
if ( $this->categoryId AND $databaseOrCategory->use_categories )
|
||||
{
|
||||
try
|
||||
{
|
||||
$catClass = '\IPS\cms\Categories' . $this->databaseId;
|
||||
$databaseOrCategory = $catClass::load( $this->categoryId );
|
||||
}
|
||||
catch ( \UnderflowException $e ) {}
|
||||
}
|
||||
|
||||
/* Add the database's/category's data layer properties to the page context */
|
||||
foreach ( $databaseOrCategory->getDataLayerProperties() as $key => $property )
|
||||
{
|
||||
\IPS\core\DataLayer::i()->addContextProperty( $key, $property, true );
|
||||
if ( $key === 'content_area' )
|
||||
{
|
||||
\IPS\core\DataLayer::i()->addContextProperty( 'community_area', $property, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->finish();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user