From: Joshua Rüsweg Date: Sat, 1 Jul 2017 20:36:02 +0000 (+0200) Subject: Add trophy category management X-Git-Tag: 3.1.0_Alpha_1~309 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e539f186d54a0123017402a278c91dd4cf604556;p=GitHub%2FWoltLab%2FWCF.git Add trophy category management See #2315 --- diff --git a/com.woltlab.wcf/acpMenu.xml b/com.woltlab.wcf/acpMenu.xml index d5ce451e71..7e221ac89d 100644 --- a/com.woltlab.wcf/acpMenu.xml +++ b/com.woltlab.wcf/acpMenu.xml @@ -294,6 +294,26 @@ module_paid_subscription + + + + wcf.acp.menu.link.user + 7 + + + wcf\acp\page\TrophyCategoryListPage + wcf.acp.menu.link.trophy + admin.trophy.canManageTrophy + module_trophy + + + wcf\acp\form\TrophyCategoryAddForm + wcf.acp.menu.link.trophy.category.list + admin.trophy.canManageTrophy + module_trophy + fa-plus + + diff --git a/wcfsetup/install/files/lib/acp/form/TrophyCategoryAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TrophyCategoryAddForm.class.php new file mode 100644 index 0000000000..dc2c3134ed --- /dev/null +++ b/wcfsetup/install/files/lib/acp/form/TrophyCategoryAddForm.class.php @@ -0,0 +1,33 @@ + + * @package WoltLabSuite\Core\Acp\Form + * @since 3.1 + */ +class TrophyCategoryAddForm extends AbstractCategoryAddForm { + /** + * @inheritDoc + */ + public $activeMenuItem = 'wcf.acp.menu.link.trophy.category.add'; + + /** + * @inheritDoc + */ + public $objectTypeName = 'com.woltlab.wcf.trophy.category'; + + /** + * @inheritDoc + */ + public $neededModules = ['MODULE_TROPHY']; + + /** + * @inheritDoc + */ + public $neededPermissions = ['admin.trophy.canManageTrophy']; +} diff --git a/wcfsetup/install/files/lib/acp/form/TrophyCategoryEditForm.class.php b/wcfsetup/install/files/lib/acp/form/TrophyCategoryEditForm.class.php new file mode 100644 index 0000000000..1d59fbf3e9 --- /dev/null +++ b/wcfsetup/install/files/lib/acp/form/TrophyCategoryEditForm.class.php @@ -0,0 +1,33 @@ + + * @package WoltLabSuite\Core\Acp\Form + * @since 3.1 + */ +class TrophyCategoryEditForm extends AbstractCategoryEditForm { + /** + * @inheritDoc + */ + public $activeMenuItem = 'wcf.acp.menu.link.trophy'; + + /** + * @inheritDoc + */ + public $objectTypeName = 'com.woltlab.wcf.trophy.category'; + + /** + * @inheritDoc + */ + public $neededModules = ['MODULE_TROPHY']; + + /** + * @inheritDoc + */ + public $neededPermissions = ['admin.trophy.canManageTrophy']; +} diff --git a/wcfsetup/install/files/lib/acp/page/TrophyCategoryListPage.class.php b/wcfsetup/install/files/lib/acp/page/TrophyCategoryListPage.class.php new file mode 100644 index 0000000000..5fd0b2670b --- /dev/null +++ b/wcfsetup/install/files/lib/acp/page/TrophyCategoryListPage.class.php @@ -0,0 +1,33 @@ + + * @package WoltLabSuite\Core\Acp\Form + * @since 3.1 + */ +class TrophyCategoryListPage extends AbstractCategoryListPage { + /** + * @inheritDoc + */ + public $activeMenuItem = 'wcf.acp.menu.link.trophy.category.list'; + + /** + * @inheritDoc + */ + public $objectTypeName = 'com.woltlab.wcf.trophy.category'; + + /** + * @inheritDoc + */ + public $neededModules = ['MODULE_TROPHY']; + + /** + * @inheritDoc + */ + public $neededPermissions = ['admin.trophy.canManageTrophy']; +} diff --git a/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php b/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php new file mode 100644 index 0000000000..6946941610 --- /dev/null +++ b/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php @@ -0,0 +1,48 @@ + + * @package WoltLabSuite\Core\System\Category + * @since 3.1 + */ +class TrophyCategoryType extends AbstractCategoryType { + /** + * @inheritDoc + */ + protected $langVarPrefix = 'wcf.trophy.category'; + + /** + * @inheritDoc + */ + protected $maximumNestingLevel = 0; + + /** @noinspection PhpMissingParentCallCommonInspection */ + /** + * @inheritDoc + */ + public function canAddCategory() { + return $this->canEditCategory(); + } + + /** @noinspection PhpMissingParentCallCommonInspection */ + /** + * @inheritDoc + */ + public function canDeleteCategory() { + return $this->canEditCategory(); + } + + /** @noinspection PhpMissingParentCallCommonInspection */ + /** + * @inheritDoc + */ + public function canEditCategory() { + return WCF::getSession()->getPermission('admin.trophy.canManageTrophy'); + } +} diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 1084eeb615..479de0d8fd 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -847,6 +847,9 @@ + + + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 1f39f93096..7f26692d27 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -830,6 +830,9 @@ + + +