Commit | Line | Data |
---|---|---|
a5a4f02d MW |
1 | <?php |
2 | namespace wcf\system\category; | |
3 | use wcf\system\WCF; | |
4 | ||
5 | /** | |
6 | * Category type implementation for article categories. | |
7 | * | |
8 | * @author Marcel Werk | |
c839bd49 | 9 | * @copyright 2001-2018 WoltLab GmbH |
a5a4f02d | 10 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
e71525e4 MW |
11 | * @package WoltLabSuite\Core\System\Category |
12 | * @since 3.0 | |
a5a4f02d MW |
13 | */ |
14 | class ArticleCategoryType extends AbstractCategoryType { | |
15 | /** | |
16 | * @inheritDoc | |
17 | */ | |
18 | protected $langVarPrefix = 'wcf.article.category'; | |
19 | ||
20 | /** | |
21 | * @inheritDoc | |
22 | */ | |
23 | protected $hasDescription = false; | |
24 | ||
e76b04cf AE |
25 | /** |
26 | * @inheritDoc | |
27 | */ | |
28 | protected $maximumNestingLevel = 2; | |
29 | ||
a5a4f02d MW |
30 | /** |
31 | * @inheritDoc | |
32 | */ | |
33 | protected $objectTypes = ['com.woltlab.wcf.acl' => 'com.woltlab.wcf.article.category']; | |
34 | ||
35 | /** @noinspection PhpMissingParentCallCommonInspection */ | |
36 | /** | |
37 | * @inheritDoc | |
38 | */ | |
39 | public function canAddCategory() { | |
40 | return $this->canEditCategory(); | |
41 | } | |
42 | ||
43 | /** @noinspection PhpMissingParentCallCommonInspection */ | |
44 | /** | |
45 | * @inheritDoc | |
46 | */ | |
47 | public function canDeleteCategory() { | |
48 | return $this->canEditCategory(); | |
49 | } | |
50 | ||
51 | /** @noinspection PhpMissingParentCallCommonInspection */ | |
52 | /** | |
53 | * @inheritDoc | |
54 | */ | |
55 | public function canEditCategory() { | |
56 | return WCF::getSession()->getPermission('admin.content.article.canManageCategory'); | |
57 | } | |
58 | } |