<option value="0">{lang}wcf.global.noSelection{/lang}</option>
{foreach from=$pageNodeList item=pageNode}
- <option value="{@$pageNode->getPage()->pageID}"{if $pageNode->getPage()->pageID == $pageID} selected="selected"{/if}>{if $pageNode->getDepth() > 1}{@" "|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->getPage()->displayName}</option>
+ <option value="{@$pageNode->getPage()->pageID}"{if $pageNode->getPage()->pageID == $pageID} selected="selected"{/if}>{if $pageNode->getDepth() > 1}{@" "|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->getPage()->name}</option>
{/foreach}
</select>
{if $errorField == 'pageID'}
<fieldset>
<legend>{lang}wcf.global.form.data{/lang}</legend>
- <dl{if $errorField == 'displayName'} class="formError"{/if}>
- <dt><label for="displayName">{lang}wcf.global.name{/lang}</label></dt>
+ <dl{if $errorField == 'name'} class="formError"{/if}>
+ <dt><label for="name">{lang}wcf.global.name{/lang}</label></dt>
<dd>
- <input type="text" id="displayName" name="displayName" value="{$displayName}" required="required" autofocus="autofocus" class="long" />
- {if $errorField == 'displayName'}
+ <input type="text" id="name" name="name" value="{$name}" required="required" autofocus="autofocus" class="long" />
+ {if $errorField == 'name'}
<small class="innerError">
{if $errorType == 'empty'}
{lang}wcf.global.form.error.empty{/lang}
{else}
- {lang}wcf.acp.page.displayName.error.{@$errorType}{/lang}
+ {lang}wcf.acp.page.name.error.{@$errorType}{/lang}
{/if}
</small>
{/if}
<option value="0">{lang}wcf.acp.page.parentPageID.noParentPage{/lang}</option>
{foreach from=$pageNodeList item=pageNode}
- <option value="{@$pageNode->getPage()->pageID}"{if $pageNode->getPage()->pageID == $parentPageID} selected="selected"{/if}>{if $pageNode->getDepth() > 1}{@" "|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->getPage()->displayName}</option>
+ <option value="{@$pageNode->getPage()->pageID}"{if $pageNode->getPage()->pageID == $parentPageID} selected="selected"{/if}>{if $pageNode->getDepth() > 1}{@" "|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->getPage()->name}</option>
{/foreach}
</select>
{if $errorField == 'parentPageID'}
<thead>
<tr>
<th class="columnPageID{if $sortField == 'pageID'} active {@$sortOrder}{/if}" colspan="2"><a href="{link controller='PageList'}pageNo={@$pageNo}&sortField=pageID&sortOrder={if $sortField == 'pageID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
- <th class="columnTitle columnName{if $sortField == 'displayName'} active {@$sortOrder}{/if}"><a href="{link controller='PageList'}pageNo={@$pageNo}&sortField=displayName&sortOrder={if $sortField == 'displayName' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.name{/lang}</a></th>
+ <th class="columnTitle columnName{if $sortField == 'name'} active {@$sortOrder}{/if}"><a href="{link controller='PageList'}pageNo={@$pageNo}&sortField=name&sortOrder={if $sortField == 'name' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.name{/lang}</a></th>
<th class="columnText columnCustomURL{if $sortField == 'customURL'} active {@$sortOrder}{/if}"><a href="{link controller='PageList'}pageNo={@$pageNo}&sortField=customURL&sortOrder={if $sortField == 'customURL' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.page.customURL{/lang}</a></th>
<th class="columnDate columnLastUpdateTime{if $sortField == 'lastUpdateTime'} active {@$sortOrder}{/if}"><a href="{link controller='PageList'}pageNo={@$pageNo}&sortField=lastUpdateTime&sortOrder={if $sortField == 'lastUpdateTime' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.page.lastUpdateTime{/lang}</a></th>
{event name='rowButtons'}
</td>
<td class="columnID columnPageID">{@$page->pageID}</td>
- <td class="columnTitle columnName"><a href="{link controller='PageEdit' id=$page->pageID}{/link}">{$page->displayName}</a></td>
+ <td class="columnTitle columnName"><a href="{link controller='PageEdit' id=$page->pageID}{/link}">{$page->name}</a></td>
<td class="columnText columnCustomURL">{$page->controllerCustomURL}</td>
<td class="columnDate columnLastUpdateTime">{@$page->lastUpdateTime|time}</td>
public $parentPageID = 0;
/**
- * page's display name
+ * page name
* @var string
*/
- public $displayName = '';
+ public $name = '';
/**
* true if page is disabled
parent::readFormParameters();
if (isset($_POST['parentPageID'])) $this->parentPageID = intval($_POST['parentPageID']);
- if (isset($_POST['displayName'])) $this->displayName = StringUtil::trim($_POST['displayName']);
+ if (isset($_POST['name'])) $this->name = StringUtil::trim($_POST['name']);
if (isset($_POST['isDisabled'])) $this->isDisabled = 1;
if (isset($_POST['isLandingPage'])) $this->isLandingPage = 1;
if (isset($_POST['packageID'])) $this->packageID = intval($_POST['packageID']);
public function validate() {
parent::validate();
- $this->validateDisplayName();
+ $this->validateName();
$this->validateParentPageID();
$this->validateCustomUrl();
}
- protected function validateDisplayName() {
- if (empty($this->displayName)) {
- throw new UserInputException('displayName');
+ protected function validateName() {
+ if (empty($this->name)) {
+ throw new UserInputException('name');
}
- if (Page::getPageByDisplayName($this->displayName)) {
- throw new UserInputException('displayName', 'notUnique');
+ if (Page::getPageByName($this->name)) {
+ throw new UserInputException('name', 'notUnique');
}
}
$this->objectAction = new PageAction([], 'create', ['data' => array_merge($this->additionalFields, [
'parentPageID' => ($this->parentPageID ?: null),
- 'displayName' => $this->displayName,
+ 'name' => $this->name,
'isDisabled' => ($this->isDisabled) ? 1 : 0,
'isLandingPage' => ($this->isLandingPage) ? 1 : 0,
'packageID' => ($this->packageID ?: null),
// reset variables
$this->parentPageID = $this->isDisabled = $this->isLandingPage = 0;
$this->packageID = 1;
- $this->displayName = '';
+ $this->name = '';
$this->customURL = $this->title = $this->content = $this->metaDescription = $this->metaKeywords = [];
}
WCF::getTPL()->assign([
'action' => 'add',
'parentPageID' => $this->parentPageID,
- 'displayName' => $this->displayName,
+ 'name' => $this->name,
'isDisabled' => $this->isDisabled,
'isLandingPage' => $this->isLandingPage,
'isMultilingual' => $this->isMultilingual,
/**
* @inheritDoc
*/
- protected function validateDisplayName() {
- if ($this->displayName != $this->page->displayName) {
- parent::validateDisplayName();
+ protected function validateName() {
+ if (mb_strtolower($this->name) != mb_strtolower($this->page->name)) {
+ parent::validateName();
}
}
if ($this->page->controller) {
$this->objectAction = new PageAction(array($this->page), 'update', array('data' => array_merge($this->additionalFields, array(
- 'displayName' => $this->displayName,
+ 'name' => $this->name,
'isDisabled' => ($this->isDisabled) ? 1 : 0,
'isLandingPage' => ($this->isLandingPage) ? 1 : 0,
'controllerCustomURL' => (!empty($_POST['customURL'][0]) ? $_POST['customURL'][0] : ''),
$this->objectAction = new PageAction(array($this->page), 'update', array('data' => array_merge($this->additionalFields, array(
'parentPageID' => ($this->parentPageID ?: null),
- 'displayName' => $this->displayName,
+ 'name' => $this->name,
'isDisabled' => ($this->isDisabled) ? 1 : 0,
'isLandingPage' => ($this->isLandingPage) ? 1 : 0,
'packageID' => ($this->packageID ?: null),
parent::readData();
if (empty($_POST)) {
- $this->displayName = $this->page->displayName;
+ $this->name = $this->page->name;
$this->parentPageID = $this->page->parentPageID;
$this->packageID = $this->page->packageID;
if ($this->page->isLandingPage) $this->isLandingPage = 1;
/**
* @see \wcf\page\SortablePage::$defaultSortField
*/
- public $defaultSortField = 'displayName';
+ public $defaultSortField = 'name';
/**
* @see \wcf\page\SortablePage::$validSortFields
*/
- public $validSortFields = array('pageID', 'displayName', 'customURL', 'lastUpdateTime');
+ public $validSortFields = array('pageID', 'name', 'customURL', 'lastUpdateTime');
}
}
/**
- * Returns the page with the given display name.
+ * Returns the page with the given name.
*
* @param string $name
* @return Page
*/
- public static function getPageByDisplayName($name) {
+ public static function getPageByName($name) {
$sql = "SELECT *
FROM wcf".WCF_N."_page
- WHERE displayName = ?";
+ WHERE name = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array($name));
$row = $statement->fetchArray();
// load pages
$pageList = new PageList();
- $pageList->sqlOrderBy = "page.displayName";
+ $pageList->sqlOrderBy = "page.name";
$pageList->readObjects();
foreach ($pageList as $page) {
pageID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
parentPageID INT(10),
identifier VARCHAR(255) NOT NULL,
- displayName VARCHAR(255) NOT NULL,
+ name VARCHAR(255) NOT NULL,
isDisabled TINYINT(1) NOT NULL DEFAULT 0,
isLandingPage TINYINT(1) NOT NULL DEFAULT 0,
isMultilingual TINYINT(1) NOT NULL DEFAULT 0,