Merge branch '3.0'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / category / ArticleCategoryType.class.php
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
9 * @copyright 2001-2018 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package WoltLabSuite\Core\System\Category
12 * @since 3.0
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
25 /**
26 * @inheritDoc
27 */
28 protected $maximumNestingLevel = 2;
29
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 }