ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDateTimeInputGUI Class Reference

This class represents a date/time property in a property form. More...

+ Inheritance diagram for ilDateTimeInputGUI:
+ Collaboration diagram for ilDateTimeInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setMode ($mode)
 Set Display Mode.
 getMode ()
 Get Display Mode.
 enableDateActivation ($a_title, $a_postvar, $a_checked=true)
 Enable date activation.
 getActivationPostVar ()
 Get activation post var.
 setDate (ilDateTime $a_date=NULL)
 set date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTime('2008-06-12 08:00:00',IL_CAL_DATETIME));
 getDate ()
 Get Date, yyyy-mm-dd.
 setShowTime ($a_showtime)
 Set Show Time Information.
 getShowTime ()
 Get Show Time Information.
 setShowEmpty ($a_empty)
 Set Show Empty Information.
 getShowEmpty ()
 Get Show Empty Information.
 setStartYear ($a_year)
 Set start year.
 getStartYear ()
 Get start year.
 setMinuteStepSize ($a_step_size)
 Set minute step size E.g 5 => The selection will only show 00,05,10...
 getMinuteStepSize ()
 Get minute step size.
 setShowSeconds ($a_showseconds)
 Set Show Seconds.
 getShowSeconds ()
 Get Show Seconds.
 setValueByArray ($a_values)
 Set value by array.
 checkInput ()
 Check input, strip slashes etc.
 render ()
 Insert property html.
 insert (&$a_tpl)
 Insert property html.
 getTableFilterHTML ()
 Get HTML for table filter.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 getPostValueForComparison ()
 parse post value to make it comparable
 getToolbarHTML ()
 Get HTML for toolbar.
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively
 checkSubItemsInput ()
 Check SubItems.
 getSubForm ()
 Get sub form html.
 getItemByPostVar ($a_post_var)
 Get item by post var.
- 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.
 hideSubForm ()
 Sub form hidden on init?
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders)
 getHiddenTitle ()
 Get hidden title.
 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)
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi.
 getMulti ()
 Get Multi.
 setMultiValues (array $a_values)
 Set multi values.
 getMultiValues ()
 Get multi values.
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g.

Data Fields

const MODE_SELECT = 1
const MODE_INPUT = 2

Protected Attributes

 $mode = null
 $date_obj = null
 $date
 $time = "00:00:00"
 $showtime = false
 $showseconds = false
 $minute_step_size = 1
 $show_empty = false
 $startyear = ''
 $activation_title = ''
 $activation_post_var = ''
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""
 $multi = false
 $multi_sortable = false
 $multi_addremove = true
 $multi_values

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.
 getMultiIconsHTML ()
 Get HTML for multiple value icons.

Detailed Description

This class represents a date/time 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 12 of file class.ilDateTimeInputGUI.php.

Constructor & Destructor Documentation

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

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

References setMode(), and ilFormPropertyGUI\setType().

{
parent::__construct($a_title, $a_postvar);
$this->setType("datetime");
$this->setMode(self::MODE_SELECT);
}

+ Here is the call graph for this function:

Member Function Documentation

ilDateTimeInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilBirthdayInputGUI.

Definition at line 267 of file class.ilDateTimeInputGUI.php.

