Backend\Modules\Users\Actions\Add::loadForm PHP Метод

loadForm() приватный Метод

Load the form
private loadForm ( )
    private function loadForm()
    {
        // create form
        $this->frm = new BackendForm('add');
        // get the groups
        $groups = BackendGroupsModel::getAll();
        // if there is only one group we can check it so the user isn't bothered with an error for not selecting one
        $checkedGroups = count($groups) == 1 ? $groups[0]['value'] : null;
        // create elements
        // profile
        $this->frm->addText('email', null, 255)->setAttribute('type', 'email');
        $this->frm->addPassword('password', null, 75, 'form-control passwordGenerator', 'form-control danger passwordGenerator')->setAttributes(array('autocomplete' => 'off'));
        $this->frm->addPassword('confirm_password', null, 75)->setAttributes(array('autocomplete' => 'off'));
        $this->frm->addText('name', null, 255);
        $this->frm->addText('surname', null, 255);
        $this->frm->addText('nickname', null, 24);
        $this->frm->addImage('avatar');
        $this->frm->addDropdown('interface_language', BL::getInterfaceLanguages(), $this->get('fork.settings')->get('Core', 'default_interface_language'));
        $this->frm->addDropdown('date_format', BackendUsersModel::getDateFormats(), BackendAuthentication::getUser()->getSetting('date_format'));
        $this->frm->addDropdown('time_format', BackendUsersModel::getTimeFormats(), BackendAuthentication::getUser()->getSetting('time_format'));
        $this->frm->addDropdown('number_format', BackendUsersModel::getNumberFormats(), BackendAuthentication::getUser()->getSetting('number_format', 'dot_nothing'));
        $this->frm->addDropdown('csv_split_character', BackendUsersModel::getCSVSplitCharacters());
        $this->frm->addDropdown('csv_line_ending', BackendUsersModel::getCSVLineEndings());
        // permissions
        $this->frm->addCheckbox('active', true);
        // @TODO remove this when the api is kicked out
        $this->frm->addCheckbox('api_access', false);
        $this->frm->addMultiCheckbox('groups', $groups, $checkedGroups);
    }