BaseForm
abstract class BaseForm extends FormDisplay (View source)
Base form for user preferences
Methods
Registers form in form manager
Processes forms, returns true on successful save
Outputs HTML for forms
Validates and saves form data to session
List of available forms, each form is described as an array of fields to display.
Returns list of fields used in the form.
Returns name of the form
Details
final
__construct(ConfigFile $cf, int|null $serverId = null)
No description
ConfigFile
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()
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'
static array
getFields()
Returns list of fields used in the form.
static string
getName()
Returns name of the form