References $_POST, $date, $ilUser, $lng, $time, ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, ilFormPropertyGUI\getDisabled(), getMode(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getShowSeconds(), getShowTime(), IL_CAL_FKT_DATE, IL_CAL_FKT_GETDATE, ilFormPropertyGUI\setAlert(), setDate(), ilUtil\stripSlashes(), and ilCalendarSettings\TIME_FORMAT_12.

{
global $ilUser, $lng;
if ($this->getDisabled())
{
return true;
}
$post = $_POST[$this->getPostVar()];
// empty date valid with input field
if(!$this->getRequired() && $this->getMode() == self::MODE_INPUT && $post["date"] == "")
{
return true;
}
if($this->getMode() == self::MODE_SELECT)
{
$post["date"]["y"] = ilUtil::stripSlashes($post["date"]["y"]);
$post["date"]["m"] = ilUtil::stripSlashes($post["date"]["m"]);
$post["date"]["d"] = ilUtil::stripSlashes($post["date"]["d"]);
$dt['year'] = (int) $post['date']['y'];
$dt['mon'] = (int) $post['date']['m'];
$dt['mday'] = (int) $post['date']['d'];
if($this->getShowTime())
{
$post["time"]["h"] = ilUtil::stripSlashes($post["time"]["h"]);
$post["time"]["m"] = ilUtil::stripSlashes($post["time"]["m"]);
$post["time"]["s"] = ilUtil::stripSlashes($post["time"]["s"]);
$dt['hours'] = (int) $post['time']['h'];
$dt['minutes'] = (int) $post['time']['m'];
$dt['seconds'] = (int) $post['time']['s'];
}
}
else
{
$post["date"] = ilUtil::stripSlashes($post["date"]);
$post["time"] = ilUtil::stripSlashes($post["time"]);
if($post["date"])
{
switch($ilUser->getDateFormat())
{
$date = explode(".", $post["date"]);
$dt['mday'] = (int)$date[0];
$dt['mon'] = (int)$date[1];
$dt['year'] = (int)$date[2];
break;
$date = explode("-", $post["date"]);
$dt['mday'] = (int)$date[2];
$dt['mon'] = (int)$date[1];
$dt['year'] = (int)$date[0];
break;
$date = explode("/", $post["date"]);
$dt['mday'] = (int)$date[1];
$dt['mon'] = (int)$date[0];
$dt['year'] = (int)$date[2];
break;
}
if($this->getShowTime())
{
if($ilUser->getTimeFormat() == ilCalendarSettings::TIME_FORMAT_12)
{
$seconds = "";
if($this->getShowSeconds())
{
$seconds = ":\s*([0-9]{1,2})\s*";
}
if(preg_match("/([0-9]{1,2})\s*:\s*([0-9]{1,2})\s*".$seconds."(am|pm)/", trim(strtolower($post["time"])), $matches))
{
$dt['hours'] = (int)$matches[1];
$dt['minutes'] = (int)$matches[2];
if($seconds)
{
$dt['seconds'] = (int)$time[2];
$ampm = $matches[4];
}
else
{
$dt['seconds'] = 0;
$ampm = $matches[3];
}
if($dt['hours'] == 12)
{
if($ampm == "am")
{
$dt['hours'] = 0;
}
}
else if($ampm == "pm")
{
$dt['hours'] += 12;
}
}
}
else
{
$time = explode(":", $post["time"]);
$dt['hours'] = (int)$time[0];
$dt['minutes'] = (int)$time[1];
$dt['seconds'] = (int)$time[2];
}
}
}
}
// very basic validation
if($dt['mday'] == 0 || $dt['mon'] == 0 || $dt['year'] == 0 || $dt['mday'] > 31 || $dt['mon'] > 12)
{
$dt = false;
}
else if($this->getShowTime() && ($dt['hours'] > 23 || $dt['minutes'] > 59 || $dt['seconds'] > 59))
{
$dt = false;
}
// #11847
if(!checkdate($dt['mon'], $dt['mday'], $dt['year']))
{
$this->invalid_input = $_POST[$this->getPostVar()]['date'];
$this->setAlert($lng->txt("exc_date_not_valid"));
$dt = false;
}
$date = new ilDateTime($dt, IL_CAL_FKT_GETDATE, $ilUser->getTimeZone());
$this->setDate($date);
// post values used to be overwritten anyways - cannot change behaviour
$_POST[$this->getPostVar()]['date'] = $date->get(IL_CAL_FKT_DATE, 'Y-m-d', $ilUser->getTimeZone());
$_POST[$this->getPostVar()]['time'] = $date->get(IL_CAL_FKT_DATE, 'H:i:s', $ilUser->getTimeZone());
return (bool)$dt;
}

+ Here is the call graph for this function:

ilDateTimeInputGUI::enableDateActivation (   $a_title,
  $a_postvar,
  $a_checked = true 
)

Enable date activation.

If chosen a checkbox will be shown that gives the possibility to en/disable the date selection.

public

Parameters
stringtext displayed after the checkbox
stringname of postvar
boolcheckbox checked

Definition at line 76 of file class.ilDateTimeInputGUI.php.

Referenced by ilObjSurveyGUI\initPropertiesForm().

{
$this->activation_title = $a_title;
$this->activation_post_var = $a_postvar;
$this->activation_checked = $a_checked;
}

+ Here is the caller graph for this function:

ilDateTimeInputGUI::getActivationPostVar ( )

Get activation post var.

public

Definition at line 89 of file class.ilDateTimeInputGUI.php.

References $activation_post_var.

Referenced by ilBirthdayInputGUI\render(), and render().

+ Here is the caller graph for this function:

ilDateTimeInputGUI::getDate ( )

Get Date, yyyy-mm-dd.

Returns
object Date, yyyy-mm-dd

Definition at line 115 of file class.ilDateTimeInputGUI.php.

References $date.

Referenced by ilBirthdayInputGUI\render(), render(), and serializeData().

{
return $this->date;
}

+ Here is the caller graph for this function:

ilDateTimeInputGUI::getMinuteStepSize ( )

Get minute step size.

public

Definition at line 199 of file class.ilDateTimeInputGUI.php.

References $minute_step_size.

Referenced by render().

+ Here is the caller graph for this function:

ilDateTimeInputGUI::getMode ( )

Get Display Mode.

Returns
int

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

References $mode.

Referenced by checkInput(), render(), and setValueByArray().

{
return $this->mode;
}

+ Here is the caller graph for this function:

ilDateTimeInputGUI::getPostValueForComparison ( )

parse post value to make it comparable

used by combination input gui

Definition at line 638 of file class.ilDateTimeInputGUI.php.

References $_POST, and ilFormPropertyGUI\getPostVar().

{
return trim($_POST[$this->getPostVar()]["date"]." ". $_POST[$this->getPostVar()]["time"]);
}

+ Here is the call graph for this function:

ilDateTimeInputGUI::getShowEmpty ( )

Get Show Empty Information.

Returns
boolean Show Empty Information

Definition at line 155 of file class.ilDateTimeInputGUI.php.

References $show_empty.

Referenced by ilBirthdayInputGUI\render(), and render().

{
}

+ Here is the caller graph for this function:

ilDateTimeInputGUI::getShowSeconds ( )

Get Show Seconds.

Returns
boolean Show Seconds

Definition at line 221 of file class.ilDateTimeInputGUI.php.

References $showseconds.

Referenced by checkInput(), and render().

{
}

+ Here is the caller graph for this function:

ilDateTimeInputGUI::getShowTime ( )

Get Show Time Information.

Returns
boolean Show Time Information

Definition at line 135 of file class.ilDateTimeInputGUI.php.

References $showtime.

Referenced by checkInput(), and render().

{
}

+ Here is the caller graph for this function:

ilDateTimeInputGUI::getStartYear ( )

Get start year.

Returns
integer Start year

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

References $startyear.

{
}
ilDateTimeInputGUI::getTableFilterHTML ( )

Get HTML for table filter.

Implements ilTableFilterItem.

Definition at line 606 of file class.ilDateTimeInputGUI.php.

References render().

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

+ Here is the call graph for this function:

ilDateTimeInputGUI::getToolbarHTML ( )

Get HTML for toolbar.

Implements ilToolbarItem.

Definition at line 646 of file class.ilDateTimeInputGUI.php.

References render().

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

+ Here is the call graph for this function:

ilDateTimeInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 594 of file class.ilDateTimeInputGUI.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:

ilDateTimeInputGUI::render ( )

Insert property html.

Reimplemented in ilBirthdayInputGUI.

Definition at line 413 of file class.ilDateTimeInputGUI.php.

References $ilUser, $lng, $tpl, ilCalendarUserSettings\_getInstance(), ilGlyphGUI\CALENDAR, ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, ilGlyphGUI\get(), getActivationPostVar(), getDate(), ilFormPropertyGUI\getDisabled(), getMinuteStepSize(), getMode(), ilFormPropertyGUI\getPostVar(), getShowEmpty(), getShowSeconds(), getShowTime(), IL_CAL_DATETIME, IL_CAL_FKT_GETDATE, IL_CAL_UNIX, ilCalendarUtil\initJSCalendar(), ilUtil\makeDateSelect(), ilUtil\makeTimeSelect(), MODE_SELECT, setDate(), and ilCalendarSettings\TIME_FORMAT_12.

Referenced by getTableFilterHTML(), getToolbarHTML(), and insert().

{
global $lng,$ilUser;
$tpl = new ilTemplate("tpl.prop_datetime.html", true, true, "Services/Form");
$lng->loadLanguageModule("jscalendar");
require_once("./Services/Calendar/classes/class.ilCalendarUtil.php");
if(strlen($this->getActivationPostVar()))
{
$tpl->setCurrentBlock('prop_date_activation');
$tpl->setVariable('CHECK_ENABLED_DATE',$this->getActivationPostVar());
$tpl->setVariable('TXT_DATE_ENABLED',$this->activation_title);
$tpl->setVariable('CHECKED_ENABLED',$this->activation_checked ? 'checked="checked"' : '');
$tpl->setVariable('CHECKED_DISABLED',$this->getDisabled() ? 'disabled="disabled" ' : '');
$tpl->parseCurrentBlock();
}
if($this->getMode() == self::MODE_SELECT)
{
if(is_a($this->getDate(),'ilDate'))
{
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE,'','UTC');
}
elseif(is_a($this->getDate(),'ilDateTime'))
{
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE,'',$ilUser->getTimeZone());
}
else
{
$this->setDate(new ilDateTime(time(), IL_CAL_UNIX));
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE,'',$ilUser->getTimeZone());
}
// display invalid input again
if(is_array($this->invalid_input))
{
$date_info['year'] = $this->invalid_input['y'];
$date_info['mon'] = $this->invalid_input['m'];
$date_info['mday'] = $this->invalid_input['d'];
}
}
if($this->getMode() == self::MODE_SELECT)
{
$tpl->setCurrentBlock("prop_date_input_select_setup");
$tpl->setVariable("INPUT_FIELDS_DATE", $this->getPostVar()."[date]");
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("prop_date");
$tpl->setVariable("DATE_SELECT",
ilUtil::makeDateSelect($this->getPostVar()."[date]", $date_info['year'], $date_info['mon'], $date_info['mday'],
$this->startyear,true,array('disabled' => $this->getDisabled()), $this->getShowEmpty()));
}
else
{
$value = $this->getDate();
if($value)
{
$value = substr($this->getDate()->get(IL_CAL_DATETIME), 0, 10);
$day = substr($value, 8, 2);
$month = substr($value, 5, 2);
$year = substr($value, 0, 4);
}
switch($ilUser->getDateFormat())
{
if($value)
{
$value = date("d.m.Y", mktime(0, 0, 0, $month, $day, $year));
}
$format = "%d.%m.%Y";
$input_hint = $lng->txt("dd_mm_yyyy");
break;
if($value)
{
$value = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year));
}
$format = "%Y-%m-%d";
$input_hint = $lng->txt("yyyy_mm_dd");
break;
if($value)
{
$value = date("m/d/Y", mktime(0, 0, 0, $month, $day, $year));
}
$format = "%m/%d/%Y";
$input_hint = $lng->txt("mm_dd_yyyy");
break;
}
$tpl->setCurrentBlock("prop_date_input_field");
$tpl->setVariable("DATE_ID", $this->getPostVar());
$tpl->setVariable("DATE_VALUE", $value);
$tpl->setVariable("DISABLED", $this->getDisabled() ? " disabled=\"disabled\"" : "");
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("prop_date_input_field_info");
$tpl->setVariable("TXT_INPUT_FORMAT", $input_hint);
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("prop_date_input_field_setup");
$tpl->setVariable("DATE_ID", $this->getPostVar());
$tpl->setVariable("DATE_FIELD_FORMAT", $format);
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("prop_date");
include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
$tpl->setVariable("IMG_DATE_CALENDAR", ilGlyphGUI::get(ilGlyphGUI::CALENDAR, $lng->txt("open_calendar")));
$tpl->setVariable("DATE_ID", $this->getPostVar());
include_once './Services/Calendar/classes/class.ilCalendarUserSettings.php';
$tpl->setVariable('DATE_FIRST_DAY',ilCalendarUserSettings::_getInstance()->getWeekStart());
$tpl->parseCurrentBlock();
if($this->getShowTime())
{
if($this->getMode() == self::MODE_INPUT)
{
$value = $this->getDate();
if($value)
{
if(!$this->getShowSeconds())
{
$value = substr($value->get(IL_CAL_DATETIME), 11, 5);
if($ilUser->getTimeFormat() == ilCalendarSettings::TIME_FORMAT_12)
{
$value = date("g:ia", mktime(substr($value, 0, 2), substr($value, 3, 2)));
}
}
else
{
$value = substr($value->get(IL_CAL_DATETIME), 11, 8);
if($ilUser->getTimeFormat() == ilCalendarSettings::TIME_FORMAT_12)
{
$value = date("g:i:sa", mktime(substr($value, 0, 2), substr($value, 3, 2), substr($value, 6, 2)));
}
}
}
$tpl->setCurrentBlock("prop_time_input_field");
$tpl->setVariable("DATE_ID", $this->getPostVar());
$tpl->setVariable("TIME_VALUE", $value);
$tpl->setVariable("DISABLED", $this->getDisabled() ? " disabled=\"disabled\"" : "");
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("prop_time");
if($this->getMode() == self::MODE_SELECT)
{
$tpl->setVariable("TIME_SELECT",
ilUtil::makeTimeSelect($this->getPostVar()."[time]", !$this->getShowSeconds(),
$date_info['hours'], $date_info['minutes'], $date_info['seconds'],
true,array('minute_steps' => $this->getMinuteStepSize(),
'disabled' => $this->getDisabled())));
}
$tpl->setVariable("TXT_TIME", $this->getShowSeconds()
? "(".$lng->txt("hh_mm_ss").")"
: "(".$lng->txt("hh_mm").")");
$tpl->parseCurrentBlock();
}
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDateTimeInputGUI::serializeData ( )

serialize data

Reimplemented from ilFormPropertyGUI.

Definition at line 615 of file class.ilDateTimeInputGUI.php.

References getDate().

{
return serialize($this->getDate());
}

+ Here is the call graph for this function:

ilDateTimeInputGUI::setDate ( ilDateTime  $a_date = NULL)

set date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTime('2008-06-12 08:00:00',IL_CAL_DATETIME));

