ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDurationInputGUI Class Reference

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.
 setMonths ($a_months)
 set months
 getMonths ()
 get months
 getSeconds ()
 Get Seconds.
 setShowMonths ($a_show_months)
 Set show months.
 getShowMonths ()
 Get show months.
 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.
 render ()
 Insert property html.
 getTableFilterHTML ()
 Get HTML for table filter.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 getValueInSeconds ()
 Get combined value in seconds.
- Public Member Functions inherited from ilFormPropertyGUI
executeCommand ()
 Execute command.
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setPostVar ($a_postvar)
 Set Post Variable.
 getPostVar ()
 Get Post Variable.
 getFieldId ()
 Get Post Variable.
 setInfo ($a_info)
 Set Information Text.
 getInfo ()
 Get Information Text.
 setAlert ($a_alert)
 Set Alert Text.
 getAlert ()
 Get Alert Text.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required.
 setDisabled ($a_disabled)
 Set Disabled.
 getDisabled ()
 Get Disabled.
 setParentForm ($a_parentform)
 Set Parent Form.
 getParentForm ()
 Get Parent Form.
 setParent ($a_val)
 Set Parent GUI object.
 getParent ()
 Get Parent GUI object.
 getSubForm ()
 Get sub form html.
 hideSubForm ()
 Sub form hidden on init?
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders)
 getHiddenTitle ()
 Get hidden title.
 getItemByPostVar ($a_post_var)
 Get item by post var.
 writeToSession ()
 Write to session.
 clearFromSession ()
 Clear session value.
 readFromSession ()
 Read from session.
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties)

Protected Attributes

 $months = 0
 $days = 0
 $hours = 0
 $minutes = 0
 $seconds = 0
 $showmonths = false
 $showdays = false
 $showhours = true
 $showminutes = true
 $showseconds = false
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.

Detailed Description

This class represents a duration (typical hh:mm:ss) property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 31 of file class.ilDurationInputGUI.php.

Constructor & Destructor Documentation

ilDurationInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

Definition at line 50 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:

Member Function Documentation

ilDurationInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 279 of file class.ilDurationInputGUI.php.

References $_POST, $lng, ilFormPropertyGUI\getPostVar(), and ilUtil\stripSlashes().

{
global $lng;
$_POST[$this->getPostVar()]["MM"] =
$_POST[$this->getPostVar()]["dd"] =
$_POST[$this->getPostVar()]["hh"] =
$_POST[$this->getPostVar()]["mm"] =
$_POST[$this->getPostVar()]["ss"] =
return true;
}

+ Here is the call graph for this function:

ilDurationInputGUI::getDays ( )

Get Days.

Returns
int Days

Definition at line 71 of file class.ilDurationInputGUI.php.

References $days.

Referenced by getValueInSeconds(), render(), and serializeData().

