ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMiniCalendarGUI Class Reference
+ Collaboration diagram for ilMiniCalendarGUI:

Public Member Functions

 __construct (ilDate $seed, $a_par_obj)
 Constructor.
 setParentObject ($a_parentobject)
 Set Parent GUI object.
 getParentObject ()
 Get Parent GUI object.
 getHTML ()
 Get HTML for calendar.
 addMiniMonth ($a_tpl)
 Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab.

Data Fields

const PRESENTATION_CALENDAR = 1

Protected Attributes

 $seed
 $mode = null
 $user_settings = null
 $tpl = null
 $lng

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

ilMiniCalendarGUI::__construct ( ilDate  $seed,
  $a_par_obj 
)

Constructor.

public

Parameters
@return

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

References $lng, $seed, ilCalendarUserSettings\_getInstanceByUserId(), and setParentObject().

{
global $ilUser,$lng;
$this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
$this->tpl = new ilTemplate('tpl.minical.html',true,true,'Services/Calendar');
$this->lng = $lng;
$this->lng->loadLanguageModule('dateplaner');
$this->seed = $seed;
$this->setParentObject($a_par_obj);
}

+ Here is the call graph for this function:

Member Function Documentation

ilMiniCalendarGUI::addMiniMonth (   $a_tpl)

Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab.

Definition at line 107 of file class.ilMiniCalendarGUI.php.

References $ilCtrl, $lng, ilDateTime\_before(), ilCalendarUtil\_buildMonthDayList(), ilDateTime\_equals(), ilCalendarUtil\_isToday(), ilCalendarUtil\_numericDayToString(), getParentObject(), IL_CAL_DATE, IL_CAL_FKT_DATE, IL_CAL_MONTH, ilDateTime\MONTH, and ilCalendarSchedule\TYPE_MONTH.

Referenced by getHTML().

{
global $ilCtrl, $lng,$ilUser;
// weekdays
include_once('Services/Calendar/classes/class.ilCalendarUtil.php');
$a_tpl->setCurrentBlock('month_header_col');
$a_tpl->setVariable('TXT_WEEKDAY', $lng->txt("cal_week_abbrev"));
$a_tpl->parseCurrentBlock();
for($i = (int) $this->user_settings->getWeekStart();$i < (7 + (int) $this->user_settings->getWeekStart());$i++)
{
$a_tpl->setCurrentBlock('month_header_col');
$a_tpl->setVariable('TXT_WEEKDAY',ilCalendarUtil::_numericDayToString($i,false));
$a_tpl->parseCurrentBlock();
}
include_once('Services/Calendar/classes/class.ilCalendarSchedule.php');
$this->scheduler = new ilCalendarSchedule($this->seed,ilCalendarSchedule::TYPE_MONTH);
$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);
$a_tpl->setCurrentBlock('month_col');
if(count($this->scheduler->getByDay($date,$ilUser->getTimeZone())))
{
$a_tpl->setVariable('DAY_CLASS','calminiapp');
#$a_tpl->setVariable('TD_CLASS','calminiapp');
}
include_once('./Services/Calendar/classes/class.ilCalendarUtil.php');
{
$a_tpl->setVariable('TD_CLASS','calminitoday');
}
#elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
#{
# $a_tpl->setVariable('TD_CLASS','calmininow');
#}
elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_MONTH))
{
$a_tpl->setVariable('TD_CLASS','calministd');
}
elseif(ilDateTime::_before($date,$this->seed,IL_CAL_MONTH))
{
$a_tpl->setVariable('TD_CLASS','calminiprev');
}
else
{
$a_tpl->setVariable('TD_CLASS','calmininext');
}
$day = $date->get(IL_CAL_FKT_DATE,'j');
$month = $date->get(IL_CAL_FKT_DATE,'n');
$month_day = $day;
$ilCtrl->clearParametersByClass('ilcalendardaygui');
$ilCtrl->setParameterByClass('ilcalendardaygui','seed',$date->get(IL_CAL_DATE));
$a_tpl->setVariable('OPEN_DAY_VIEW', $ilCtrl->getLinkTargetByClass('ilcalendardaygui',''));
$ilCtrl->clearParametersByClass('ilcalendardaygui');
$a_tpl->setVariable('MONTH_DAY',$month_day);
//$this->tpl->setVariable('NEW_SRC',ilUtil::getImagePath('new.gif','calendar'));
//$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'));
$a_tpl->parseCurrentBlock();
if($counter and !($counter % 7))
{
$a_tpl->setCurrentBlock('month_row');
$ilCtrl->clearParametersByClass('ilcalendarweekgui');
$ilCtrl->setParameterByClass('ilcalendarweekgui','seed',$date->get(IL_CAL_DATE));
$a_tpl->setVariable('OPEN_WEEK_VIEW', $ilCtrl->getLinkTargetByClass('ilcalendarweekgui',''));
$ilCtrl->clearParametersByClass('ilcalendarweekgui');
$a_tpl->setVariable('TD_CLASS','calminiweek');
$a_tpl->setVariable('WEEK',
$date->get(IL_CAL_FKT_DATE,'W'));
$a_tpl->parseCurrentBlock();
}
}
$a_tpl->setCurrentBlock('mini_month');
$a_tpl->setVariable('TXT_MONTH_OVERVIEW', $lng->txt("cal_month_overview"));
$a_tpl->setVariable('TXT_MONTH',
$lng->txt('month_'.$this->seed->get(IL_CAL_FKT_DATE,'m').'_long').
' '.$this->seed->get(IL_CAL_FKT_DATE,'Y'));
$myseed = clone($this->seed);
$ilCtrl->setParameterByClass('ilcalendarmonthgui','seed',$myseed->get(IL_CAL_DATE));
$a_tpl->setVariable('OPEN_MONTH_VIEW',$ilCtrl->getLinkTargetByClass('ilcalendarmonthgui',''));
$myseed->increment(ilDateTime::MONTH, -1);
$ilCtrl->setParameter($this->getParentObject(),'seed',$myseed->get(IL_CAL_DATE));
//$a_tpl->setVariable('BL_TYPE', $this->getBlockType());
//$a_tpl->setVariable('BL_ID', $this->getBlockId());
$a_tpl->setVariable('PREV_MONTH',
$ilCtrl->getLinkTarget($this->getParentObject(), ""));
$myseed->increment(ilDateTime::MONTH, 2);
$ilCtrl->setParameter($this->getParentObject(),'seed',$myseed->get(IL_CAL_DATE));
$a_tpl->setVariable('NEXT_MONTH',
$ilCtrl->getLinkTarget($this->getParentObject(), ""));
$ilCtrl->setParameter($this->getParentObject(), 'seed', "");
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMiniCalendarGUI::getHTML ( )