For fullday (no timezone conversion) events use:

            $dt_form->setDate(new ilDate('2008-08-01',IL_CAL_DATE));
Parameters
object$a_dateilDate or ilDateTime object

Definition at line 105 of file class.ilDateTimeInputGUI.php.

Referenced by ilObjRemoteCourseGUI\addCustomEditForm(), ilObjRemoteGroupGUI\addCustomEditForm(), ilObjRemoteTestGUI\addCustomEditForm(), arEditGUI\addDateTimeInputField(), ilBirthdayInputGUI\checkInput(), checkInput(), ilECSSettingsGUI\initCategoryMappingForm(), ilUserTableGUI\initFilter(), ilCalendarAppointmentGUI\initForm(), ilNewsForContextBlockGUI\initSettingsForm(), ilSessionStatisticsGUI\long(), ilSessionStatisticsGUI\periodic(), render(), ilBirthdayInputGUI\setValueByArray(), setValueByArray(), ilSessionStatisticsGUI\short(), and unserializeData().

{
$this->date = $a_date;
}

+ Here is the caller graph for this function:

ilDateTimeInputGUI::setMinuteStepSize (   $a_step_size)

Set minute step size E.g 5 => The selection will only show 00,05,10...

minutes

public

Parameters
intminute step_size 1,5,10,15,20...

