From: Marcel Werk Date: Tue, 1 Dec 2015 11:54:50 +0000 (+0100) Subject: Renamed wcf1_page.displayName to name X-Git-Tag: 3.0.0_Beta_1~2030^2~222 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c8b05efe755a6ae9320ce7071d759e9e3164c772;p=GitHub%2FWoltLab%2FWCF.git Renamed wcf1_page.displayName to name --- diff --git a/wcfsetup/install/files/acp/templates/menuItemAdd.tpl b/wcfsetup/install/files/acp/templates/menuItemAdd.tpl index a27eb1e74d..28c2985118 100644 --- a/wcfsetup/install/files/acp/templates/menuItemAdd.tpl +++ b/wcfsetup/install/files/acp/templates/menuItemAdd.tpl @@ -109,7 +109,7 @@ {foreach from=$pageNodeList item=pageNode} - + {/foreach} {if $errorField == 'pageID'} diff --git a/wcfsetup/install/files/acp/templates/pageAdd.tpl b/wcfsetup/install/files/acp/templates/pageAdd.tpl index 001d3c1232..91ecc357ad 100644 --- a/wcfsetup/install/files/acp/templates/pageAdd.tpl +++ b/wcfsetup/install/files/acp/templates/pageAdd.tpl @@ -49,16 +49,16 @@
{lang}wcf.global.form.data{/lang} - -
+ +
- - {if $errorField == 'displayName'} + + {if $errorField == 'name'} {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} {/if} @@ -73,7 +73,7 @@ {foreach from=$pageNodeList item=pageNode} - + {/foreach} {if $errorField == 'parentPageID'} diff --git a/wcfsetup/install/files/acp/templates/pageList.tpl b/wcfsetup/install/files/acp/templates/pageList.tpl index 4c8851ec5c..81d1a9f1e8 100644 --- a/wcfsetup/install/files/acp/templates/pageList.tpl +++ b/wcfsetup/install/files/acp/templates/pageList.tpl @@ -36,7 +36,7 @@ {lang}wcf.global.objectID{/lang} - {lang}wcf.global.name{/lang} + {lang}wcf.global.name{/lang} {lang}wcf.acp.page.customURL{/lang} {lang}wcf.acp.page.lastUpdateTime{/lang} @@ -63,7 +63,7 @@ {event name='rowButtons'} {@$page->pageID} - {$page->displayName} + {$page->name} {$page->controllerCustomURL} {@$page->lastUpdateTime|time} diff --git a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php index 4ca26647fd..425d8a0469 100644 --- a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php @@ -47,10 +47,10 @@ class PageAddForm extends AbstractForm { public $parentPageID = 0; /** - * page's display name + * page name * @var string */ - public $displayName = ''; + public $name = ''; /** * true if page is disabled @@ -127,7 +127,7 @@ class PageAddForm extends AbstractForm { 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']); @@ -145,7 +145,7 @@ class PageAddForm extends AbstractForm { public function validate() { parent::validate(); - $this->validateDisplayName(); + $this->validateName(); $this->validateParentPageID(); @@ -154,12 +154,12 @@ class PageAddForm extends AbstractForm { $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'); } } @@ -216,7 +216,7 @@ class PageAddForm extends AbstractForm { $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), @@ -240,7 +240,7 @@ class PageAddForm extends AbstractForm { // 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 = []; } @@ -255,7 +255,7 @@ class PageAddForm extends AbstractForm { WCF::getTPL()->assign([ 'action' => 'add', 'parentPageID' => $this->parentPageID, - 'displayName' => $this->displayName, + 'name' => $this->name, 'isDisabled' => $this->isDisabled, 'isLandingPage' => $this->isLandingPage, 'isMultilingual' => $this->isMultilingual, diff --git a/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php b/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php index ada7d58624..57596ce863 100644 --- a/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php @@ -53,9 +53,9 @@ class PageEditForm extends PageAddForm { /** * @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(); } } @@ -88,7 +88,7 @@ class PageEditForm extends PageAddForm { 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] : ''), @@ -121,7 +121,7 @@ class PageEditForm extends PageAddForm { $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), @@ -145,7 +145,7 @@ class PageEditForm extends PageAddForm { 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; diff --git a/wcfsetup/install/files/lib/acp/page/PageListPage.class.php b/wcfsetup/install/files/lib/acp/page/PageListPage.class.php index e193b3e373..a67c846a1c 100644 --- a/wcfsetup/install/files/lib/acp/page/PageListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PageListPage.class.php @@ -31,10 +31,10 @@ class PageListPage extends SortablePage { /** * @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'); } diff --git a/wcfsetup/install/files/lib/data/page/Page.class.php b/wcfsetup/install/files/lib/data/page/Page.class.php index acb4cdb54e..62588921b9 100644 --- a/wcfsetup/install/files/lib/data/page/Page.class.php +++ b/wcfsetup/install/files/lib/data/page/Page.class.php @@ -76,15 +76,15 @@ class Page extends DatabaseObject { } /** - * 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(); diff --git a/wcfsetup/install/files/lib/data/page/PageNodeTree.class.php b/wcfsetup/install/files/lib/data/page/PageNodeTree.class.php index b45ed804c2..bbb6c99a1c 100644 --- a/wcfsetup/install/files/lib/data/page/PageNodeTree.class.php +++ b/wcfsetup/install/files/lib/data/page/PageNodeTree.class.php @@ -54,7 +54,7 @@ class PageNodeTree { // load pages $pageList = new PageList(); - $pageList->sqlOrderBy = "page.displayName"; + $pageList->sqlOrderBy = "page.name"; $pageList->readObjects(); foreach ($pageList as $page) { diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 15fead56ee..5dfc2ee4f5 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -824,7 +824,7 @@ CREATE TABLE wcf1_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,