SettingsForm
in package
Table of Contents
Methods
- attr() : mixed
- Return the attributes to add to a tag to connect to activate the settings modal
- button() : mixed
- Emit a properly styled "settings" button
- buttonText() : mixed
- Emit a properly styled "settings" button
- checkbox() : mixed
- Handle a settings checkbox
- done() : mixed
- Emit the text and form fields to support the done option
- dueDate() : mixed
- Emit the text and form fields to support due dates
- end() : mixed
- Finish the form output
- getDueDate() : mixed
- Get the due data data in an object
- getDueDateDelta() : mixed
- Show a due date delta in reasonable units
- handleSettingsPost() : bool
- Handle incoming settings post data
- isSettingsPost() : bool
- Check for incoming settings post data
- link() : mixed
- Emit a properly styled "settings" link
- note() : mixed
- Handle a settings note
- number() : mixed
- Handle a settings number box
- select() : mixed
- Handle a settings selector box
- start() : mixed
- text() : mixed
- Handle a settings text box
- textarea() : mixed
- Handle a settings textarea box
Methods
attr()
Return the attributes to add to a tag to connect to activate the settings modal
public
static attr() : mixed
button()
Emit a properly styled "settings" button
public
static button([mixed $right = false ]) : mixed
This is just the button, using the pencil icon. Wrap in a span or div tag if you want to move it around
Parameters
- $right : mixed = false
buttonText()
Emit a properly styled "settings" button
public
static buttonText([mixed $right = false ]) : mixed
This is just the button, using the pencil icon. Wrap in a span or div tag if you want to move it around
Parameters
- $right : mixed = false
checkbox()
Handle a settings checkbox
public
static checkbox(mixed $name[, mixed $title = false ]) : mixed
Parameters
- $name : mixed
- $title : mixed = false
done()
Emit the text and form fields to support the done option
public
static done() : mixed
dueDate()
Emit the text and form fields to support due dates
public
static dueDate() : mixed
end()
Finish the form output
public
static end([mixed $ajax = false ]) : mixed
Parameters
- $ajax : mixed = false
getDueDate()
Get the due data data in an object
public
static getDueDate() : mixed
getDueDateDelta()
Show a due date delta in reasonable units
public
static getDueDateDelta(mixed $time) : mixed
Parameters
- $time : mixed
handleSettingsPost()
Handle incoming settings post data
public
static handleSettingsPost() : bool
Return values
bool —Returns true if there were settings to handle and false if there was nothing done. Generally the calling tool will redirect when true is returned.
if ( SettingsForm::handleSettingsPost() ) {
header( 'Location: '.U::addSession('index.php?howdysuppress=1') ) ;
return;
}
isSettingsPost()
Check for incoming settings post data
public
static isSettingsPost() : bool
Return values
bool —Returns true if there were settings to handle and false if there was nothing done. Generally the calling tool will redirect when true is returned.
if ( SettingsForm::isSettingsPost() ) {
// Do form validation if you like
SettingsForm::handleSettingsPost();
header( 'Location: '.U::addSession('index.php?howdysuppress=1') ) ;
return;
}
link()
Emit a properly styled "settings" link
public
static link([mixed $right = false ]) : mixed
This is just the link, using the pencil icon and label.
Parameters
- $right : mixed = false
note()
Handle a settings note
public
static note([mixed $title = false ]) : mixed
Parameters
- $title : mixed = false
number()
Handle a settings number box
public
static number(mixed $name[, mixed $title = false ]) : mixed
Parameters
- $name : mixed
- $title : mixed = false
select()
Handle a settings selector box
public
static select(string $name[, string $default = false ][, array<string|int, mixed> $fields = false ]) : mixed
Parameters
- $name : string
-
The name of the setting value
- $default : string = false
-
What to display as the first entry in the drop down
- $fields : array<string|int, mixed> = false
-
The options to provide for the user (required)
start()
public
static start([mixed $title = null ]) : mixed
Parameters
- $title : mixed = null
text()
Handle a settings text box
public
static text(mixed $name[, mixed $title = false ]) : mixed
Parameters
- $name : mixed
- $title : mixed = false
textarea()
Handle a settings textarea box
public
static textarea(mixed $name[, mixed $title = false ]) : mixed
Parameters
- $name : mixed
- $title : mixed = false