Definition at line 188 of file class.ilDateTimeInputGUI.php.

{
$this->minute_step_size = $a_step_size;
}
ilDateTimeInputGUI::setMode (   $mode)

Set Display Mode.

Parameters
int$modeDisplay Mode

Definition at line 48 of file class.ilDateTimeInputGUI.php.

References $mode.

Referenced by __construct().

{
if(in_array($mode, array(self::MODE_INPUT, self::MODE_SELECT)))
{
$this->mode = $mode;
}
}

+ Here is the caller graph for this function:

ilDateTimeInputGUI::setShowEmpty (   $a_empty)

Set Show Empty Information.

Parameters
booleanShow Empty Information

Definition at line 145 of file class.ilDateTimeInputGUI.php.

{
$this->show_empty = $a_empty;
}
ilDateTimeInputGUI::setShowSeconds (   $a_showseconds)

Set Show Seconds.

Parameters
boolean$a_showsecondsShow Seconds

Definition at line 211 of file class.ilDateTimeInputGUI.php.

{
$this->showseconds = $a_showseconds;
}
ilDateTimeInputGUI::setStartYear (   $a_year)

Set start year.

Parameters
integerStart year

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

Referenced by ilDataCollectionDatatype\getInputField().

{
$this->startyear = $a_year;
}

