Commit | Line | Data |
---|---|---|
85e6151d | 1 | <?php |
2b4179e2 | 2 | |
85e6151d | 3 | namespace wcf\acp\form; |
2b4179e2 | 4 | |
85e6151d | 5 | use wcf\data\person\PersonAction; |
2b4179e2 MS |
6 | use wcf\form\AbstractFormBuilderForm; |
7 | use wcf\system\form\builder\container\FormContainer; | |
8 | use wcf\system\form\builder\field\TextFormField; | |
85e6151d MS |
9 | |
10 | /** | |
11 | * Shows the form to create a new person. | |
2b4179e2 MS |
12 | * |
13 | * @author Matthias Schmidt | |
14 | * @copyright 2001-2021 WoltLab GmbH | |
15 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> | |
16 | * @package WoltLabSuite\Core\Acp\Form | |
85e6151d | 17 | */ |
2b4179e2 MS |
18 | class PersonAddForm extends AbstractFormBuilderForm |
19 | { | |
20 | /** | |
21 | * @inheritDoc | |
22 | */ | |
23 | public $activeMenuItem = 'wcf.acp.menu.link.person.add'; | |
24 | ||
25 | /** | |
26 | * @inheritDoc | |
27 | */ | |
28 | public $formAction = 'create'; | |
29 | ||
30 | /** | |
31 | * @inheritDoc | |
32 | */ | |
33 | public $neededPermissions = ['admin.content.canManagePeople']; | |
34 | ||
35 | /** | |
36 | * @inheritDoc | |
37 | */ | |
38 | public $objectActionClass = PersonAction::class; | |
39 | ||
40 | /** | |
41 | * @inheritDoc | |
42 | */ | |
43 | public $objectEditLinkController = PersonEditForm::class; | |
44 | ||
45 | /** | |
46 | * @inheritDoc | |
47 | */ | |
a6f1280f | 48 | protected function createForm() |
2b4179e2 MS |
49 | { |
50 | parent::createForm(); | |
51 | ||
52 | $this->form->appendChild( | |
53 | FormContainer::create('data') | |
54 | ->label('wcf.global.form.data') | |
55 | ->appendChildren([ | |
56 | TextFormField::create('firstName') | |
57 | ->label('wcf.person.firstName') | |
58 | ->required() | |
59 | ->autoFocus() | |
60 | ->maximumLength(255), | |
61 | ||
62 | TextFormField::create('lastName') | |
63 | ->label('wcf.person.lastName') | |
64 | ->required() | |
65 | ->maximumLength(255), | |
66 | ]) | |
67 | ); | |
68 | } | |
85e6151d | 69 | } |