Commit | Line | Data |
---|---|---|
0b4cca74 | 1 | <?php |
a9229942 | 2 | |
0b4cca74 | 3 | namespace wcf\acp\form; |
a9229942 | 4 | |
cc1801c3 AE |
5 | use wcf\data\contact\option\ContactOption; |
6 | use wcf\data\contact\option\ContactOptionAction; | |
7 | use wcf\data\contact\option\ContactOptionEditor; | |
3fb859c9 MW |
8 | use wcf\system\request\LinkHandler; |
9 | use wcf\system\WCF; | |
0b4cca74 AE |
10 | |
11 | /** | |
12 | * Shows the contact option add form. | |
a9229942 TD |
13 | * |
14 | * @author Alexander Ebert | |
15 | * @copyright 2001-2019 WoltLab GmbH | |
16 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> | |
0b4cca74 AE |
17 | * @since 3.1 |
18 | */ | |
a9229942 TD |
19 | class ContactOptionAddForm extends AbstractCustomOptionForm |
20 | { | |
21 | /** | |
22 | * @inheritDoc | |
23 | */ | |
24 | public $action = 'add'; | |
25 | ||
26 | /** | |
27 | * @inheritDoc | |
28 | */ | |
29 | public $activeMenuItem = 'wcf.acp.menu.link.contact.settings'; | |
30 | ||
31 | /** | |
32 | * @inheritDoc | |
33 | */ | |
34 | public $neededModules = ['MODULE_CONTACT_FORM']; | |
35 | ||
36 | /** | |
37 | * @inheritDoc | |
38 | */ | |
39 | public $neededPermissions = ['admin.contact.canManageContactForm']; | |
40 | ||
41 | /** | |
42 | * action class name | |
43 | * @var string | |
44 | */ | |
45 | public $actionClass = ContactOptionAction::class; | |
46 | ||
47 | /** | |
48 | * base class name | |
49 | * @var string | |
50 | */ | |
51 | public $baseClass = ContactOption::class; | |
52 | ||
53 | /** | |
54 | * editor class name | |
55 | * @var string | |
56 | */ | |
57 | public $editorClass = ContactOptionEditor::class; | |
58 | ||
59 | /** | |
60 | * @inheritDoc | |
61 | */ | |
62 | public function readParameters() | |
63 | { | |
64 | parent::readParameters(); | |
65 | ||
66 | $this->getI18nValue('optionTitle')->setLanguageItem('wcf.contact.option', 'wcf.contact', 'com.woltlab.wcf'); | |
67 | $this->getI18nValue('optionDescription')->setLanguageItem( | |
68 | 'wcf.contact.optionDescription', | |
69 | 'wcf.contact', | |
70 | 'com.woltlab.wcf' | |
71 | ); | |
72 | } | |
73 | ||
74 | /** | |
75 | * @inheritDoc | |
76 | */ | |
77 | public function save() | |
78 | { | |
79 | parent::save(); | |
80 | ||
81 | WCF::getTPL()->assign([ | |
82 | 'objectEditLink' => LinkHandler::getInstance()->getControllerLink( | |
83 | ContactOptionEditForm::class, | |
84 | ['id' => $this->objectAction->getReturnValues()['returnValues']->getObjectID()] | |
85 | ), | |
86 | ]); | |
87 | } | |
0b4cca74 | 88 | } |