+ Here is the caller graph for this function:

ilDateTimeInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Reimplemented in ilBirthdayInputGUI.

Definition at line 231 of file class.ilDateTimeInputGUI.php.

References $ilUser, getMode(), ilFormPropertyGUI\getPostVar(), ilSubEnabledFormPropertyGUI\getSubItems(), IL_CAL_DATE, IL_CAL_DATETIME, and setDate().

{
global $ilUser;
if($this->getMode() == self::MODE_INPUT &&
(!isset($a_values[$this->getPostVar()]["date"]) || $a_values[$this->getPostVar()]["date"] == ""))
{
$this->date = NULL;
}
else if(isset($a_values[$this->getPostVar()]["time"]))
{
$this->setDate(new ilDateTime($a_values[$this->getPostVar()]["date"].' '.$a_values[$this->getPostVar()]["time"],
IL_CAL_DATETIME,$ilUser->getTimeZone()));
}
else if (isset($a_values[$this->getPostVar()]["date"]))
{
$this->setDate(new ilDate($a_values[$this->getPostVar()]["date"],
}
if($this->activation_post_var)
{
$this->activation_checked = (bool)$a_values[$this->activation_post_var];
}
foreach($this->getSubItems() as $item)
{
$item->setValueByArray($a_values);
}
}

+ Here is the call graph for this function:

ilDateTimeInputGUI::unserializeData (   $a_data)

unserialize data

Reimplemented from ilFormPropertyGUI.

Definition at line 623 of file class.ilDateTimeInputGUI.php.

References setDate().

{
$data = unserialize($a_data);
if (is_object($data))
{
$this->setDate($data);
}
}

+ Here is the call graph for this function:

Field Documentation

ilDateTimeInputGUI::$activation_post_var = ''
protected

Definition at line 25 of file class.ilDateTimeInputGUI.php.

Referenced by getActivationPostVar().

ilDateTimeInputGUI::$activation_title = ''
protected

Definition at line 24 of file class.ilDateTimeInputGUI.php.

ilDateTimeInputGUI::$date
protected

Definition at line 16 of file class.ilDateTimeInputGUI.php.

Referenced by ilBirthdayInputGUI\checkInput(), checkInput(), and getDate().

ilDateTimeInputGUI::$date_obj = null
protected

Definition at line 15 of file class.ilDateTimeInputGUI.php.

ilDateTimeInputGUI::$minute_step_size = 1
protected

Definition at line 20 of file class.ilDateTimeInputGUI.php.

Referenced by getMinuteStepSize().

ilDateTimeInputGUI::$mode = null
protected

Definition at line 14 of file class.ilDateTimeInputGUI.php.

Referenced by getMode(), and setMode().

ilDateTimeInputGUI::$show_empty = false
protected

Definition at line 21 of file class.ilDateTimeInputGUI.php.

Referenced by getShowEmpty().

ilDateTimeInputGUI::$showseconds = false
protected

Definition at line 19 of file class.ilDateTimeInputGUI.php.

Referenced by getShowSeconds().

ilDateTimeInputGUI::$showtime = false
protected

Definition at line 18 of file class.ilDateTimeInputGUI.php.

Referenced by getShowTime().

ilDateTimeInputGUI::$startyear = ''
protected

Definition at line 22 of file class.ilDateTimeInputGUI.php.

Referenced by getStartYear().

ilDateTimeInputGUI::$time = "00:00:00"
protected

Definition at line 17 of file class.ilDateTimeInputGUI.php.

Referenced by checkInput().


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