ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarMonthGUI Class Reference
+ Collaboration diagram for ilCalendarMonthGUI:

Public Member Functions

 __construct (ilDate $seed_date)
 Constructor.
 executeCommand ()
 Execute command.
 show ()
 fill data section

Protected Member Functions

 showEvents (ilDate $date)
 Show events.

Protected Attributes

 $num_appointments = 1
 $seed = null
 $user_settings = null
 $lng
 $ctrl
 $tabs_gui
 $tpl
 $timezone = 'UTC'

Detailed Description

Constructor & Destructor Documentation

ilCalendarMonthGUI::__construct ( ilDate  $seed_date)

Constructor.

public

Parameters

Definition at line 62 of file class.ilCalendarMonthGUI.php.

References $ilCtrl, $lng, $tpl, and ilCalendarUserSettings\_getInstanceByUserId().

{
global $ilCtrl, $lng, $ilUser,$ilTabs,$tpl;
$this->seed = $seed_date;
$this->tpl = $tpl;
$this->lng = $lng;
$this->ctrl = $ilCtrl;
$this->tabs_gui = $ilTabs;
$this->tabs_gui->setSubTabActive('app_month');
$this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
$this->app_colors = new ilCalendarAppointmentColors($ilUser->getId());
$this->timezone = $ilUser->getTimeZone();
}

+ Here is the call graph for this function:

Member Function Documentation

ilCalendarMonthGUI::executeCommand ( )

Execute command.

public

Definition at line 86 of file class.ilCalendarMonthGUI.php.

References $_GET, $_SESSION, $cmd, $ilCtrl, and $tpl.

{
global $ilCtrl,$tpl;
$next_class = $ilCtrl->getNextClass();
switch($next_class)
{
case 'ilcalendarappointmentgui':
$this->ctrl->setReturn($this,'');
$this->tabs_gui->setSubTabActive($_SESSION['cal_last_tab']);
include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
$app = new ilCalendarAppointmentGUI($this->seed,(int) $_GET['app_id']);
$this->ctrl->forwardCommand($app);
break;
default:
$time = microtime(true);
$cmd = $this->ctrl->getCmd("show");
$this->$cmd();
$tpl->setContent($this->tpl->get());
#echo "Zeit: ".(microtime(true) - $time);
break;
}
return true;
}
ilCalendarMonthGUI::show ( )

fill data section

public

Definition at line 120 of file class.ilCalendarMonthGUI.php.

References $tpl, ilDateTime\_before(), ilCalendarUtil\_buildMonthDayList(), ilDateTime\_equals(), ilCalendarUtil\_isToday(), ilCalendarUtil\_numericDayToString(), ilUtil\getImagePath(), IL_CAL_DATE, IL_CAL_DAY, IL_CAL_FKT_DATE, IL_CAL_MONTH, ilYuiUtil\initDragDrop(), ilYuiUtil\initPanel(), ilDateTime\MONTH, showEvents(), and ilCalendarSchedule\TYPE_MONTH.

{
global $tpl;
$this->tpl = new ilTemplate('tpl.month_view.html',true,true,'Services/Calendar');
include_once('./Services/YUI/classes/class.ilYuiUtil.php');
$navigation = new ilCalendarHeaderNavigationGUI($this,$this->seed,ilDateTime::MONTH);
$this->tpl->setVariable('NAVIGATION',$navigation->getHTML());
for($i = (int) $this->user_settings->getWeekStart();$i < (7 + (int) $this->user_settings->getWeekStart());$i++)
{
$this->tpl->setCurrentBlock('month_header_col');
$this->tpl->setVariable('TXT_WEEKDAY',ilCalendarUtil::_numericDayToString($i,true));
$this->tpl->parseCurrentBlock();
}
include_once('Services/Calendar/classes/class.ilCalendarSchedule.php');
$this->scheduler = new ilCalendarSchedule($this->seed,ilCalendarSchedule::TYPE_MONTH);
$this->scheduler->addSubitemCalendars(true);
$this->scheduler->calculate();
$counter = 0;
foreach(ilCalendarUtil::_buildMonthDayList($this->seed->get(IL_CAL_FKT_DATE,'m'),
$this->seed->get(IL_CAL_FKT_DATE,'Y'),
$this->user_settings->getWeekStart())->get() as $date)
{
$counter++;
$this->showEvents($date);
$this->tpl->setCurrentBlock('month_col');
include_once('./Services/Calendar/classes/class.ilCalendarUtil.php');
{
$this->tpl->setVariable('TD_CLASS','caltoday');
}
elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
{
$this->tpl->setVariable('TD_CLASS','calnow');
}
elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_MONTH))
{
$this->tpl->setVariable('TD_CLASS','calstd');
}
elseif(ilDateTime::_before($date,$this->seed,IL_CAL_MONTH))
{
$this->tpl->setVariable('TD_CLASS','calprev');
}
else
{
$this->tpl->setVariable('TD_CLASS','calnext');
}
$day = $date->get(IL_CAL_FKT_DATE,'j');
$month = $date->get(IL_CAL_FKT_DATE,'n');
if($day == 1)
{
$month_day = '1 '.ilCalendarUtil::_numericMonthToString($month,false);
}
else
{
$month_day = $day;
}
$this->ctrl->clearParametersByClass('ilcalendardaygui');
$this->ctrl->setParameterByClass('ilcalendardaygui','seed',$date->get(IL_CAL_DATE));
$this->tpl->setVariable('OPEN_DAY_VIEW',$this->ctrl->getLinkTargetByClass('ilcalendardaygui',''));
$this->ctrl->clearParametersByClass('ilcalendardaygui');
$this->tpl->setVariable('MONTH_DAY',$month_day);
#$this->tpl->setVariable('NEW_SRC',ilUtil::getImagePath('new.gif','calendar'));
$this->tpl->setVariable('NEW_SRC',ilUtil::getImagePath('date_add.gif'));
$this->tpl->setVariable('NEW_ALT',$this->lng->txt('cal_new_app'));
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$date->get(IL_CAL_DATE));
$this->tpl->setVariable('ADD_LINK',$this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui','add'));
$this->tpl->setVariable('OPEN_SRC',ilUtil::getImagePath('open.gif','calendar'));
$this->tpl->parseCurrentBlock();
if($counter and !($counter % 7))
{
$this->tpl->setCurrentBlock('month_row');
$this->tpl->parseCurrentBlock();
}
}
}