Get HTML for calendar.

Definition at line 85 of file class.ilMiniCalendarGUI.php.

References $lng, $tpl, addMiniMonth(), and ilUtil\getImagePath().

{
global $lng;
$ftpl = new ilTemplate("tpl.calendar_block_frame.html", true, true,
"Services/Calendar");
$tpl = new ilTemplate("tpl.calendar_block.html", true, true,
"Services/Calendar");
$this->addMiniMonth($tpl);
$ftpl->setVariable("IMG_BLOCK", ilUtil::getImagePath("icon_cals_s.gif"));
$ftpl->setVariable("BLOCK_TITLE", $lng->txt("calendar"));
$ftpl->setVariable("CONTENT", $tpl->get());
$ftpl->setVariable("ALT_BLOCK", $lng->txt("icon")." ".$lng->txt("calendar"));
return $ftpl->get();
}

+ Here is the call graph for this function:

ilMiniCalendarGUI::getParentObject ( )

Get Parent GUI object.

Returns
object Parent GUI object

Definition at line 77 of file class.ilMiniCalendarGUI.php.

Referenced by addMiniMonth().

{
return $this->parentobject;
}

+ Here is the caller graph for this function:

ilMiniCalendarGUI::setParentObject (   $a_parentobject)

Set Parent GUI object.

Parameters
object$a_parentobjectParent GUI object

Definition at line 67 of file class.ilMiniCalendarGUI.php.

Referenced by __construct().

{
$this->parentobject = $a_parentobject;
}

+ Here is the caller graph for this function:

Field Documentation

ilMiniCalendarGUI::$lng
protected

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

Referenced by __construct(), addMiniMonth(), and getHTML().

ilMiniCalendarGUI::$mode = null
protected

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

ilMiniCalendarGUI::$seed
protected

Definition at line 37 of file class.ilMiniCalendarGUI.php.

Referenced by __construct().

ilMiniCalendarGUI::$tpl = null
protected

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

Referenced by getHTML().

ilMiniCalendarGUI::$user_settings = null
protected

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

const ilMiniCalendarGUI::PRESENTATION_CALENDAR = 1

Definition at line 35 of file class.ilMiniCalendarGUI.php.


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