Elgg  Version 3.0
Variables
time.php File Reference

Go to the source code of this file.

Variables

 $vars ['class'] = elgg_extract_class($vars, 'elgg-input-time')
 Elgg time input Displays a select field with time options. More...
 
 $defaults
 
 $timestamp = elgg_extract('timestamp', $vars)
 
 $format = elgg_extract('format', $vars, $defaults['format'], false)
 
 $min = (int) elgg_extract('min', $vars, 0)
 
 $max = (int) elgg_extract('max', $vars, 24 * 60 * 60)
 
 $step = (int) elgg_extract('step', $vars, 15 * 60)
 
 $value = elgg_extract('value', $vars)
 
 $value_time = ''
 
 $value_timestamp = ''
 
if($value) if($timestamp) else
 
 $hour_options = []
 
 $hour_options_ts = range($min, $max, $step)
 
 $dt = new DateTime(null, new DateTimeZone('UTC'))
 
foreach($hour_options_ts as $ts$vars ['options_values'] = $hour_options
 

Variable Documentation

$defaults
Initial value:
= [
'value' => ''

Definition at line 18 of file time.php.

$dt = new DateTime(null, new DateTimeZone('UTC'))

Definition at line 69 of file time.php.

$format = elgg_extract('format', $vars, $defaults['format'], false)

Definition at line 30 of file time.php.

$hour_options = []

Definition at line 66 of file time.php.

$hour_options_ts = range($min, $max, $step)

Definition at line 67 of file time.php.

$max = (int) elgg_extract('max', $vars, 24 * 60 * 60)

Definition at line 36 of file time.php.

$min = (int) elgg_extract('min', $vars, 0)

Definition at line 33 of file time.php.

$step = (int) elgg_extract('step', $vars, 15 * 60)

Definition at line 39 of file time.php.

$timestamp = elgg_extract('timestamp', $vars)

Definition at line 27 of file time.php.

$value = elgg_extract('value', $vars)

Definition at line 42 of file time.php.

$value_time = ''

Definition at line 43 of file time.php.

$value_timestamp = ''

Definition at line 44 of file time.php.

$vars = elgg_extract_class($vars, 'elgg-input-time')

Elgg time input Displays a select field with time options.

Unix timestamps are supported by setting the 'timestamp' parameter to true.

$vars['value'] The current value, if any (as a unix timestamp) $vars['class'] Additional CSS class $vars['timestamp'] Store as a Unix timestamp in seconds. Default = false $vars['format'] Date format, default g:ia (4:44pm) $vars['step'] Interval/step (in seconds) between available time options (e.g. 15*60 for 15min) $vars['min'] Min available time in seconds (e.g. 2*60*60 for 2am) $vars['max'] Max available time in seconds (e.g. 23*60*60 for 11pm)

Definition at line 16 of file time.php.

foreach ($hour_options_ts as $ts) $vars['options_values'] = $hour_options

Definition at line 77 of file time.php.

if ($value) if ($timestamp) else
Initial value:
{
$vars['value'] = $value_time
$vars['class']
Elgg time input Displays a select field with time options.
Definition: time.php:16
$value_time
Definition: time.php:43

Definition at line 62 of file time.php.