ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules 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. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 render ()
 Insert property html. More...
 
- Public Member Functions inherited from ilDateTimeInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setMode ($mode)
 Set Display Mode. More...
 
 getMode ()
 Get Display Mode. More...
 
 enableDateActivation ($a_title, $a_postvar, $a_checked=true)
 Enable date activation. More...
 
 getActivationPostVar ()
 Get activation post var. More...
 
 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)); More...
 
 getDate ()
 Get Date, yyyy-mm-dd. More...
 
 setShowTime ($a_showtime)
 Set Show Time Information. More...
 
 getShowTime ()
 Get Show Time Information. More...
 
 setShowEmpty ($a_empty)
 Set Show Empty Information. More...
 
 getShowEmpty ()
 Get Show Empty Information. More...
 
 setStartYear ($a_year)
 Set start year. More...
 
 getStartYear ()
 Get start year. More...
 
 setMinuteStepSize ($a_step_size)
 Set minute step size E.g 5 => The selection will only show 00,05,10... More...
 
 getMinuteStepSize ()
 Get minute step size. More...
 
 setShowSeconds ($a_showseconds)
 Set Show Seconds. More...
 
 getShowSeconds ()
 Get Show Seconds. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 render ()
 Insert property html. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
 getTableFilterHTML ()
 Get HTML for table filter. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 getPostValueForComparison ()
 parse post value to make it comparable More...
 
 getToolbarHTML ()
 Get HTML for toolbar. More...
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 

Additional Inherited Members

- Data Fields inherited from ilDateTimeInputGUI
const MODE_SELECT = 1
 
const MODE_INPUT = 2
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 
- Protected Attributes inherited from ilDateTimeInputGUI
 $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
 

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$

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

Member Function Documentation

◆ checkInput()

ilBirthdayInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

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

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

57  {
58  global $lng,$ilUser;
59 
60  $ok = true;
61 
62  $_POST[$this->getPostVar()]["date"]["y"] =
63  ilUtil::stripSlashes($_POST[$this->getPostVar()]["date"]["y"]);
64  $_POST[$this->getPostVar()]["date"]["m"] =
65  ilUtil::stripSlashes($_POST[$this->getPostVar()]["date"]["m"]);
66  $_POST[$this->getPostVar()]["date"]["d"] =
67  ilUtil::stripSlashes($_POST[$this->getPostVar()]["date"]["d"]);
68  $_POST[$this->getPostVar()]["time"]["h"] =
69  ilUtil::stripSlashes($_POST[$this->getPostVar()]["time"]["h"]);
70  $_POST[$this->getPostVar()]["time"]["m"] =
71  ilUtil::stripSlashes($_POST[$this->getPostVar()]["time"]["m"]);
72  $_POST[$this->getPostVar()]["time"]["s"] =
73  ilUtil::stripSlashes($_POST[$this->getPostVar()]["time"]["s"]);
74 
75  // verify date
76 
77  $dt['year'] = (int) $_POST[$this->getPostVar()]['date']['y'];
78  $dt['mon'] = (int) $_POST[$this->getPostVar()]['date']['m'];
79  $dt['mday'] = (int) $_POST[$this->getPostVar()]['date']['d'];
80  $dt['hours'] = (int) $_POST[$this->getPostVar()]['time']['h'];
81  $dt['minutes'] = (int) $_POST[$this->getPostVar()]['time']['m'];
82  $dt['seconds'] = (int) $_POST[$this->getPostVar()]['time']['s'];
83  if ($dt['year'] == 0 && $dt['mon'] == 0 && $dt['mday'] == 0 && $this->getRequired())
84  {
85  $this->date = null;
86  $this->setAlert($lng->txt("msg_input_is_required"));
87  return false;
88  }
89  else if ($dt['year'] == 0 && $dt['mon'] == 0 && $dt['mday'] == 0)
90  {
91  $this->date = null;
92  $_POST[$this->getPostVar()]['date'] = ""; // #10413
93  }
94  else
95  {
96  if (!checkdate((int)$dt['mon'], (int)$dt['mday'], (int)$dt['year']))
97  {
98  $this->date = null;
99  $this->setAlert($lng->txt("exc_date_not_valid"));
100  return false;
101  }
102  $date = new ilDateTime($dt,IL_CAL_FKT_GETDATE,$ilUser->getTimeZone());
103  $_POST[$this->getPostVar()]['date'] = $date->get(IL_CAL_FKT_DATE,'Y-m-d',$ilUser->getTimeZone());
104  $this->setDate($date);
105  }
106  return true;
107  }
$_POST['username']
Definition: cron.php:12
getPostVar()
Get Post Variable.
setDate(ilDateTime $a_date=NULL)
set date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTim...
setAlert($a_alert)
Set Alert Text.
const IL_CAL_FKT_DATE
Date and time handling
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
const IL_CAL_FKT_GETDATE
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ render()

