ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 26 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 43 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().

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

Member Function Documentation

◆ getHoursOfDay()

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

Definition at line 64 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().

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

◆ renderCell()

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

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

226  {
227  return "&nbsp;";
228  }

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 28 of file class.WeekGridGUI.php.

◆ $lng

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

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

◆ $seed

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

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

◆ $seed_str

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

Definition at line 31 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 36 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: