ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarPresentationGUI Class Reference
+ Collaboration diagram for ilCalendarPresentationGUI:

Public Member Functions

 __construct ()
 Constructor.
 executeCommand ()
 Execute command.
 getNextClass ()
 get next class
 readLastClass ()
 Read last class from history.
 setCmdClass ($a_class)
 show ()
 Show.
 initSeed ()
 init the seed date for presentations (month view, minicalendar)

Protected Member Functions

 forwardToClass ($a_class)
 forward to class
 loadHistory ()
 forward to last presentation class
 showSideBlocks ()
 show side blocks
 prepareOutput ()
 get tabs

Protected Attributes

 $ctrl
 $lng
 $tpl
 $tabs_gui

Detailed Description

Constructor & Destructor Documentation

ilCalendarPresentationGUI::__construct ( )

Constructor.

public

Parameters

Definition at line 52 of file class.ilCalendarPresentationGUI.php.

References $ilCtrl, $lng, $tpl, ilCalendarUserSettings\_getInstance(), ilCalendarCategories\_getInstance(), ilCalendarUserSettings\CAL_SELECTION_MEMBERSHIP, ilCalendarCategories\MODE_PERSONAL_DESKTOP_ITEMS, and ilCalendarCategories\MODE_PERSONAL_DESKTOP_MEMBERSHIP.

