class DbStructureForm extends BaseForm

Methods

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

No description

from BaseForm
getConfigFile()

Returns {@link ConfigFile} associated with this instance

void
registerForm(string $formName, array $form, int $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 $tabbedForm = false, bool $showRestoreDefault = false, bool $showButtons = true, string $formAction = null, array|null $hiddenFields = null)

Outputs HTML for forms

string|null
displayErrors()

Displays errors

void
fixErrors()

Reverts erroneous fields to their default values

bool
save(array|string $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()

List of available forms, each form is described as an array of fields to display.

static string[]
getFields()

Returns list of fields used in the form.

from BaseForm
static string
getName()

Returns name of the form

from BaseForm

Details

in BaseForm at line 22
__construct(ConfigFile $cf, int|null $serverId = null)

Parameters

ConfigFile $cf Config file instance
int|null $serverId 0 if new server, validation; >= 1 if editing a server

in FormDisplay at line 138
ConfigFile getConfigFile()

Returns {@link ConfigFile} associated with this instance

Return Value

ConfigFile

in FormDisplay at line 152
void registerForm(string $formName, array $form, int $serverId = null)

Registers form in form manager

Parameters

string $formName Form name
array $form Form data
int $serverId 0 if new server, validation; >= 1 if editing a server

Return Value

void

in FormDisplay at line 179
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 whether processing was successful

in FormDisplay at line 313
string getDisplay(bool $tabbedForm = false, bool $showRestoreDefault = false, bool $showButtons = true, string $formAction = null, array|null $hiddenFields = null)

Outputs HTML for forms

Parameters

bool $tabbedForm if true, use a form with tabs
bool $showRestoreDefault whether show "restore default" button besides the input field
bool $showButtons whether show submit and reset button
string $formAction action attribute for the form
array|null $hiddenFields array of form hidden fields (key: field name)

Return Value

string HTML for forms

in FormDisplay at line 542
string|null displayErrors()

Displays errors

Return Value

string|null HTML for errors

in FormDisplay at line 568
void fixErrors()

Reverts erroneous fields to their default values

Return Value

void

in FormDisplay at line 624
bool save(array|string $forms, bool $allowPartialSave = true)

Validates and saves form data to session

Parameters

array|string $forms array of form names
bool $allowPartialSave allows for partial form saving on failed validation

Return Value

bool true on success (no errors and all saved)

in FormDisplay at line 789
bool hasErrors()

Tells whether form validation failed

Return Value

bool

Returns link to documentation

Parameters

string $path Path to documentation

Return Value

string

at line 17
static array getForms()

List of available forms, each form is described as an array of fields to display.

Fields MUST have their counterparts in the $cfg array.

To define form field, use the notation below: $forms['Form group']['Form name'] = array('Option/path');

You can assign default values set by special button ("set value: ..."), eg.: 'Servers/1/pmadb' => 'phpmyadmin'

To group options, use: ':group:' . __('group name') // just define a group or 'option' => ':group' // group starting from this option End group blocks with: ':group:end'

Return Value

array

in BaseForm at line 61
static string[] getFields()

Returns list of fields used in the form.

Return Value

string[]

in BaseForm at line 79
static string getName()

Returns name of the form

Return Value

string