ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilCalendarHeaderNavigationGUI Class Reference
+ Collaboration diagram for ilCalendarHeaderNavigationGUI:

Public Member Functions

 __construct ($cmdClass, ilDate $seed, $a_increment, $cmd='')
 Constructor. More...
 
 getHTML ()
 getHTML More...
 

Protected Member Functions

 incrementDate ($a_count)
 

Protected Attributes

 $cmdClass = null
 
 $cmd = null
 
 $seed = null
 
 $increment = ''
 
 $html
 
 $lng
 
 $tpl
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilCalendarHeaderNavigationGUI::__construct (   $cmdClass,
ilDate  $seed,
  $a_increment,
  $cmd = '' 
)

Constructor.

@access public

Parameters
objectilDate seed for navigation @parame string type MONTH WEEK DAY

Definition at line 55 of file class.ilCalendarHeaderNavigationGUI.php.

56 {
57 global $lng,$ilCtrl;
58
59 $this->lng = $lng;
60
61 $this->ctrl = $ilCtrl;
62 $this->cmdClass = $cmdClass;
63 $this->seed = clone $seed;
64 $this->increment = $a_increment;
65 $this->cmd = $cmd;
66 }
global $ilCtrl
Definition: ilias.php:18

References $cmd, $cmdClass, $ilCtrl, $lng, and $seed.

Member Function Documentation

◆ getHTML()

ilCalendarHeaderNavigationGUI::getHTML ( )

getHTML

@access public

Definition at line 74 of file class.ilCalendarHeaderNavigationGUI.php.

75 {
76 global $lng;
77
78 $this->tpl = new ilTemplate('tpl.navigation_header.html',true,true,'Services/Calendar');
79
80 $this->incrementDate(-2);
81 $num = 0;
82 do
83 {
84 switch($this->increment)
85 {
86 case ilDateTime::DAY:
87 $this->tpl->setVariable('NAV_NAME_'.++$num,ilCalendarUtil::_numericDayToString($this->seed->get(IL_CAL_FKT_DATE,'w')));
88 break;
89
91 $this->tpl->setVariable('NAV_NAME_'.++$num,$this->lng->txt('week').' '.$this->seed->get(IL_CAL_FKT_DATE,'W'));
92 break;
93
95 if($num == 2)
96 {
97 $this->tpl->setVariable('NAV_NAME_'.++$num,
98 $this->lng->txt('month_'.$this->seed->get(IL_CAL_FKT_DATE,'m').'_long').
99 ' '.$this->seed->get(IL_CAL_FKT_DATE,'Y'));
100 }
101 else
102 {
103 $this->tpl->setVariable('NAV_NAME_'.++$num,$this->lng->txt('month_'.$this->seed->get(IL_CAL_FKT_DATE,'m').'_long'));
104 }
105 break;
106 }
107 $this->ctrl->setParameterByClass(get_class($this->cmdClass),'seed',$this->seed->get(IL_CAL_DATE));
108 $this->tpl->setVariable('NAV_LINK_'.$num,$this->ctrl->getLinkTarget($this->cmdClass,$this->cmd));
109 // $this->ctrl->clearParametersByClass(get_class($this->cmdClass));
110 $this->ctrl->setParameterByClass(get_class($this->cmdClass),'seed','');
111
112 $this->incrementDate(1);
113
114 } while($num < 6);
115
116 // header
117 switch ($this->increment)
118 {
119 case ilDateTime::DAY:
120 $this->tpl->setVariable('TXT_SELECT_TITLE', $lng->txt("cal_day_selection"));
121 $this->tpl->setVariable('TXT_VIEW_HEAD', $lng->txt("cal_day_overview"));
122 break;
123
124 case ilDateTime::WEEK:
125 $this->tpl->setVariable('TXT_SELECT_TITLE', $lng->txt("cal_week_selection"));
126 $this->tpl->setVariable('TXT_VIEW_HEAD', $lng->txt("cal_week_overview"));
127 break;
128
130 $this->tpl->setVariable('TXT_SELECT_TITLE', $lng->txt("cal_month_selection"));
131 $this->tpl->setVariable('TXT_VIEW_HEAD', $lng->txt("cal_month_overview"));
132 break;
133 }
134 $this->tpl->setVariable('TXT_SELECTED', $lng->txt("stat_selected"));
135
136 return $this->tpl->get();
137 }
const IL_CAL_DATE
const IL_CAL_FKT_DATE
static _numericDayToString($a_day, $a_long=true)
get
special template class to simplify handling of ITX/PEAR

References $lng, ilCalendarUtil\_numericDayToString(), ilDateTime\DAY, IL_CAL_DATE, IL_CAL_FKT_DATE, incrementDate(), ilDateTime\MONTH, and ilDateTime\WEEK.

+ Here is the call graph for this function:

◆ incrementDate()

ilCalendarHeaderNavigationGUI::incrementDate (   $a_count)
protected

Definition at line 139 of file class.ilCalendarHeaderNavigationGUI.php.

140 {
141 switch($this->increment)
142 {
144
145 $day = $this->seed->get(IL_CAL_FKT_DATE,'j');
146 if($day > 28)
147 {
148 $this->seed->increment(IL_CAL_DAY, (31 - $day) * -1);
149 }
150 default:
151 $this->seed->increment($this->increment,$a_count);
152 break;
153 }
154 }
const IL_CAL_DAY

References IL_CAL_DAY, IL_CAL_FKT_DATE, and ilDateTime\MONTH.

Referenced by getHTML().

+ Here is the caller graph for this function:

Field Documentation

◆ $cmd

ilCalendarHeaderNavigationGUI::$cmd = null
protected

Definition at line 39 of file class.ilCalendarHeaderNavigationGUI.php.

Referenced by __construct().

◆ $cmdClass

ilCalendarHeaderNavigationGUI::$cmdClass = null
protected

Definition at line 38 of file class.ilCalendarHeaderNavigationGUI.php.

Referenced by __construct().

◆ $html

ilCalendarHeaderNavigationGUI::$html
protected

Definition at line 43 of file class.ilCalendarHeaderNavigationGUI.php.

◆ $increment

ilCalendarHeaderNavigationGUI::$increment = ''
protected

Definition at line 41 of file class.ilCalendarHeaderNavigationGUI.php.

◆ $lng

ilCalendarHeaderNavigationGUI::$lng
protected

Definition at line 44 of file class.ilCalendarHeaderNavigationGUI.php.

Referenced by __construct(), and getHTML().

◆ $seed

ilCalendarHeaderNavigationGUI::$seed = null
protected

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

Referenced by __construct().

◆ $tpl

ilCalendarHeaderNavigationGUI::$tpl
protected

Definition at line 45 of file class.ilCalendarHeaderNavigationGUI.php.


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