Renamed wcf1_page.displayName to name
authorMarcel Werk <burntime@woltlab.com>
Tue, 1 Dec 2015 11:54:50 +0000 (12:54 +0100)
committerMarcel Werk <burntime@woltlab.com>
Tue, 1 Dec 2015 11:54:50 +0000 (12:54 +0100)
wcfsetup/install/files/acp/templates/menuItemAdd.tpl
wcfsetup/install/files/acp/templates/pageAdd.tpl
wcfsetup/install/files/acp/templates/pageList.tpl
wcfsetup/install/files/lib/acp/form/PageAddForm.class.php
wcfsetup/install/files/lib/acp/form/PageEditForm.class.php
wcfsetup/install/files/lib/acp/page/PageListPage.class.php
wcfsetup/install/files/lib/data/page/Page.class.php
wcfsetup/install/files/lib/data/page/PageNodeTree.class.php
wcfsetup/setup/db/install.sql

index a27eb1e74da68a37072fe9b1a279359f895b64e9..28c298511849d90beddf5a9c56781aa46d8c9e06 100644 (file)
                                        <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}{@"&nbsp;&nbsp;&nbsp;&nbsp;"|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}{@"&nbsp;&nbsp;&nbsp;&nbsp;"|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->getPage()->name}</option>
                                        {/foreach}
                                </select>
                                {if $errorField == 'pageID'}
index 001d3c123215f71c334b2a51bbad97c4f6c9f941..91ecc357adae9230de7eb87113fcaa1d786c0d05 100644 (file)
                <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}
@@ -73,7 +73,7 @@
                                                        <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}{@"&nbsp;&nbsp;&nbsp;&nbsp;"|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}{@"&nbsp;&nbsp;&nbsp;&nbsp;"|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->getPage()->name}</option>
                                                        {/foreach}
                                                </select>
                                                {if $errorField == 'parentPageID'}
index 4c8851ec5c7f8b03014ec3f7a45024bdc9ae7299..81d1a9f1e82dfa009ac30b66245083d201f1bedf 100644 (file)
@@ -36,7 +36,7 @@
                        <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>
                                        
@@ -63,7 +63,7 @@
                                                        {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>
                                                
index 4ca26647fd11735092e6112d469916d048e2b9c1..425d8a0469dac81e3856cc896af75860f04ddaf7 100644 (file)
@@ -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,
index ada7d58624e3a3d1825f3d2a8e3ea1586f66df08..57596ce86399e33e49fe6020bc70c0fb9a8ceb48 100644 (file)
@@ -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;
index e193b3e373ca672bb8c08f208e5eafd1fffb28d5..a67c846a1c1db2a1f990225404334fe535966608 100644 (file)
@@ -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');
 }
index acb4cdb54ede532ec605cab733f38880efe75e60..62588921b90cf5562fd9a95d3c0f7aa6d7e3a6d4 100644 (file)
@@ -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();
index b45ed804c26bba0c4a848f3a97200e211bcf39be..bbb6c99a1ca96e97f9e91f61b3ffac33e5f8aac7 100644 (file)
@@ -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) {
index 15fead56ee6ffaa0f274b5a2b1abf0b08b58563b..5dfc2ee4f560c1aba2dcbf4d848305e9d2cd1309 100644 (file)
@@ -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,