Merge branch '3.0'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / category / SmileyCategoryType.class.php
1 <?php
2 namespace wcf\system\category;
3 use wcf\data\category\CategoryEditor;
4 use wcf\system\cache\builder\SmileyCacheBuilder;
5 use wcf\system\WCF;
6
7 /**
8 * Category implementation for smilies.
9 *
10 * @author Tim Duesterhus
11 * @copyright 2001-2018 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @package WoltLabSuite\Core\System\Category
14 */
15 class SmileyCategoryType extends AbstractCategoryType {
16 /**
17 * @inheritDoc
18 */
19 protected $langVarPrefix = 'wcf.acp.smiley.category';
20
21 /**
22 * @inheritDoc
23 */
24 protected $hasDescription = false;
25
26 /**
27 * @inheritDoc
28 */
29 protected $maximumNestingLevel = 0;
30
31 /**
32 * @inheritDoc
33 */
34 public function afterDeletion(CategoryEditor $categoryEditor) {
35 SmileyCacheBuilder::getInstance()->reset();
36 }
37
38 /**
39 * @inheritDoc
40 */
41 public function canAddCategory() {
42 return $this->canEditCategory();
43 }
44
45 /**
46 * @inheritDoc
47 */
48 public function canDeleteCategory() {
49 return $this->canEditCategory();
50 }
51
52 /**
53 * @inheritDoc
54 */
55 public function canEditCategory() {
56 return WCF::getSession()->getPermission('admin.content.smiley.canManageSmiley');
57 }
58 }