ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\BookingManager\BookingProcess\WeekGridGUI Class Reference
+ Collaboration diagram for ILIAS\BookingManager\BookingProcess\WeekGridGUI:

Public Member Functions

 __construct (array $entries=[], \ilDate $seed=null, int $day_start=8, int $day_end=19, int $time_format=\ilCalendarSettings::TIME_FORMAT_24, int $week_start=\ilCalendarSettings::WEEK_START_MONDAY)
 

Protected Member Functions

 getHoursOfDay ()
 
 renderCell (array $data)
 

Protected Attributes

string $form_action
 
int $week_start
 
ilDate $seed
 
string $seed_str
 
int $time_format
 
ilLanguage $lng
 
int $day_end
 
int $day_start
 
string $title
 
array $entries
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 23 of file class.WeekGridGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\BookingManager\BookingProcess\WeekGridGUI::__construct ( array  $entries = [],
\ilDate  $seed = null,
int  $day_start = 8,
int  $day_end = 19,
int  $time_format = \ilCalendarSettings::TIME_FORMAT_24,
int  $week_start = \ilCalendarSettings::WEEK_START_MONDAY 
)
Parameters
WeekGridEntry[]$entries
Exceptions

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

References ILIAS\BookingManager\BookingProcess\WeekGridGUI\$day_end, ILIAS\BookingManager\BookingProcess\WeekGridGUI\$day_start, $DIC, ILIAS\BookingManager\BookingProcess\WeekGridGUI\$entries, ILIAS\BookingManager\BookingProcess\WeekGridGUI\$time_format, ILIAS\BookingManager\BookingProcess\WeekGridGUI\$week_start, IL_CAL_UNIX, and ILIAS\Repository\lng().

47  {
48  global $DIC;
49 
50  $this->title = "Test";
51  $this->form_action = "#";
52  $this->lng = $DIC->language();
53  $this->day_start = $day_start;
54  $this->day_end = $day_end;
55  $this->time_format = $time_format;
56  $this->seed = $seed ?? new \ilDate(time(), IL_CAL_UNIX);
57  $this->week_start = $week_start;
58  $this->entries = $entries;
59  }
const IL_CAL_UNIX
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

Member Function Documentation

◆ getHoursOfDay()

ILIAS\BookingManager\BookingProcess\WeekGridGUI::getHoursOfDay ( )
protected

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

References $data, ILIAS\BookingManager\BookingProcess\WeekGridGUI\$day_end, ILIAS\BookingManager\BookingProcess\WeekGridGUI\$day_start, Vendor\Package\$e, ILIAS\BookingManager\BookingProcess\WeekGridGUI\$week_start, ilCalendarUtil\_buildWeekDayList(), ilCalendarUtil\_numericDayToString(), ilCalendarUtil\_numericMonthToString(), ilDatePresentation\formatDate(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_FKT_DATE, IL_CAL_FKT_GETDATE, IL_CAL_UNIX, and ILIAS\Repository\lng().

61  : array
62  {
63  $hours = array();
64  $sep = "<br>-<br>";
65  for ($i = $this->day_start;$i <= $this->day_end;$i++) {
66  $caption = "";
67  $start = sprintf('%02d:00', $i);
68  if ($this->day_start > 0 && $i === $this->day_start) {
69  $start = sprintf('%02d:00', 0);
70  $end = sprintf('%02d:00', $i + 1);
71  } else {
72  $end = sprintf('%02d:00', $i + 1);
73  }
74  if ($this->day_end < 23 && $i === $this->day_end) {
75  $end = sprintf('%02d:00', 23 + 1);
76  }
77  switch ($this->time_format) {
78  case \ilCalendarSettings::TIME_FORMAT_12:
79  if ($this->day_start > 0 && $i === $this->day_start) {
80  $caption = date('h a', mktime(0, 0, 0, 1, 1, 2000)) . $sep;
81  }
82  $caption .= date('h a', mktime($i, 0, 0, 1, 1, 2000));
83  if ($this->day_end < 23 && $i === $this->day_end) {
84  $caption .= $sep . date('h a', mktime(23, 0, 0, 1, 1, 2000));
85  }
86  break;
87 
88  default:
89  if ($this->day_start > 0 && $i === $this->day_start) {
90  $caption = sprintf('%02d:00', 0) . $sep;
91  }
92  $caption .= sprintf('%02d:00', $i);
93  if ($this->day_end < 23 && $i === $this->day_end) {
94  $caption .= $sep . sprintf('%02d:00', 23);
95  }
96  break;
97  }
98  $hours[$i] = [
99  "caption" => $caption,
100  "start" => $start,
101  "end" => $end
102  ];
103  }
104  return $hours;
105  }
+ Here is the call graph for this function:

◆ renderCell()

ILIAS\BookingManager\BookingProcess\WeekGridGUI::renderCell ( array  $data)
protected

Definition at line 222 of file class.WeekGridGUI.php.

223  {
224  return "&nbsp;";
225  }

Field Documentation

◆ $day_end

int ILIAS\BookingManager\BookingProcess\WeekGridGUI::$day_end
protected

◆ $day_start

int ILIAS\BookingManager\BookingProcess\WeekGridGUI::$day_start
protected

◆ $entries

array ILIAS\BookingManager\BookingProcess\WeekGridGUI::$entries
protected

◆ $form_action

string ILIAS\BookingManager\BookingProcess\WeekGridGUI::$form_action
protected

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

◆ $lng

ilLanguage ILIAS\BookingManager\BookingProcess\WeekGridGUI::$lng
protected

Definition at line 30 of file class.WeekGridGUI.php.

◆ $seed

ilDate ILIAS\BookingManager\BookingProcess\WeekGridGUI::$seed
protected

Definition at line 27 of file class.WeekGridGUI.php.

◆ $seed_str

string ILIAS\BookingManager\BookingProcess\WeekGridGUI::$seed_str
protected

Definition at line 28 of file class.WeekGridGUI.php.

◆ $time_format

int ILIAS\BookingManager\BookingProcess\WeekGridGUI::$time_format
protected

◆ $title

string ILIAS\BookingManager\BookingProcess\WeekGridGUI::$title
protected

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

◆ $week_start

int ILIAS\BookingManager\BookingProcess\WeekGridGUI::$week_start
protected

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