ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarAppointmentPanelGUI Class Reference

GUI class for YUI appointment panels. More...

+ Collaboration diagram for ilCalendarAppointmentPanelGUI:

Public Member Functions

 getHTML ($a_app)
 get HTML

Static Public Member Functions

static _getInstance ()
 get singleton instance

Protected Member Functions

 __construct ()
 Singleton.

Protected Attributes

 $tpl = null
 $lng = null
 $ctrl = null

Static Protected Attributes

static $counter = 0
static $instance = null

Detailed Description

GUI class for YUI appointment panels.

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

Definition at line 32 of file class.ilCalendarAppointmentPanelGUI.php.

Constructor & Destructor Documentation

ilCalendarAppointmentPanelGUI::__construct ( )
protected

Singleton.

public

Parameters
@return

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

References $ilCtrl, and $lng.

{
global $lng,$ilCtrl;
$this->lng = $lng;
$this->ctrl = $ilCtrl;
}

Member Function Documentation

static ilCalendarAppointmentPanelGUI::_getInstance ( )
static

get singleton instance

public

Parameters
@return

Definition at line 64 of file class.ilCalendarAppointmentPanelGUI.php.

References $instance.

Referenced by getHTML(), ilCalendarDayGUI\showAppointment(), ilCalendarWeekGUI\showAppointment(), ilCalendarMonthGUI\showEvents(), ilCalendarDayGUI\showFulldayAppointment(), and ilCalendarWeekGUI\showFulldayAppointment().

{
if(isset(self::$instance) and self::$instance)
{
}
return self::$instance = new ilCalendarAppointmentPanelGUI();
}

+ Here is the caller graph for this function:

ilCalendarAppointmentPanelGUI::getHTML (   $a_app)

get HTML

public

Parameters
@return

Definition at line 81 of file class.ilCalendarAppointmentPanelGUI.php.

References ilObject\_getAllReferences(), _getInstance(), ilLink\_getStaticLink(), ilCalendarCategoryAssignments\_lookupCategory(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilDatePresentation\formatPeriod(), IL_CAL_UNIX, ilCalendarCategory\TYPE_GLOBAL, ilCalendarCategory\TYPE_OBJ, and ilCalendarCategory\TYPE_USR.

{
global $tree;
self::$counter++;
$this->tpl = new ilTemplate('tpl.appointment_panel.html',true,true,'Services/Calendar');
// Panel variables
$this->tpl->setVariable('PANEL_NUM',self::$counter);
$this->tpl->setVariable('PANEL_TITLE',$a_app['event']->getPresentationTitle());
$this->tpl->setVariable('PANEL_DETAILS',$this->lng->txt('cal_details'));
$this->tpl->setVariable('PANEL_TXT_DATE',$this->lng->txt('date'));
if($a_app['fullday'])
{
$this->tpl->setVariable('PANEL_DATE',ilDatePresentation::formatPeriod(
new ilDate($a_app['dstart'],IL_CAL_UNIX),
new ilDate($a_app['dend'],IL_CAL_UNIX)));
}
else
{
$this->tpl->setVariable('PANEL_DATE',ilDatePresentation::formatPeriod(
new ilDateTime($a_app['dstart'],IL_CAL_UNIX),
new ilDateTime($a_app['dend'],IL_CAL_UNIX)));
}
if($a_app['event']->getLocation())
{
$this->tpl->setVariable('PANEL_TXT_WHERE',$this->lng->txt('cal_where'));
$this->tpl->setVariable('PANEL_WHERE',$a_app['event']->getLocation());
}
if($a_app['event']->getDescription())
{
$this->tpl->setVariable('PANEL_TXT_DESC',$this->lng->txt('description'));
$this->tpl->setVariable('PANEL_DESC',nl2br($a_app['event']->getDescription()));
}
include_once('./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
$cat_id = ilCalendarCategoryAssignments::_lookupCategory($a_app['event']->getEntryId());
$cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo($cat_id);
$this->tpl->setVariable('PANEL_TXT_CAL_TYPE',$this->lng->txt('cal_cal_type'));
switch($cat_info['type'])
{
$this->tpl->setVariable('PANEL_CAL_TYPE',$this->lng->txt('cal_type_system'));
break;
$this->tpl->setVariable('PANEL_CAL_TYPE',$this->lng->txt('cal_type_personal'));
break;
$type = ilObject::_lookupType($cat_info['obj_id']);
$this->tpl->setVariable('PANEL_CAL_TYPE',$this->lng->txt('cal_type_'.$type));
break;
}
$this->tpl->setVariable('PANEL_TXT_CAL_NAME',$this->lng->txt('cal_calendar_name'));
$this->tpl->setVariable('PANEL_CAL_NAME',$cat_info['title']);
if($cat_info['editable'] and !$a_app['event']->isAutoGenerated())
{
$this->tpl->setCurrentBlock('panel_edit_link');
$this->tpl->setVariable('TXT_PANEL_EDIT',$this->lng->txt('edit'));
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui','app_id',$a_app['event']->getEntryId());
$this->tpl->setVariable('PANEL_EDIT_HREF',$this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui','edit'));
$this->tpl->parseCurrentBlock();
}
include_once('./Services/Calendar/classes/class.ilCalendarCategory.php');
if($cat_info['type'] == ilCalendarCategory::TYPE_OBJ)
{
$refs = ilObject::_getAllReferences($cat_info['obj_id']);
include_once('classes/class.ilLink.php');
$href = ilLink::_getStaticLink(current($refs),ilObject::_lookupType($cat_info['obj_id']),true);
$parent = $tree->getParentId(current($refs));
$this->tpl->setVariable('PANEL_TXT_LINK',$this->lng->txt('ext_link'));
$this->tpl->setVariable('PANEL_LINK_HREF',$href);
$this->tpl->setVariable('PANEL_LINK_NAME',ilObject::_lookupTitle($cat_info['obj_id']));
$this->tpl->setVariable('PANEL_PARENT',$parent_title);
}
return $this->tpl->get();
}

+ Here is the call graph for this function:

Field Documentation

ilCalendarAppointmentPanelGUI::$counter = 0
staticprotected

Definition at line 34 of file class.ilCalendarAppointmentPanelGUI.php.

ilCalendarAppointmentPanelGUI::$ctrl = null
protected

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

ilCalendarAppointmentPanelGUI::$instance = null
staticprotected

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

Referenced by _getInstance().

ilCalendarAppointmentPanelGUI::$lng = null
protected

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

Referenced by __construct().

ilCalendarAppointmentPanelGUI::$tpl = null
protected

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


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