ILIAS  Release_4_0_x_branch Revision 61816
 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.
- 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.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 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

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 insert().

{
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 insert().

{
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 insert().

{
}

+ 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 insert().

{
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 insert().

{
}

+ 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 insert().

{
}

+ 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 insert().

{
}

+ 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 insert().

{
}

+ 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 insert().

{
}

+ 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 insert().

{
}

+ Here is the caller graph for this function:

ilDurationInputGUI::insert ( $a_tpl)

Insert property html.

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

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

{
global $lng;
if($this->getShowMonths())
{
$a_tpl->setCurrentBlock("dur_months");
$a_tpl->setVariable("TXT_MONTHS", $lng->txt("form_months"));
$val = array();
for ($i=0; $i<=36; $i++)
{
$val[$i] = $i;
}
$a_tpl->setVariable("SELECT_MONTHS",
ilUtil::formSelect($this->getMonths(), $this->getPostVar()."[MM]",
$val, false, true));
$a_tpl->parseCurrentBlock();
}
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.

Parameters
int$a_daysDays

Definition at line 61 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.

Parameters
int$a_hoursHours

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

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

{
$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().

{
$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().

{
$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().

{
$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.

{
$this->showminutes = $a_showminutes;
}
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:

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: