From: Matthias Schmidt Date: Sat, 13 Oct 2018 12:55:54 +0000 (+0200) Subject: Fix issues with user profile menu PIP GUI X-Git-Tag: 5.2.0_Alpha_1~651 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ee9baaa94c617ccc8aa0eaf42f4e7576f6e6850e;p=GitHub%2FWoltLab%2FWCF.git Fix issues with user profile menu PIP GUI See #2545 --- diff --git a/com.woltlab.wcf/tmp_userProfileMenu.xml b/com.woltlab.wcf/tmp_userProfileMenu.xml new file mode 100644 index 0000000000..c3afcbc9cf --- /dev/null +++ b/com.woltlab.wcf/tmp_userProfileMenu.xml @@ -0,0 +1,23 @@ + + + + + wcf\system\menu\user\profile\content\RecentActivityUserProfileMenuContent + 1 + + + wcf\system\menu\user\profile\content\CommentUserProfileMenuContent + 1 + module_user_profile_wall + + + wcf\system\menu\user\profile\content\LikesUserProfileMenuContent + module_like + 2 + + + wcf\system\menu\user\profile\content\AboutUserProfileMenuContent + 3 + + + diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php index 275a1f6d4d..f15da67517 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php @@ -115,16 +115,17 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall $dataContainer = $form->getNodeById('data'); $dataContainer->appendChildren([ - TextFormField::create('name') - ->label('wcf.acp.pip.userProfileMenu.name') - ->description('wcf.acp.pip.userProfileMenu.name.description') + TextFormField::create('menuItem') + ->objectProperty('name') + ->label('wcf.acp.pip.userProfileMenu.eventName') + ->description('wcf.acp.pip.userProfileMenu.eventName.description') ->required() ->addValidator(new FormFieldValidator('format', function(TextFormField $formField) { if (!preg_match('~^[a-z][A-z]+$~', $formField->getValue())) { $formField->addValidationError( new FormFieldValidationError( 'format', - 'wcf.acp.pip.userProfileMenu.name.error.format' + 'wcf.acp.pip.userProfileMenu.menuItem.error.format' ) ); } @@ -138,7 +139,7 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall $formField->addValidationError( new FormFieldValidationError( 'notUnique', - 'wcf.acp.pip.userProfileMenu.name.error.notUnique' + 'wcf.acp.pip.userProfileMenu.menuItem.error.notUnique' ) ); } @@ -219,8 +220,8 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall */ protected function setEntryListKeys(IDevtoolsPipEntryList $entryList) { $entryList->setKeys([ - 'name' => 'wcf.acp.pip.userProfileMenu.name', - 'className' => 'wcf.acp.pip.userProfileMenu.className' + 'menuItem' => 'wcf.acp.pip.userProfileMenu.menuItem', + 'className' => 'wcf.form.field.className' ]); } @@ -265,7 +266,7 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall $userProfileMenuItem = $document->createElement('userprofilemenuitem'); $userProfileMenuItem->setAttribute('name', $data['name']); - $userProfileMenuItem->appendChild($document->createElement('classname', $data['className'])); + $userProfileMenuItem->appendChild($document->createElement('classname', $data['classname'])); foreach (['options', 'permissions', 'showorder'] as $optionalElement) { if (!empty($data[$optionalElement])) {