</dd>
</dl>
- <dl{if $errorField == 'controller'} class="formError"{/if}>
- <dt><label for="controller">{lang}wcf.acp.page.controller{/lang}</label></dt>
- <dd>
- <input type="text" id="controller" name="controller" value="{$controller}" class="long"{if $action == 'edit' && $page->originIsSystem} readonly="readonly"{/if} />
- {if $errorField == 'controller'}
- <small class="innerError">
- {if $errorType == 'empty'}
- {lang}wcf.global.form.error.empty{/lang}
- {else}
- {lang}wcf.acp.page.controller.error.{@$errorType}{/lang}
- {/if}
- </small>
- {/if}
- </dd>
- </dl>
-
{if !$isMultilingual}
<dl{if $errorField == 'customURL'} class="formError"{/if}>
<dt><label for="customURL">{lang}wcf.acp.page.customURL{/lang}</label></dt>
*/
public $customURL = [];
- /**
- * page controller
- * @var string
- */
- public $controller = '';
-
/**
* page titles
* @var string[]
if (isset($_POST['isDisabled'])) $this->isDisabled = 1;
if (isset($_POST['isLandingPage'])) $this->isLandingPage = 1;
if (isset($_POST['applicationPackageID'])) $this->applicationPackageID = intval($_POST['applicationPackageID']);
- if (isset($_POST['controller'])) $this->controller = StringUtil::trim($_POST['controller']);
if (isset($_POST['customURL']) && is_array($_POST['customURL'])) $this->customURL = ArrayUtil::trim($_POST['customURL']);
if (isset($_POST['title']) && is_array($_POST['title'])) $this->title = ArrayUtil::trim($_POST['title']);
$this->validateApplicationPackageID();
- $this->validateController();
-
$this->validateCustomUrl();
$this->validateBoxIDs();
/**
* Validates page type.
+ *
+ * @throws UserInputException
*/
protected function validatePageType() {
if (!in_array($this->pageType, Page::$availablePageTypes) || $this->pageType == 'system') {
/**
* Validates parent page id.
+ *
+ * @throws UserInputException
*/
protected function validateParentPageID() {
if ($this->parentPageID) {
/**
* Validates package id.
+ *
+ * @throws UserInputException
*/
protected function validateApplicationPackageID() {
if (!isset($this->availableApplications[$this->applicationPackageID])) {
}
}
- /**
- * Validates controller.
- */
- protected function validateController() {
- if ($this->pageType == 'system') {
- if (!$this->controller) {
- throw new UserInputException('controller');
- }
-
- if (!class_exists($this->controller)) {
- throw new UserInputException('controller', 'notFound');
- }
- }
- }
-
/**
* Validates custom urls.
+ *
+ * @throws UserInputException
*/
protected function validateCustomUrl() {
foreach ($this->customURL as $type => $customURL) {
/**
* Validates box ids.
+ *
+ * @throws UserInputException
*/
protected function validateBoxIDs() {
foreach ($this->boxIDs as $boxID) {
'lastUpdateTime' => TIME_NOW,
'isMultilingual' => $this->isMultilingual,
'identifier' => '',
- 'controller' => $this->controller,
'packageID' => 1
]), 'content' => $content, 'boxToPage' => $this->getBoxToPage()]);
'isLandingPage' => $this->isLandingPage,
'isMultilingual' => $this->isMultilingual,
'applicationPackageID' => $this->applicationPackageID,
- 'controller' => $this->controller,
'customURL' => $this->customURL,
'title' => $this->title,
'content' => $this->content,
* Shows the page add form.
*
* @author Marcel Werk
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.form
/**
* @inheritDoc
+ *
+ * @throws IllegalLinkException
*/
public function readParameters() {
parent::readParameters();
if ($this->page->originIsSystem) {
$this->parentPageID = $this->page->parentPageID;
$this->applicationPackageID = $this->page->applicationPackageID;
- $this->controller = $this->page->controller;
}
if ($this->page->requireObjectID) {
/**
* @inheritDoc
*/
- protected function validatePageType() {
- // type is immutable
+ protected function validateName() {
+ if (mb_strtolower($this->name) != mb_strtolower($this->page->name)) {
+ parent::validateName();
+ }
}
/**
* @inheritDoc
*/
- protected function validateName() {
- if (mb_strtolower($this->name) != mb_strtolower($this->page->name)) {
- parent::validateName();
- }
+ protected function validatePageType() {
+ // type is immutable
}
/**
$this->parentPageID = $this->page->parentPageID;
$this->pageType = $this->page->pageType;
$this->applicationPackageID = $this->page->applicationPackageID;
- $this->controller = $this->page->controller;
if ($this->page->controllerCustomURL) $this->customURL[0] = $this->page->controllerCustomURL;
if ($this->page->isLandingPage) $this->isLandingPage = 1;
if ($this->page->isDiabled) $this->isDisabled = 1;