| Total Complexity | 3 | 
| Total Lines | 50 | 
| Duplicated Lines | 0 % | 
| Coverage | 0% | 
| Changes | 0 | ||
| 1 | <?php | ||
| 13 | class AdminForm extends Form | ||
| 14 | { | ||
| 15 | |||
| 16 | /** | ||
| 17 | * AdminForm constructor. | ||
| 18 | * @throws \PSFS\base\exception\GeneratorException | ||
| 19 | */ | ||
| 20 | public function __construct() | ||
| 21 |     { | ||
| 22 | parent::__construct(); | ||
| 23 |         $this->setAction(Router::getInstance()->getRoute('admin-setup')); | ||
| 24 |         $this->add('username', array( | ||
| 25 |             'label' => t('User Alias'), | ||
| 26 | 'autocomplete' => 'off', | ||
| 27 |         ))->add('password', array( | ||
| 28 | 'type' => 'password', | ||
| 29 |             'label' => t('Password'), | ||
| 30 | 'autocomplete' => 'off', | ||
| 31 |         ))->add('profile', array( | ||
| 32 | 'type' => 'select', | ||
| 33 |             'label' => t("Role"), | ||
| 34 |             'value' => sha1('superadmin'), | ||
| 35 | 'autocomplete' => 'off', | ||
| 36 | 'data' => Security::getProfiles(), | ||
| 37 | )); | ||
| 38 | //Apply styling to the form | ||
| 39 | $this->setAttrs(array( | ||
| 40 | "class" => "col-md-6", | ||
| 41 | "autocomplete" => "off", | ||
| 42 | )); | ||
| 43 | //Add action buttons to form | ||
| 44 |         $this->addButton('submit'); | ||
| 45 | } | ||
| 46 | |||
| 47 | /** | ||
| 48 | * Method that returns the form's title | ||
| 49 | * @return string | ||
| 50 | */ | ||
| 51 | public function getTitle() | ||
| 54 | } | ||
| 55 | |||
| 56 | /** | ||
| 57 | * Method that returns the form's name | ||
| 58 | * @return string | ||
| 59 | */ | ||
| 60 | public function getName() | ||
| 63 | } | ||
| 64 | |||
| 66 |