Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -21,8 +21,10 @@ use IPS\cms\Records;
|
||||
use IPS\core\DataLayer;
|
||||
use IPS\Dispatcher as SystemDispatcher;
|
||||
use IPS\Dispatcher\Controller;
|
||||
use IPS\Dispatcher\Front;
|
||||
use IPS\Http\Url;
|
||||
use IPS\Output;
|
||||
use IPS\Platform\Bridge;
|
||||
use IPS\Request;
|
||||
use IPS\Settings;
|
||||
use OutOfRangeException;
|
||||
@@ -52,7 +54,12 @@ class Dispatcher extends SystemDispatcher
|
||||
* @brief Controller location
|
||||
*/
|
||||
public string $controllerLocation = 'front';
|
||||
|
||||
|
||||
/**
|
||||
* Controller
|
||||
*/
|
||||
public ?string $controller = NULL;
|
||||
|
||||
/**
|
||||
* @brief Database Id
|
||||
*/
|
||||
@@ -198,7 +205,7 @@ class Dispatcher extends SystemDispatcher
|
||||
}
|
||||
}
|
||||
|
||||
list( $path, $pageNumber ) = Page::getStrippedPagePath( $path );
|
||||
[ $path, $pageNumber ] = Page::getStrippedPagePath( $path );
|
||||
|
||||
$this->databaseId = $database->id;
|
||||
|
||||
@@ -210,16 +217,16 @@ class Dispatcher extends SystemDispatcher
|
||||
/* Got a specific category ID? */
|
||||
if ( $this->categoryId !== NULL and ! $path and ( ( $database->use_categories and $database->cat_index_type !== 1 ) OR ( ! $database->use_categories and isset( Request::i()->do ) ) ) )
|
||||
{
|
||||
$this->module = 'category';
|
||||
$this->controller = 'category';
|
||||
}
|
||||
else if ( isset( Request::i()->c ) AND is_numeric( Request::i()->c ) )
|
||||
{
|
||||
$this->categoryId = Request::i()->c;
|
||||
$this->module = 'category';
|
||||
$this->controller = 'category';
|
||||
}
|
||||
else if ( empty( $path ) )
|
||||
{
|
||||
$this->module = 'index';
|
||||
$this->controller = 'index';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -322,18 +329,18 @@ class Dispatcher extends SystemDispatcher
|
||||
$this->_redirectToCorrectUrl( $record->url() );
|
||||
}
|
||||
|
||||
$this->module = 'record';
|
||||
$this->controller = 'record';
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It's a category listing */
|
||||
$this->module = 'category';
|
||||
$this->controller = 'category';
|
||||
}
|
||||
}
|
||||
|
||||
$this->url = Url::internal( $url, 'front', 'content_page_path' );
|
||||
$className = '\\IPS\\cms\\modules\\front\\database\\' . $this->module;
|
||||
|
||||
$className = '\\IPS\\cms\\modules\\front\\database\\' . $this->controller;
|
||||
|
||||
/* Init class */
|
||||
if( !class_exists( $className ) )
|
||||
{
|
||||
@@ -372,7 +379,7 @@ class Dispatcher extends SystemDispatcher
|
||||
$controller->execute();
|
||||
|
||||
/* Data Layer Context */
|
||||
if ( $this->databaseId AND Settings::i()->core_datalayer_enabled )
|
||||
if ( $this->databaseId AND DataLayer::enabled() )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -445,6 +452,25 @@ class Dispatcher extends SystemDispatcher
|
||||
*/
|
||||
public function finish() : void
|
||||
{
|
||||
Bridge::i()->frontDispatcherFinish();
|
||||
|
||||
if( $this->recordId )
|
||||
{
|
||||
Output::i()->bodyAttributes['contentClass'] = 'IPS\cms\Records' . $this->databaseId;
|
||||
}
|
||||
elseif( $this->categoryId )
|
||||
{
|
||||
Output::i()->bodyAttributes['contentClass'] = 'IPS\cms\Categories' . $this->databaseId;
|
||||
}
|
||||
else
|
||||
{
|
||||
Output::i()->bodyAttributes['contentClass'] = 'IPS\cms\Databases';
|
||||
}
|
||||
|
||||
/* Data Attributes */
|
||||
Output::i()->setBodyAttributes();
|
||||
Front::checkAlerts( $this );
|
||||
|
||||
Output::i()->output = $this->output ?: Output::i()->output;
|
||||
|
||||
/* Loader Extension */
|
||||
|
||||
Reference in new issue
Block a user