SettingsDialog
in package
Table of Contents
Properties
- $instructor_override : mixed
- $ready_override : mixed
- $container : mixed
Methods
- __construct() : mixed
- Construct us with with a container that has a settings trait and launch
- 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
- color() : mixed
- Handle a settings color box
- 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
- instructor() : mixed
- Check if the current user is an instructor
- isSettingsPost() : bool
- Check for incoming settings post data
- link() : mixed
- Emit a properly styled "settings" link
- number() : mixed
- Handle a settings number box
- ready() : mixed
- Check if we are ready to go
- select() : mixed
- Handle a settings selector box
- start() : mixed
- text() : mixed
- Handle a settings text box
- textarea() : mixed
- Handle a settings textarea box
Properties
$instructor_override
public
mixed
$instructor_override
= false
$ready_override
public
mixed
$ready_override
= false
$container
private
mixed
$container
Methods
__construct()
Construct us with with a container that has a settings trait and launch
public
__construct([mixed $container = false ]) : mixed
$settingsDialog = new SettingsDialog($LAUNCH->link);
Parameters
- $container : mixed = false
attr()
Return the attributes to add to a tag to connect to activate the settings modal
public
attr() : mixed
button()
Emit a properly styled "settings" button
public
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
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
checkbox(mixed $name[, mixed $title = false ]) : mixed
Parameters
- $name : mixed
- $title : mixed = false
color()
Handle a settings color box
public
color(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
done() : mixed
dueDate()
Emit the text and form fields to support due dates
public
dueDate() : mixed
end()
Finish the form output
public
end() : mixed
getDueDate()
Get the due data data in an object
public
getDueDate() : mixed
getDueDateDelta()
Show a due date delta in reasonable units
public
getDueDateDelta(mixed $time) : mixed
Parameters
- $time : mixed
handleSettingsPost()
Handle incoming settings post data
public
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 ( $settingsDialog->handleSettingsPost() ) {
header( 'Location: '.U::addSession('index.php?howdysuppress=1') ) ;
return;
}
instructor()
Check if the current user is an instructor
public
instructor() : mixed
isSettingsPost()
Check for incoming settings post data
public
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 ( $settingsDialog->isSettingsPost() ) {
// Do form validation if you like
$settingsDialog->handleSettingsPost();
header( 'Location: '.U::addSession('index.php?howdysuppress=1') ) ;
return;
}
link()
Emit a properly styled "settings" link
public
link([mixed $right = false ]) : mixed
This is just the link, using the pencil icon and label.
Parameters
- $right : mixed = false
number()
Handle a settings number box
public
number(mixed $name[, mixed $title = false ]) : mixed
Parameters
- $name : mixed
- $title : mixed = false
ready()
Check if we are ready to go
public
ready() : mixed
select()
Handle a settings selector box
public
select(mixed $name[, mixed $default = false ][, mixed $fields = false ]) : mixed
Parameters
- $name : mixed
- $default : mixed = false
- $fields : mixed = false
start()
public
start() : mixed
text()
Handle a settings text box
public
text(mixed $name[, mixed $title = false ]) : mixed
Parameters
- $name : mixed
- $title : mixed = false
textarea()
Handle a settings textarea box
public
textarea(mixed $name[, mixed $title = false ]) : mixed
Parameters
- $name : mixed
- $title : mixed = false