This class represents a duration (typical hh:mm:ss) property in a property form. More...
Inheritance diagram for ilDurationInputGUI:
Collaboration diagram for ilDurationInputGUI:Public Member Functions | |
| __construct ($a_title="", $a_postvar="") | |
| Constructor. | |
| setDays ($a_days) | |
| Set Days. | |
| getDays () | |
| Get Days. | |
| setHours ($a_hours) | |
| Set Hours. | |
| getHours () | |
| Get Hours. | |
| setMinutes ($a_minutes) | |
| Set Minutes. | |
| getMinutes () | |
| Get Minutes. | |
| setSeconds ($a_seconds) | |
| Set Seconds. | |
| getSeconds () | |
| Get Seconds. | |
| setShowDays ($a_showdays) | |
| Set Show Days. | |
| getShowDays () | |
| Get Show Days. | |
| setShowHours ($a_showhours) | |
| Set Show Hours. | |
| getShowHours () | |
| Get Show Hours. | |
| setShowMinutes ($a_showminutes) | |
| Set Show Minutes. | |
| getShowMinutes () | |
| Get Show Minutes. | |
| setShowSeconds ($a_showseconds) | |
| Set Show Seconds. | |
| getShowSeconds () | |
| Get Show Seconds. | |
| setValueByArray ($a_values) | |
| Set value by array. | |
| checkInput () | |
| Check input, strip slashes etc. | |
| insert (&$a_tpl) | |
| Insert property html. | |
Protected Attributes | |
| $days = 0 | |
| $hours = 0 | |
| $minutes = 0 | |
| $seconds = 0 | |
| $showdays = false | |
| $showhours = true | |
| $showminutes = true | |
| $showseconds = false | |
This class represents a duration (typical hh:mm:ss) property in a property form.
Definition at line 31 of file class.ilDurationInputGUI.php.
| ilDurationInputGUI::__construct | ( | $ | a_title = "", |
|
| $ | a_postvar = "" | |||
| ) |
Constructor.
| string | $a_title Title | |
| string | $a_postvar Post Variable |
Reimplemented from ilFormPropertyGUI.
Definition at line 48 of file class.ilDurationInputGUI.php.
References ilFormPropertyGUI::setType().
{
parent::__construct($a_title, $a_postvar);
$this->setType("duration");
}
Here is the call graph for this function:| ilDurationInputGUI::checkInput | ( | ) |
Check input, strip slashes etc.
set alert, if input is not ok.
Reimplemented from ilFormPropertyGUI.
Definition at line 232 of file class.ilDurationInputGUI.php.
References $lng, ilFormPropertyGUI::getPostVar(), and ilUtil::stripSlashes().
{
global $lng;
$_POST[$this->getPostVar()]["dd"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["dd"]);
$_POST[$this->getPostVar()]["hh"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["hh"]);
$_POST[$this->getPostVar()]["mm"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["mm"]);
$_POST[$this->getPostVar()]["ss"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["ss"]);
return true;
}
Here is the call graph for this function:| ilDurationInputGUI::getDays | ( | ) |
Get Days.
Definition at line 69 of file class.ilDurationInputGUI.php.
Referenced by insert().
{
return $this->days;
}
Here is the caller graph for this function:| ilDurationInputGUI::getHours | ( | ) |
Get Hours.
Definition at line 89 of file class.ilDurationInputGUI.php.
Referenced by insert().
{
return $this->hours;
}
Here is the caller graph for this function:| ilDurationInputGUI::getMinutes | ( | ) |
Get Minutes.
Definition at line 109 of file class.ilDurationInputGUI.php.
Referenced by insert().
{
return $this->minutes;
}
Here is the caller graph for this function:| ilDurationInputGUI::getSeconds | ( | ) |
Get Seconds.
Definition at line 129 of file class.ilDurationInputGUI.php.
Referenced by insert().
{
return $this->seconds;
}
Here is the caller graph for this function:| ilDurationInputGUI::getShowDays | ( | ) |
Get Show Days.
Definition at line 149 of file class.ilDurationInputGUI.php.
Referenced by insert().
{
return $this->showdays;
}
Here is the caller graph for this function:| ilDurationInputGUI::getShowHours | ( | ) |
Get Show Hours.
Definition at line 169 of file class.ilDurationInputGUI.php.
Referenced by insert().
{
return $this->showhours;
}
Here is the caller graph for this function:| ilDurationInputGUI::getShowMinutes | ( | ) |
Get Show Minutes.
Definition at line 189 of file class.ilDurationInputGUI.php.
Referenced by insert().
{
return $this->showminutes;
}
Here is the caller graph for this function:| ilDurationInputGUI::getShowSeconds | ( | ) |
Get Show Seconds.
Definition at line 209 of file class.ilDurationInputGUI.php.
Referenced by insert().
{
return $this->showseconds;
}
Here is the caller graph for this function:| ilDurationInputGUI::insert | ( | &$ | a_tpl | ) |
Insert property html.
Definition at line 252 of file class.ilDurationInputGUI.php.
References $lng, ilUtil::formSelect(), getDays(), getHours(), getMinutes(), ilFormPropertyGUI::getPostVar(), getSeconds(), getShowDays(), getShowHours(), getShowMinutes(), and getShowSeconds().
{
global $lng;
if ($this->getShowDays())
{
$a_tpl->setCurrentBlock("dur_days");
$a_tpl->setVariable("TXT_DAYS", $lng->txt("form_days"));
$val = array();
for ($i=0; $i<=366; $i++)
{
$val[$i] = $i;
}
$a_tpl->setVariable("SELECT_DAYS",
ilUtil::formSelect($this->getDays(), $this->getPostVar()."[dd]",
$val, false, true));
$a_tpl->parseCurrentBlock();
}
if ($this->getShowHours())
{
$a_tpl->setCurrentBlock("dur_hours");
$a_tpl->setVariable("TXT_HOURS", $lng->txt("form_hours"));
$val = array();
for ($i=0; $i<=23; $i++)
{
$val[$i] = $i;
}
$a_tpl->setVariable("SELECT_HOURS",
ilUtil::formSelect($this->getHours(), $this->getPostVar()."[hh]",
$val, false, true));
$a_tpl->parseCurrentBlock();
}
if ($this->getShowMinutes())
{
$a_tpl->setCurrentBlock("dur_minutes");
$a_tpl->setVariable("TXT_MINUTES", $lng->txt("form_minutes"));
$val = array();
for ($i=0; $i<=59; $i++)
{
$val[$i] = $i;
}
$a_tpl->setVariable("SELECT_MINUTES",
ilUtil::formSelect($this->getMinutes(), $this->getPostVar()."[mm]",
$val, false, true));
$a_tpl->parseCurrentBlock();
}
if ($this->getShowSeconds())
{
$a_tpl->setCurrentBlock("dur_seconds");
$a_tpl->setVariable("TXT_SECONDS", $lng->txt("form_seconds"));
$val = array();
for ($i=0; $i<=59; $i++)
{
$val[$i] = $i;
}
$a_tpl->setVariable("SELECT_SECONDS",
ilUtil::formSelect($this->getSeconds(), $this->getPostVar()."[ss]",
$val, false, true));
$a_tpl->parseCurrentBlock();
}
$a_tpl->setCurrentBlock("prop_duration");
$a_tpl->parseCurrentBlock();
}
Here is the call graph for this function:| ilDurationInputGUI::setDays | ( | $ | a_days | ) |
Set Days.
| int | $a_days Days |
Definition at line 59 of file class.ilDurationInputGUI.php.
Referenced by setValueByArray().
{
$this->days = $a_days;
}
Here is the caller graph for this function:| ilDurationInputGUI::setHours | ( | $ | a_hours | ) |
Set Hours.
| int | $a_hours Hours |
Definition at line 79 of file class.ilDurationInputGUI.php.
Referenced by setValueByArray().
{
$this->hours = $a_hours;
}
Here is the caller graph for this function:| ilDurationInputGUI::setMinutes | ( | $ | a_minutes | ) |
Set Minutes.
| int | $a_minutes Minutes |
Definition at line 99 of file class.ilDurationInputGUI.php.
Referenced by setValueByArray().
{
$this->minutes = $a_minutes;
}
Here is the caller graph for this function:| ilDurationInputGUI::setSeconds | ( | $ | a_seconds | ) |
Set Seconds.
| int | $a_seconds Seconds |
Definition at line 119 of file class.ilDurationInputGUI.php.
Referenced by setValueByArray().
{
$this->seconds = $a_seconds;
}
Here is the caller graph for this function:| ilDurationInputGUI::setShowDays | ( | $ | a_showdays | ) |
Set Show Days.
| boolean | $a_showdays Show Days |
Definition at line 139 of file class.ilDurationInputGUI.php.
{
$this->showdays = $a_showdays;
}
| ilDurationInputGUI::setShowHours | ( | $ | a_showhours | ) |
Set Show Hours.
| boolean | $a_showhours Show Hours |
Definition at line 159 of file class.ilDurationInputGUI.php.
{
$this->showhours = $a_showhours;
}
| ilDurationInputGUI::setShowMinutes | ( | $ | a_showminutes | ) |
Set Show Minutes.
| boolean | $a_showminutes Show Minutes |
Definition at line 179 of file class.ilDurationInputGUI.php.
{
$this->showminutes = $a_showminutes;
}
| ilDurationInputGUI::setShowSeconds | ( | $ | a_showseconds | ) |
Set Show Seconds.
| boolean | $a_showseconds Show Seconds |
Definition at line 199 of file class.ilDurationInputGUI.php.
{
$this->showseconds = $a_showseconds;
}
| ilDurationInputGUI::setValueByArray | ( | $ | a_values | ) |
Set value by array.
| array | $a_values value array |
Definition at line 219 of file class.ilDurationInputGUI.php.
References ilFormPropertyGUI::getPostVar(), setDays(), setHours(), setMinutes(), and setSeconds().
{
$this->setDays($a_values[$this->getPostVar()]["dd"]);
$this->setHours($a_values[$this->getPostVar()]["hh"]);
$this->setMinutes($a_values[$this->getPostVar()]["mm"]);
$this->setSeconds($a_values[$this->getPostVar()]["ss"]);
}
Here is the call graph for this function:ilDurationInputGUI::$days = 0 [protected] |
Definition at line 33 of file class.ilDurationInputGUI.php.
ilDurationInputGUI::$hours = 0 [protected] |
Definition at line 34 of file class.ilDurationInputGUI.php.
ilDurationInputGUI::$minutes = 0 [protected] |
Definition at line 35 of file class.ilDurationInputGUI.php.
ilDurationInputGUI::$seconds = 0 [protected] |
Definition at line 36 of file class.ilDurationInputGUI.php.
ilDurationInputGUI::$showdays = false [protected] |
Definition at line 37 of file class.ilDurationInputGUI.php.
ilDurationInputGUI::$showhours = true [protected] |
Definition at line 38 of file class.ilDurationInputGUI.php.
ilDurationInputGUI::$showminutes = true [protected] |
Definition at line 39 of file class.ilDurationInputGUI.php.
ilDurationInputGUI::$showseconds = false [protected] |
Definition at line 40 of file class.ilDurationInputGUI.php.
1.7.1