{
global $ilCtrl,$lng,$tpl,$ilTabs,$ilUser;
$this->ctrl = $ilCtrl;
$this->lng = $lng;
$this->lng->loadLanguageModule('dateplaner');
$this->tpl = $tpl;
$this->tabs_gui = $ilTabs;
include_once('./Services/Calendar/classes/class.ilCalendarCategories.php');
$cats = ilCalendarCategories::_getInstance($ilUser->getId());
include_once './Services/Calendar/classes/class.ilCalendarUserSettings.php';
{
}
else
{
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilCalendarPresentationGUI::executeCommand ( )

Execute command.

public

Parameters

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

References $_GET, $_SESSION, $cmd, $ilSetting, $tpl, ilCalendarSettings\_getInstance(), forwardToClass(), getNextClass(), initSeed(), prepareOutput(), readLastClass(), ilUtil\redirect(), ilUtil\sendFailure(), setCmdClass(), and showSideBlocks().

{
global $ilUser, $ilSetting,$tpl;
include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
{
ilUtil::sendFailure($this->lng->txt('permission_denied'),true);
ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
}
$this->initSeed();
$this->prepareOutput();
$next_class = $this->getNextClass();
switch($next_class)
{
case 'ilcalendarinboxgui':
$this->tabs_gui->setSubTabActive('app_inbox');
$this->forwardToClass('ilcalendarinboxgui');
break;
case 'ilconsultationhoursgui':
$this->tabs_gui->setSubTabActive('app_consultation_hours');
$this->tabs_gui->clearTargets();
// No side blocks
$this->tabs_gui->setBackTarget(
$this->lng->txt('cal_back_to_cal'),
$this->ctrl->getLinkTargetByClass($this->readLastClass())
);
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursGUI.php';
$gui = new ilConsultationHoursGUI();
$this->ctrl->forwardCommand($gui);
return true;
case 'ilcalendarmonthgui':
$this->tabs_gui->setSubTabActive('app_month');
$this->forwardToClass('ilcalendarmonthgui');
break;
case 'ilcalendarweekgui':
$this->tabs_gui->setSubTabActive('app_week');
$this->forwardToClass('ilcalendarweekgui');
break;
case 'ilcalendardaygui':
$this->tabs_gui->setSubTabActive('app_day');
$this->forwardToClass('ilcalendardaygui');
break;
case 'ilcalendarusersettingsgui':
$this->ctrl->setReturn($this,'');
$this->tabs_gui->setSubTabActive('properties');
$this->setCmdClass('ilcalendarusersettingsgui');
include_once('./Services/Calendar/classes/class.ilCalendarUserSettingsGUI.php');
$user_settings = new ilCalendarUserSettingsGUI();
$this->ctrl->forwardCommand($user_settings);
// No side blocks
return true;
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, $this->seed,(int) $_GET['app_id']);
$this->ctrl->forwardCommand($app);
break;
case 'ilcalendarcategorygui':
$this->ctrl->setReturn($this,'');
include_once('Services/Calendar/classes/class.ilCalendarCategoryGUI.php');
$category = new ilCalendarCategoryGUI($ilUser->getId(),$this->seed);
if($this->ctrl->forwardCommand($category))
{
$this->tabs_gui->setSubTabActive("cal_manage");
// no side blocks
return;
}
else
{
$this->tabs_gui->setSubTabActive($_SESSION['cal_last_tab']);
break;
}
default:
$cmd = $this->ctrl->getCmd("show");
$this->$cmd();
break;
}
$this->showSideBlocks();
return true;
}

+ Here is the call graph for this function:

ilCalendarPresentationGUI::forwardToClass (   $a_class)
protected

forward to class

protected

Definition at line 236 of file class.ilCalendarPresentationGUI.php.

References $_SESSION, and setCmdClass().

Referenced by executeCommand(), and loadHistory().

{
global $ilUser;
switch($a_class)
{
case 'ilcalendarmonthgui':
$ilUser->writePref('cal_last_class',$a_class);
$_SESSION['cal_last_tab'] = 'app_month';
$this->setCmdClass('ilcalendarmonthgui');
include_once('./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
$month_gui = new ilCalendarMonthGUI($this->seed);
$this->ctrl->forwardCommand($month_gui);
break;
case 'ilcalendarweekgui':
$ilUser->writePref('cal_last_class',$a_class);
$_SESSION['cal_last_tab'] = 'app_week';
$this->setCmdClass('ilcalendarweekgui');
include_once('./Services/Calendar/classes/class.ilCalendarWeekGUI.php');
$week_gui = new ilCalendarWeekGUI($this->seed);
$this->ctrl->forwardCommand($week_gui);
break;
case 'ilcalendardaygui':
$ilUser->writePref('cal_last_class',$a_class);
$_SESSION['cal_last_tab'] = 'app_day';
$this->setCmdClass('ilcalendardaygui');
include_once('./Services/Calendar/classes/class.ilCalendarDayGUI.php');
$day_gui = new ilCalendarDayGUI($this->seed);
$this->ctrl->forwardCommand($day_gui);
break;
case 'ilcalendarinboxgui':
$ilUser->writePref('cal_last_class',$a_class);
$_SESSION['cal_last_tab'] = 'app_inbox';
$this->setCmdClass('ilcalendarinboxgui');
include_once('./Services/Calendar/classes/class.ilCalendarInboxGUI.php');
$inbox_gui = new ilCalendarinboxGUI($this->seed);
$this->ctrl->forwardCommand($inbox_gui);
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarPresentationGUI::getNextClass ( )

get next class

public

Definition at line 193 of file class.ilCalendarPresentationGUI.php.

References readLastClass().

Referenced by executeCommand().

{
global $ilUser;
if(strlen($next_class = $this->ctrl->getNextClass()))
{
return $next_class;
}
if($this->ctrl->getCmdClass() == strtolower(get_class($this)) or $this->ctrl->getCmdClass() == '')
{
return $this->readLastClass();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarPresentationGUI::initSeed ( )

init the seed date for presentations (month view, minicalendar)

public

Definition at line 366 of file class.ilCalendarPresentationGUI.php.

References $_GET, $_REQUEST, and IL_CAL_DATE.

Referenced by executeCommand().

{
include_once('Services/Calendar/classes/class.ilDate.php');
$this->seed = $_REQUEST['seed'] ? new ilDate($_REQUEST['seed'],IL_CAL_DATE) : new ilDate(date('Y-m-d',time()),IL_CAL_DATE);
$_GET['seed'] = $this->seed->get(IL_CAL_DATE,'');
$this->ctrl->saveParameter($this,array('seed'));
}

+ Here is the caller graph for this function:

ilCalendarPresentationGUI::loadHistory ( )
protected

forward to last presentation class

protected

Parameters
@return

Definition at line 288 of file class.ilCalendarPresentationGUI.php.

References forwardToClass().

{
global $ilUser;
$this->ctrl->setCmd('');
$history = $ilUser->getPref('cal_last_class') ? $ilUser->getPref('cal_last_class') : 'ilcalendarmonthgui';
$this->forwardToClass($history);
}

+ Here is the call graph for this function:

ilCalendarPresentationGUI::prepareOutput ( )
protected

get tabs

public

Definition at line 341 of file class.ilCalendarPresentationGUI.php.

References ilCalendarSettings\_getInstance().

Referenced by executeCommand().

{
global $rbacsystem;
$this->tabs_gui->addSubTabTarget('app_inbox',$this->ctrl->getLinkTargetByClass('ilCalendarInboxGUI',''));
if(
$rbacsystem->checkAccess('add_consultation_hours', ilCalendarSettings::_getInstance()->getCalendarSettingsId()) and
ilCalendarSettings::_getInstance()->areConsultationHoursEnabled()
)
{
$this->tabs_gui->addSubTabTarget('app_consultation_hours',$this->ctrl->getLinkTargetByClass('ilConsultationHoursGUI',''));
}
$this->tabs_gui->addSubTabTarget('app_day',$this->ctrl->getLinkTargetByClass('ilCalendarDayGUI',''));
$this->tabs_gui->addSubTabTarget('app_week',$this->ctrl->getLinkTargetByClass('ilCalendarWeekGUI',''));
$this->tabs_gui->addSubTabTarget('app_month',$this->ctrl->getLinkTargetByClass('ilCalendarMonthGUI',''));
$this->tabs_gui->addSubTabTarget('cal_manage',$this->ctrl->getLinkTargetByClass('ilCalendarCategoryGUI','manage'));
$this->tabs_gui->addSubTabTarget('properties',$this->ctrl->getLinkTargetByClass('ilCalendarUserSettingsGUI',''));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarPresentationGUI::readLastClass ( )

Read last class from history.

Returns

Definition at line 211 of file class.ilCalendarPresentationGUI.php.

Referenced by executeCommand(), and getNextClass().

{
global $ilUser;
return $ilUser->getPref('cal_last_class') ? $ilUser->getPref('cal_last_class') : 'ilcalendarinboxgui';
}

+ Here is the caller graph for this function:

ilCalendarPresentationGUI::setCmdClass (   $a_class)

Definition at line 219 of file class.ilCalendarPresentationGUI.php.

Referenced by executeCommand(), and forwardToClass().

{
// If cmd class == 'ilcalendarpresentationgui' the cmd class is set to the the new forwarded class
// otherwise e.g ilcalendarmonthgui tries to forward (back) to ilcalendargui.
if($this->ctrl->getCmdClass() == strtolower(get_class($this)))
{
$this->ctrl->setCmdClass(strtolower($a_class));
}
return true;
}

+ Here is the caller graph for this function:

ilCalendarPresentationGUI::show ( )

Show.

public

Parameters

Definition at line 330 of file class.ilCalendarPresentationGUI.php.

References ilUtil\getStyleSheetLocation().

{
$this->tpl->addCss(ilUtil::getStyleSheetLocation('filesystem','delos.css','Services/Calendar'));
}

+ Here is the call graph for this function:

ilCalendarPresentationGUI::showSideBlocks ( )
protected

show side blocks

protected

Parameters
@return

Definition at line 304 of file class.ilCalendarPresentationGUI.php.

References $tpl.

Referenced by executeCommand().

{
global $ilUser;
$tpl = new ilTemplate('tpl.cal_side_block.html',true,true,'Services/Calendar');
include_once('./Services/Calendar/classes/class.ilMiniCalendarGUI.php');
$mini = new ilMiniCalendarGUI($this->seed, $this);
// $mini->setPresentationMode(ilMiniCalendarGUI::PRESENTATION_CALENDAR);
$tpl->setVariable('MINICAL',$mini->getHTML());
include_once('./Services/Calendar/classes/class.ilCalendarCategoryGUI.php');
$cat = new ilCalendarCategoryGUI($ilUser->getId(),$this->seed);
$tpl->setVariable('CATEGORIES',$cat->getHTML());
$this->tpl->setLeftContent($tpl->get());
}

+ Here is the caller graph for this function:

Field Documentation

ilCalendarPresentationGUI::$ctrl
protected

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

ilCalendarPresentationGUI::$lng
protected

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

Referenced by __construct().

ilCalendarPresentationGUI::$tabs_gui
protected

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

ilCalendarPresentationGUI::$tpl
protected

Definition at line 42 of file class.ilCalendarPresentationGUI.php.

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


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