{
return $this->days;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::getHours ( )

Get Hours.

Returns
int Hours

Definition at line 91 of file class.ilDurationInputGUI.php.

References $hours.

Referenced by getValueInSeconds(), render(), and serializeData().

{
return $this->hours;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::getMinutes ( )

Get Minutes.

Returns
int Minutes

Definition at line 111 of file class.ilDurationInputGUI.php.

References $minutes.

Referenced by getValueInSeconds(), render(), and serializeData().

{
}

+ Here is the caller graph for this function:

ilDurationInputGUI::getMonths ( )

get months

public

Definition at line 144 of file class.ilDurationInputGUI.php.

References $months.

Referenced by getValueInSeconds(), render(), and serializeData().

{
return $this->months;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::getSeconds ( )

Get Seconds.

Returns
int Seconds

Definition at line 154 of file class.ilDurationInputGUI.php.

References $seconds.

Referenced by getValueInSeconds(), render(), and serializeData().

{
}

+ Here is the caller graph for this function:

ilDurationInputGUI::getShowDays ( )

Get Show Days.

Returns
boolean Show Days

Definition at line 195 of file class.ilDurationInputGUI.php.

References $showdays.

Referenced by getValueInSeconds(), and render().

{
}

+ Here is the caller graph for this function:

ilDurationInputGUI::getShowHours ( )

Get Show Hours.

Returns
boolean Show Hours

Definition at line 215 of file class.ilDurationInputGUI.php.

References $showhours.

Referenced by getValueInSeconds(), and render().

{
}

+ Here is the caller graph for this function:

ilDurationInputGUI::getShowMinutes ( )

Get Show Minutes.

Returns
boolean Show Minutes

Definition at line 235 of file class.ilDurationInputGUI.php.

References $showminutes.

Referenced by getValueInSeconds(), and render().

{
}

+ Here is the caller graph for this function:

ilDurationInputGUI::getShowMonths ( )

Get show months.

public

Definition at line 175 of file class.ilDurationInputGUI.php.

References $showmonths.

Referenced by getValueInSeconds(), and render().

{
}

+ Here is the caller graph for this function:

ilDurationInputGUI::getShowSeconds ( )

Get Show Seconds.

Returns
boolean Show Seconds

Definition at line 255 of file class.ilDurationInputGUI.php.

References $showseconds.

Referenced by getValueInSeconds(), and render().

{
}

+ Here is the caller graph for this function:

ilDurationInputGUI::getTableFilterHTML ( )

Get HTML for table filter.

Definition at line 398 of file class.ilDurationInputGUI.php.

References render().

{
$html = $this->render();
return $html;
}

+ Here is the call graph for this function:

ilDurationInputGUI::getValueInSeconds ( )

Get combined value in seconds.

Returns
int

Definition at line 437 of file class.ilDurationInputGUI.php.

References getDays(), getHours(), getMinutes(), getMonths(), getSeconds(), getShowDays(), getShowHours(), getShowMinutes(), getShowMonths(), and getShowSeconds().

{
$value = 0;
if($this->getShowMonths())
{
$value += $this->getMonths()*30*24*60*60;
}
if($this->getShowDays())
{
$value += $this->getDays()*24*60*60;
}
if($this->getShowHours())
{
$value += $this->getHours()*60*60;
}
if($this->getShowMinutes())
{
$value += $this->getMinutes()*60;
}
if($this->getShowSeconds())
{
$value += $this->getSeconds();
}
return $value;
}

+ Here is the call graph for this function:

ilDurationInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 302 of file class.ilDurationInputGUI.php.

References render().

{
$html = $this->render();
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $html);
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilDurationInputGUI::render ( )

Insert property html.

Definition at line 315 of file class.ilDurationInputGUI.php.

References $lng, $tpl, ilUtil\formSelect(), getDays(), getHours(), getMinutes(), getMonths(), ilFormPropertyGUI\getPostVar(), getSeconds(), getShowDays(), getShowHours(), getShowMinutes(), getShowMonths(), and getShowSeconds().

Referenced by getTableFilterHTML(), and insert().

{
global $lng;
$tpl = new ilTemplate("tpl.prop_duration.html", true, true, "Services/Form");
if($this->getShowMonths())
{
$tpl->setCurrentBlock("dur_months");
$tpl->setVariable("TXT_MONTHS", $lng->txt("form_months"));
$val = array();
for ($i=0; $i<=36; $i++)
{
$val[$i] = $i;
}
$tpl->setVariable("SELECT_MONTHS",
ilUtil::formSelect($this->getMonths(), $this->getPostVar()."[MM]",
$val, false, true));
$tpl->parseCurrentBlock();
}
if ($this->getShowDays())
{
$tpl->setCurrentBlock("dur_days");
$tpl->setVariable("TXT_DAYS", $lng->txt("form_days"));
$val = array();
for ($i=0; $i<=366; $i++)
{
$val[$i] = $i;
}
$tpl->setVariable("SELECT_DAYS",
ilUtil::formSelect($this->getDays(), $this->getPostVar()."[dd]",
$val, false, true));
$tpl->parseCurrentBlock();
}
if ($this->getShowHours())
{
$tpl->setCurrentBlock("dur_hours");
$tpl->setVariable("TXT_HOURS", $lng->txt("form_hours"));
$val = array();
for ($i=0; $i<=23; $i++)
{
$val[$i] = $i;
}
$tpl->setVariable("SELECT_HOURS",
ilUtil::formSelect($this->getHours(), $this->getPostVar()."[hh]",
$val, false, true));
$tpl->parseCurrentBlock();
}
if ($this->getShowMinutes())
{
$tpl->setCurrentBlock("dur_minutes");
$tpl->setVariable("TXT_MINUTES", $lng->txt("form_minutes"));
$val = array();
for ($i=0; $i<=59; $i++)
{
$val[$i] = $i;
}
$tpl->setVariable("SELECT_MINUTES",
ilUtil::formSelect($this->getMinutes(), $this->getPostVar()."[mm]",
$val, false, true));
$tpl->parseCurrentBlock();
}
if ($this->getShowSeconds())
{
$tpl->setCurrentBlock("dur_seconds");
$tpl->setVariable("TXT_SECONDS", $lng->txt("form_seconds"));
$val = array();
for ($i=0; $i<=59; $i++)
{
$val[$i] = $i;
}
$tpl->setVariable("SELECT_SECONDS",
ilUtil::formSelect($this->getSeconds(), $this->getPostVar()."[ss]",
$val, false, true));
$tpl->parseCurrentBlock();
}
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDurationInputGUI::serializeData ( )

serialize data

Reimplemented from ilFormPropertyGUI.

Definition at line 407 of file class.ilDurationInputGUI.php.

References $data, getDays(), getHours(), getMinutes(), getMonths(), and getSeconds().

{
$data = array("months" => $this->getMonths(),
"days" => $this->getDays(),
"hours" => $this->getHours(),
"minutes" => $this->getMinutes(),
"seconds" => $this->getSeconds());
return serialize($data);
}

+ Here is the call graph for this function:

ilDurationInputGUI::setDays (   $a_days)

Set Days.

Parameters
int$a_daysDays

Definition at line 61 of file class.ilDurationInputGUI.php.

Referenced by setValueByArray(), and unserializeData().

{
$this->days = $a_days;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::setHours (   $a_hours)

Set Hours.

Parameters
int$a_hoursHours

Definition at line 81 of file class.ilDurationInputGUI.php.

Referenced by setValueByArray(), ilAdvancedMDRecordGUI\showECSStart(), and unserializeData().

{
$this->hours = $a_hours;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::setMinutes (   $a_minutes)

Set Minutes.

Parameters
int$a_minutesMinutes

Definition at line 101 of file class.ilDurationInputGUI.php.

Referenced by setValueByArray(), and unserializeData().

{
$this->minutes = $a_minutes;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::setMonths (   $a_months)

set months

public

Parameters
intmonths

Definition at line 133 of file class.ilDurationInputGUI.php.

Referenced by setValueByArray(), and unserializeData().

{
$this->months = $a_months;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::setSeconds (   $a_seconds)

Set Seconds.

Parameters
int$a_secondsSeconds

Definition at line 121 of file class.ilDurationInputGUI.php.

Referenced by setValueByArray(), and unserializeData().

{
$this->seconds = $a_seconds;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::setShowDays (   $a_showdays)

Set Show Days.

Parameters
boolean$a_showdaysShow Days

Definition at line 185 of file class.ilDurationInputGUI.php.

Referenced by ilECSSettingsGUI\initSettingsForm().

{
$this->showdays = $a_showdays;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::setShowHours (   $a_showhours)

Set Show Hours.

Parameters
boolean$a_showhoursShow Hours

Definition at line 205 of file class.ilDurationInputGUI.php.

Referenced by assQuestionGUI\addBasicQuestionFormProperties().

{
$this->showhours = $a_showhours;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::setShowMinutes (   $a_showminutes)

Set Show Minutes.

Parameters
boolean$a_showminutesShow Minutes

Definition at line 225 of file class.ilDurationInputGUI.php.

Referenced by ilConsultationHoursGUI\initFormSequence().

{
$this->showminutes = $a_showminutes;
}

+ Here is the caller graph for this function:

ilDurationInputGUI::setShowMonths (   $a_show_months)

Set show months.

public

Parameters
boolean$a_show_month

Definition at line 165 of file class.ilDurationInputGUI.php.

{
$this->showmonths = $a_show_months;
}
ilDurationInputGUI::setShowSeconds (   $a_showseconds)

Set Show Seconds.

Parameters
boolean$a_showsecondsShow Seconds

Definition at line 245 of file class.ilDurationInputGUI.php.

{
$this->showseconds = $a_showseconds;
}
ilDurationInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 265 of file class.ilDurationInputGUI.php.

References ilFormPropertyGUI\getPostVar(), setDays(), setHours(), setMinutes(), setMonths(), and setSeconds().

{
$this->setMonths($a_values[$this->getPostVar()]["MM"]);
$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::unserializeData (   $a_data)

unserialize data

Reimplemented from ilFormPropertyGUI.

Definition at line 421 of file class.ilDurationInputGUI.php.

References $data, setDays(), setHours(), setMinutes(), setMonths(), and setSeconds().

{
$data = unserialize($a_data);
$this->setMonths($data["months"]);
$this->setDays($data["days"]);
$this->setHours($data["hours"]);
$this->setMinutes($data["minutes"]);
$this->setSeconds($data["seconds"]);
}

+ Here is the call graph for this function:

Field Documentation

ilDurationInputGUI::$days = 0
protected

Definition at line 34 of file class.ilDurationInputGUI.php.

Referenced by getDays().

ilDurationInputGUI::$hours = 0
protected

Definition at line 35 of file class.ilDurationInputGUI.php.

Referenced by getHours().

ilDurationInputGUI::$minutes = 0
protected

Definition at line 36 of file class.ilDurationInputGUI.php.

Referenced by getMinutes().

ilDurationInputGUI::$months = 0
protected

Definition at line 33 of file class.ilDurationInputGUI.php.

Referenced by getMonths().

ilDurationInputGUI::$seconds = 0
protected

Definition at line 37 of file class.ilDurationInputGUI.php.

Referenced by getSeconds().

ilDurationInputGUI::$showdays = false
protected

Definition at line 39 of file class.ilDurationInputGUI.php.

Referenced by getShowDays().

ilDurationInputGUI::$showhours = true
protected

Definition at line 40 of file class.ilDurationInputGUI.php.

Referenced by getShowHours().

ilDurationInputGUI::$showminutes = true
protected

Definition at line 41 of file class.ilDurationInputGUI.php.

Referenced by getShowMinutes().

ilDurationInputGUI::$showmonths = false
protected

Definition at line 38 of file class.ilDurationInputGUI.php.

Referenced by getShowMonths().

ilDurationInputGUI::$showseconds = false
protected

Definition at line 42 of file class.ilDurationInputGUI.php.

Referenced by getShowSeconds().


The documentation for this class was generated from the following file: