From 987c7f2f57771a511e6bea4b872a4699418e2ec1 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 27 Oct 2018 17:33:47 +0200 Subject: [PATCH] Add missing `page` for ad locations in object type PIP GUI See #2545 --- ...ectTypePackageInstallationPlugin.class.php | 28 +++++++++++++++++++ wcfsetup/install/lang/en.xml | 2 ++ 2 files changed, 30 insertions(+) diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php index debb0b571e..fb49904f7e 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php @@ -4,6 +4,8 @@ use wcf\data\object\type\definition\ObjectTypeDefinitionList; use wcf\data\object\type\ObjectTypeCache; use wcf\data\object\type\ObjectTypeEditor; use wcf\data\DatabaseObjectList; +use wcf\data\page\PageNode; +use wcf\data\page\PageNodeTree; use wcf\system\application\ApplicationHandler; use wcf\system\condition\AbstractIntegerCondition; use wcf\system\condition\UserGroupCondition; @@ -305,6 +307,32 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation // com.woltlab.wcf.adLocation $this->getObjectTypeDefinitionDataContainer($form, 'com.woltlab.wcf.adLocation') ->appendChildren([ + SingleSelectionFormField::create('adLocationPage') + ->objectProperty('page') + ->label('wcf.acp.pip.objectType.com.woltlab.wcf.adLocation.page') + ->description('wcf.acp.pip.objectType.com.woltlab.wcf.adLocation.page.description') + ->options(function() { + $options = [ + [ + 'depth' => 0, + 'label' => 'wcf.global.noSelection', + 'value' => '' + ] + ]; + + $pageNodeTree = new PageNodeTree(); + + /** @var PageNode $pageNode */ + foreach ($pageNodeTree->getNodeList() as $pageNode) { + $options[] = [ + 'depth' => $pageNode->getDepth() - 1, + 'label' => $pageNode->name, + 'value' => $pageNode->identifier + ]; + } + + return $options; + }, true), TextFormField::create('adLocationCategoryName') ->objectProperty('categoryname') ->label('wcf.acp.pip.objectType.com.woltlab.wcf.adLocation.categoryName') diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 8a46330609..da84969f4c 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1756,6 +1756,8 @@ If you have already bought the licenses for the listed apps, th {$invalidClass}{/implode}.]]> + + -- 2.20.1