ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilBirthdayInputGUI Class Reference

This class represents a text property in a property form. More...

+ Inheritance diagram for ilBirthdayInputGUI:
+ Collaboration diagram for ilBirthdayInputGUI:

Public Member Functions

 setValueByArray ($a_values)
 Set value by array.
 checkInput ()
 Check input, strip slashes etc.
 render ()
 Insert property html.
- Public Member Functions inherited from ilDateTimeInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor.
 enableDateActivation ($a_title, $a_postvar, $a_checked=true)
 Enable date activation.
 getActivationPostVar ()
 Get activation post var.
 setDate (ilDateTime $a_date)
 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.
 setShowDate ($a_showdate)
 Set Show Date Information.
 getShowDate ()
 Get Show Date Information.
 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.
 insert (&$a_tpl)
 Insert property html.
 getTableFilterHTML ()
 Get HTML for table filter.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 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)

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.
- Protected Attributes inherited from ilDateTimeInputGUI
 $date_obj = null
 $date
 $showdate = true
 $time = "00:00:00"
 $showtime = false
 $showseconds = false
 $minute_step_size = 1
 $show_empty = false
 $startyear = ''
 $activation_title = ''
 $activation_post_var = ''

Detailed Description

This class represents a text 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:
class.ilBirthdayInputGUI.php 22664 2010-01-10 15:49:40Z jgoedvad

Definition at line 13 of file class.ilBirthdayInputGUI.php.

Member Function Documentation

ilBirthdayInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilDateTimeInputGUI.

Definition at line 52 of file class.ilBirthdayInputGUI.php.

References $_POST, ilDateTimeInputGUI\$date, $lng, $ok, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), IL_CAL_FKT_DATE, IL_CAL_FKT_GETDATE, ilFormPropertyGUI\setAlert(), ilDateTimeInputGUI\setDate(), and ilUtil\stripSlashes().

{
global $lng,$ilUser;
$ok = true;
$_POST[$this->getPostVar()]["date"]["y"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["date"]["y"]);
$_POST[$this->getPostVar()]["date"]["m"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["date"]["m"]);
$_POST[$this->getPostVar()]["date"]["d"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["date"]["d"]);
$_POST[$this->getPostVar()]["time"]["h"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["time"]["h"]);
$_POST[$this->getPostVar()]["time"]["m"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["time"]["m"]);
$_POST[$this->getPostVar()]["time"]["s"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["time"]["s"]);
// verify date
$dt['year'] = (int) $_POST[$this->getPostVar()]['date']['y'];
$dt['mon'] = (int) $_POST[$this->getPostVar()]['date']['m'];
$dt['mday'] = (int) $_POST[$this->getPostVar()]['date']['d'];
$dt['hours'] = (int) $_POST[$this->getPostVar()]['time']['h'];
$dt['minutes'] = (int) $_POST[$this->getPostVar()]['time']['m'];
$dt['seconds'] = (int) $_POST[$this->getPostVar()]['time']['s'];
if ($dt['year'] == 0 && $dt['mon'] == 0 && $dt['mday'] == 0 && $this->getRequired())
{
$this->date = null;
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
else if ($dt['year'] == 0 && $dt['mon'] == 0 && $dt['mday'] == 0)
{
$this->date = null;
}
else
{
if (!checkdate((int)$dt['mon'], (int)$dt['mday'], (int)$dt['year']))
{
$this->date = null;
$this->setAlert($lng->txt("exc_date_not_valid"));
return false;
}
$date = new ilDateTime($dt,IL_CAL_FKT_GETDATE,$ilUser->getTimeZone());
$_POST[$this->getPostVar()]['date'] = $date->get(IL_CAL_FKT_DATE,'Y-m-d',$ilUser->getTimeZone());
$this->setDate($date);
}
return true;
}

+ Here is the call graph for this function:

ilBirthdayInputGUI::render ( )

Insert property html.

Reimplemented from ilDateTimeInputGUI.

Definition at line 108 of file class.ilBirthdayInputGUI.php.

References $_POST, $lng, $tpl, ilCalendarUserSettings\_getInstance(), ilDateTimeInputGUI\getActivationPostVar(), ilDateTimeInputGUI\getDate(), ilFormPropertyGUI\getDisabled(), ilUtil\getImagePath(), ilFormPropertyGUI\getPostVar(), ilDateTimeInputGUI\getShowDate(), ilDateTimeInputGUI\getShowEmpty(), IL_CAL_FKT_GETDATE, ilCalendarUtil\initJSCalendar(), and ilUtil\makeDateSelect().

{
global $lng,$ilUser;
$tpl = new ilTemplate("tpl.prop_datetime.html", true, true, "Services/Form");
if (is_object($this->getDate()))
{
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE,'','UTC');
}
else
{
$date_info = array(
'year' => $_POST[$this->getPostVar()]['date']['y'],
'mon' => $_POST[$this->getPostVar()]['date']['m'],
'mday' => $_POST[$this->getPostVar()]['date']['d']
);
}
$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->getShowDate())
{
$tpl->setCurrentBlock("prop_date");
$tpl->setVariable("IMG_DATE_CALENDAR", ilUtil::getImagePath("calendar.png"));
$tpl->setVariable("TXT_DATE_CALENDAR", $lng->txt("open_calendar"));
$tpl->setVariable("DATE_ID", $this->getPostVar());
$tpl->setVariable("INPUT_FIELDS_DATE", $this->getPostVar()."[date]");
include_once './Services/Calendar/classes/class.ilCalendarUserSettings.php';
$tpl->setVariable('DATE_FIRST_DAY',ilCalendarUserSettings::_getInstance()->getWeekStart());
$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()));
$tpl->parseCurrentBlock();
}
return $tpl->get();
}

+ Here is the call graph for this function:

ilBirthdayInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Reimplemented from ilDateTimeInputGUI.

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

References ilFormPropertyGUI\getPostVar(), ilSubEnabledFormPropertyGUI\getSubItems(), IL_CAL_DATE, and ilDateTimeInputGUI\setDate().

{
if (is_array($a_values[$this->getPostVar()]["date"]))
{
if (@checkdate($a_values[$this->getPostVar()]["date"]['m'], $a_values[$this->getPostVar()]["date"]['d'], $a_values[$this->getPostVar()]["date"]['y']))
{
return;
}
}
else
{
if (!is_array($a_values[$this->getPostVar()]) && strlen($a_values[$this->getPostVar()]))
{
$this->setDate(new ilDate($a_values[$this->getPostVar()], IL_CAL_DATE));
}
else
{
$this->date = null;
}
}
foreach($this->getSubItems() as $item)
{
$item->setValueByArray($a_values);
}
}

+ Here is the call graph for this function:


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