+ Here is the call graph for this function:

ilCalendarMonthGUI::showEvents ( ilDate  $date)
protected

Show events.

protected

Definition at line 220 of file class.ilCalendarMonthGUI.php.

References $title, ilCalendarAppointmentPanelGUI\_getInstance(), ilCalendarUtil\calculateFontColor(), IL_CAL_FKT_DATE, ilCalendarSettings\TIME_FORMAT_12, and ilCalendarSettings\TIME_FORMAT_24.

Referenced by show().

{
global $tree;
foreach($this->scheduler->getByDay($date,$this->timezone) as $item)
{
$this->tpl->setCurrentBlock('panel_code');
$this->tpl->setVariable('NUM',$this->num_appointments);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('il_event');
include_once('./Services/Calendar/classes/class.ilCalendarAppointmentPanelGUI.php');
$this->tpl->setVariable('PANEL_DATA',ilCalendarAppointmentPanelGUI::_getInstance()->getHTML($item));
$this->tpl->setVariable('PANEL_NUM',$this->num_appointments);
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui','app_id',$item['event']->getEntryId());
$this->tpl->setVariable('EVENT_EDIT_LINK',$this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui','edit'));
$this->tpl->setVariable('EVENT_NUM',$item['event']->getEntryId());
if($item['event']->isFullDay())
{
$title = $item['event']->getPresentationTitle();
}
else
{
switch($this->user_settings->getTimeFormat())
{
$title = $item['event']->getStart()->get(IL_CAL_FKT_DATE,'H:i',$this->timezone);
break;
$title = $item['event']->getStart()->get(IL_CAL_FKT_DATE,'h:ia',$this->timezone);
break;
}
$title .= (' '.$item['event']->getPresentationTitle());
}
$this->tpl->setVariable('EVENT_TITLE',$title);
$color = $this->app_colors->getColorByAppointment($item['event']->getEntryId());
$this->tpl->setVariable('EVENT_BGCOLOR',$color);
$this->tpl->setVariable('EVENT_FONTCOLOR',ilCalendarUtil::calculateFontColor($color));
$this->tpl->parseCurrentBlock();
$this->num_appointments++;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilCalendarMonthGUI::$ctrl
protected

Definition at line 49 of file class.ilCalendarMonthGUI.php.

ilCalendarMonthGUI::$lng
protected

Definition at line 48 of file class.ilCalendarMonthGUI.php.

Referenced by __construct().

ilCalendarMonthGUI::$num_appointments = 1
protected

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

ilCalendarMonthGUI::$seed = null
protected

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

ilCalendarMonthGUI::$tabs_gui
protected

Definition at line 50 of file class.ilCalendarMonthGUI.php.

ilCalendarMonthGUI::$timezone = 'UTC'
protected

Definition at line 53 of file class.ilCalendarMonthGUI.php.

ilCalendarMonthGUI::$tpl
protected

Definition at line 51 of file class.ilCalendarMonthGUI.php.

Referenced by __construct(), executeCommand(), and show().

ilCalendarMonthGUI::$user_settings = null
protected

Definition at line 46 of file class.ilCalendarMonthGUI.php.


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