}
$cmsPageID = 0;
- if (\preg_match('~^__WCF_CMS__(\d+)$~', $landingPages['wcf'][0], $matches)) {
+ if (\preg_match('~^__WCF_CMS__(\d+)$~', $landingPages['wcf']['controller'], $matches)) {
$cmsPageID = $matches[1];
}
// Discard the custom url if this CMS page is the landing page of its associated app.
if (
!empty($landingPages[$abbreviation])
- && $landingPages[$abbreviation][0] === '__WCF_CMS__' . $row['pageID']
+ && $landingPages[$abbreviation]['controller'] === '__WCF_CMS__' . $row['pageID']
&& !$row['languageID']
) {
$customUrl = '';
$controller = $page->controller;
} else {
$controller = '__WCF_CMS__' . $page->pageID;
- $controller = [$controller, $controller, CmsPage::class];
+ $controller = [
+ 'controller' => $controller,
+ 'routePart' => $controller,
+ 'className' => CmsPage::class,
+ ];
}
} else {
if ($application->landingPageID) {
$controller = $page->controller;
} else {
$controller = '__WCF_CMS__' . $page->pageID;
- $controller = [$controller, $controller, CmsPage::class];
+ $controller = [
+ 'controller' => $controller,
+ 'routePart' => $controller,
+ 'className' => CmsPage::class,
+ ];
}
}
}
if (\is_string($controller)) {
$fqnController = $controller;
- $controller = $this->classNameToControllerName($fqnController);
+ $controller = $this->classNameToControllerName($controller);
$controller = [
- $controller,
- ControllerMap::transformController($controller),
- $fqnController,
+ 'controller' => $controller,
+ 'routePart' => ControllerMap::transformController($controller),
+ 'className' => $fqnController,
];
}
return $data;
}
- $landingPageController = $data['landingPages']['wcf'][0];
+ $landingPageController = $data['landingPages']['wcf']['controller'];
$controllers = [$landingPageController];
// The controller may be the custom url of a CMS page.
public function lookupDefaultController($application)
{
$data = $this->landingPages[$application];
- $controller = $data[1];
+ $controller = $data['routePart'];
if ($application === 'wcf' && empty($controller)) {
return null;
}
return [
- 'application' => \mb_substr($data[2], 0, \mb_strpos($data[2], '\\')),
+ 'application' => \mb_substr($data['className'], 0, \mb_strpos($data['className'], '\\')),
'controller' => $controller,
];
}
return false;
} else {
if (
- $matches['controller'] == $this->landingPages[$application][0]
+ $matches['controller'] == $this->landingPages[$application]['controller']
&& isset($this->customUrls['lookup'][$application][''])
&& $this->customUrls['lookup'][$application][''] !== $controller
) {
}
}
- if ($this->landingPages[$application][0] === $controller) {
+ if ($this->landingPages[$application]['controller'] === $controller) {
return true;
}
*/
public function isLandingPage(string $className, array $metaData)
{
- if ($className !== $this->landingPages['wcf'][2]) {
+ if ($className !== $this->landingPages['wcf']['className']) {
return false;
}
if ($className === CmsPage::class) {
// check if page id matches
- if ($this->landingPages['wcf'][1] !== '__WCF_CMS__' . $metaData['cms']['pageID']) {
+ if ($this->landingPages['wcf']['routePart'] !== '__WCF_CMS__' . $metaData['cms']['pageID']) {
return false;
}
}