ilBirthdayInputGUI::render ( )

Insert property html.

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

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

114  {
115  global $lng,$ilUser;
116 
117  $tpl = new ilTemplate("tpl.prop_datetime.html", true, true, "Services/Form");
118  if (is_object($this->getDate()))
119  {
120  $date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE,'','UTC');
121  }
122  else
123  {
124  $date_info = array(
125  'year' => $_POST[$this->getPostVar()]['date']['y'],
126  'mon' => $_POST[$this->getPostVar()]['date']['m'],
127  'mday' => $_POST[$this->getPostVar()]['date']['d']
128  );
129  }
130 
131  $lng->loadLanguageModule("jscalendar");
132  require_once("./Services/Calendar/classes/class.ilCalendarUtil.php");
134 
135  if(strlen($this->getActivationPostVar()))
136  {
137  $tpl->setCurrentBlock('prop_date_activation');
138  $tpl->setVariable('CHECK_ENABLED_DATE',$this->getActivationPostVar());
139  $tpl->setVariable('TXT_DATE_ENABLED',$this->activation_title);
140  $tpl->setVariable('CHECKED_ENABLED',$this->activation_checked ? 'checked="checked"' : '');
141  $tpl->setVariable('CHECKED_DISABLED',$this->getDisabled() ? 'disabled="disabled" ' : '');
142  $tpl->parseCurrentBlock();
143  }
144 
145  $tpl->setCurrentBlock("prop_date");
146  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
147  $tpl->setVariable("IMG_DATE_CALENDAR", ilGlyphGUI::get(ilGlyphGUI::CALENDAR, $lng->txt("open_calendar")));
148  $tpl->setVariable("DATE_ID", $this->getPostVar());
149  $tpl->setVariable("INPUT_FIELDS_DATE", $this->getPostVar()."[date]");
150  include_once './Services/Calendar/classes/class.ilCalendarUserSettings.php';
151  $tpl->setVariable('DATE_FIRST_DAY',ilCalendarUserSettings::_getInstance()->getWeekStart());
152  $tpl->setVariable("DATE_SELECT",
153  ilUtil::makeDateSelect($this->getPostVar()."[date]", $date_info['year'], $date_info['mon'], $date_info['mday'],
154  $this->startyear,true,array('disabled' => $this->getDisabled()), $this->getShowEmpty()));
155  $tpl->parseCurrentBlock();
156 
157  return $tpl->get();
158  }
$_POST['username']
Definition: cron.php:12
getActivationPostVar()
Get activation post var.
getPostVar()
Get Post Variable.
getDate()
Get Date, yyyy-mm-dd.
static get($a_glyph, $a_text="")
Get glyph html.
global $tpl
Definition: ilias.php:8
static _getInstance()
get instance for logged in user
special template class to simplify handling of ITX/PEAR
static makeDateSelect($prefix, $year="", $month="", $day="", $startyear="", $a_long_month=true, $a_further_options=array(), $emptyoption=false)
Creates a combination of HTML selects for date inputs.
getShowEmpty()
Get Show Empty Information.
const IL_CAL_FKT_GETDATE
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
static initJSCalendar()
Init Javascript Calendar.
+ Here is the call graph for this function:

◆ setValueByArray()

ilBirthdayInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

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

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

21  {
22  if (isset($a_values[$this->getPostVar()]["date"]) && is_array($a_values[$this->getPostVar()]["date"]))
23  {
24  if (@checkdate($a_values[$this->getPostVar()]["date"]['m'], $a_values[$this->getPostVar()]["date"]['d'], $a_values[$this->getPostVar()]["date"]['y']))
25  {
26  parent::setValueByArray($a_values);
27  return;
28  }
29  }
30  elseif(is_array($a_values[$this->getPostVar()]) && isset($a_values[$this->getPostVar()]["date"]) && !is_array($a_values[$this->getPostVar()]["date"]))
31  {
32  $this->setDate(new ilDate($a_values[$this->getPostVar()]["date"], IL_CAL_DATE));
33  }
34  else
35  {
36  if (!is_array($a_values[$this->getPostVar()]) && strlen($a_values[$this->getPostVar()]))
37  {
38  $this->setDate(new ilDate($a_values[$this->getPostVar()], IL_CAL_DATE));
39  }
40  else
41  {
42  $this->date = null;
43  }
44  }
45  foreach($this->getSubItems() as $item)
46  {
47  $item->setValueByArray($a_values);
48  }
49  }
getPostVar()
Get Post Variable.
setDate(ilDateTime $a_date=NULL)
set date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTim...
Class for single dates.
const IL_CAL_DATE
+ Here is the call graph for this function:

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