class SqlForm extends SqlForm (View source)

Methods

__construct(ConfigFile $cf, int|null $serverId = null)

No description

from  BaseForm
getConfigFile()

Returns ConfigFile associated with this instance

void
registerForm(string $formName, array $form, int|null $serverId = null)

Registers form in form manager

bool
process(bool $allowPartialSave = true, bool $checkFormSubmit = true)

Processes forms, returns true on successful save

string
getDisplay(bool $showButtons = true, string|null $formAction = null, array|null $hiddenFields = null)

Outputs HTML for forms

string
displayErrors()

Displays errors

void
fixErrors()

Reverts erroneous fields to their default values

bool
save(array $forms, bool $allowPartialSave = true)

Validates and saves form data to session

bool
hasErrors()

Tells whether form validation failed

string
getDocLink(string $path)

Returns link to documentation

static array
getForms()

No description

from  SqlForm
static array
getFields()

Returns list of fields used in the form.

from  BaseForm
static string
getName()

Returns name of the form

from  SqlForm

Details

final __construct(ConfigFile $cf, int|null $serverId = null)

No description

Parameters

ConfigFile $cf

Config file instance

int|null $serverId

0 if new server, validation; >= 1 if editing a server

ConfigFile getConfigFile()

Returns ConfigFile associated with this instance

Return Value

ConfigFile

void registerForm(string $formName, array $form, int|null $serverId = null)

Registers form in form manager

Parameters

string $formName

Form name

array $form

Form data

int|null $serverId

0 if new server, validation; >= 1 if editing a server

Return Value

void

bool process(bool $allowPartialSave = true, bool $checkFormSubmit = true)

Processes forms, returns true on successful save

Parameters

bool $allowPartialSave

allows for partial form saving on failed validation

bool $checkFormSubmit

whether check for $_POST['submit_save']

Return Value

bool

string getDisplay(bool $showButtons = true, string|null $formAction = null, array|null $hiddenFields = null)

Outputs HTML for forms

Parameters

bool $showButtons

whether show submit and reset button

string|null $formAction

action attribute for the form

array|null $hiddenFields

array of form hidden fields (key: field name)

Return Value

string

HTML for forms

string displayErrors()

Displays errors

Return Value

string

HTML for errors

void fixErrors()

Reverts erroneous fields to their default values

Return Value

void

bool save(array $forms, bool $allowPartialSave = true)

Validates and saves form data to session

Parameters

array $forms

List of form names.

bool $allowPartialSave

Allows for partial form saving on failed validation.

Return Value

bool

bool hasErrors()

Tells whether form validation failed

Return Value

bool

Returns link to documentation

Parameters

string $path

Path to documentation

Return Value

string

static array getForms()

No description

Return Value

array

static array getFields()

Returns list of fields used in the form.

Return Value

array

static string getName()

Returns name of the form

Return Value

string