ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjectServiceSettingsGUI Class Reference

GUI class for service settings (calendar, notes, comments) More...

+ Collaboration diagram for ilObjectServiceSettingsGUI:

Public Member Functions

 __construct ($a_parent_gui, $a_obj_id, $a_modes)
 Constructor.
 executeCommand ()
 Control class handling.
 getModes ()
 Get active modes.
 getObjId ()
 Get obj id.

Static Public Member Functions

static initServiceSettingsForm ($a_obj_id, ilPropertyFormGUI $form, $services)
 Init service settings form.
static updateServiceSettingsForm ($a_obj_id, ilPropertyFormGUI $form, $services)
 Update service settings.

Data Fields

const CALENDAR_VISIBILITY = 'cont_show_calendar'
const NEWS_VISIBILITY = 'cont_show_news'

Protected Member Functions

 cancel ()
 editSettings (ilPropertyFormGUI $form=null)
 Edit tool settings (calendar, news, comments, ...)
 updateToolSettings ()
 Update settings.
 isModeActive ($a_mode)
 Check if specific mode is active.

Private Attributes

 $gui = null
 $modes = array()
 $obj_id = 0

Detailed Description

GUI class for service settings (calendar, notes, comments)

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

ilObjectServiceSettingsGUI:

Definition at line 14 of file class.ilObjectServiceSettingsGUI.php.

Constructor & Destructor Documentation

ilObjectServiceSettingsGUI::__construct (   $a_parent_gui,
  $a_obj_id,
  $a_modes 
)

Constructor.

Parameters
type$a_parent_gui

Definition at line 27 of file class.ilObjectServiceSettingsGUI.php.

{
$this->gui = $a_parent_gui;
$this->modes = $a_modes;
$this->obj_id = $a_obj_id;
}

Member Function Documentation

ilObjectServiceSettingsGUI::cancel ( )
protected

Definition at line 143 of file class.ilObjectServiceSettingsGUI.php.

References $GLOBALS.

{
$GLOBALS['ilCtrl']->returnToParent($this);
}
ilObjectServiceSettingsGUI::editSettings ( ilPropertyFormGUI  $form = null)
protected

Edit tool settings (calendar, news, comments, ...)

Parameters
ilPropertyFormGUI$form

Definition at line 152 of file class.ilObjectServiceSettingsGUI.php.

References $GLOBALS.

Referenced by updateToolSettings().

{
if(!$form instanceof ilPropertyFormGUI)
{
$form = $this->initSettingsForm();
}
$GLOBALS['tpl']->setContent($form->getHTML());
}

+ Here is the caller graph for this function:

ilObjectServiceSettingsGUI::executeCommand ( )

Control class handling.

Returns

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

References $cmd, and $ilCtrl.

{
global $ilCtrl;
$next_class = $ilCtrl->getNextClass($this);
$cmd = $ilCtrl->getCmd('editSettings');
switch($next_class)
{
default:
$this->$cmd();
break;
}
}
ilObjectServiceSettingsGUI::getModes ( )

Get active modes.

Returns
bool

Definition at line 129 of file class.ilObjectServiceSettingsGUI.php.

References $modes.

Referenced by isModeActive().

{
return $this->modes;
}

+ Here is the caller graph for this function:

ilObjectServiceSettingsGUI::getObjId ( )

Get obj id.

Returns
type

Definition at line 138 of file class.ilObjectServiceSettingsGUI.php.

References $obj_id.

Referenced by updateToolSettings().

{
return $this->obj_id;
}

+ Here is the caller graph for this function:

static ilObjectServiceSettingsGUI::initServiceSettingsForm (   $a_obj_id,
ilPropertyFormGUI  $form,
  $services 
)
static

Init service settings form.

Parameters
ilPropertyFormGUI$form
type$services

Definition at line 60 of file class.ilObjectServiceSettingsGUI.php.

References $GLOBALS, $ilSetting, ilCalendarSettings\_getInstance(), ilContainer\_lookupContainerSetting(), ilPropertyFormGUI\addItem(), and ilCalendarSettings\lookupCalendarActivated().

Referenced by ilObjCourseGUI\initEditForm(), and ilObjGroupGUI\initForm().

{
global $ilSetting;
if(in_array(self::CALENDAR_VISIBILITY, $services))
{
include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
{
// Container tools (calendar, news, ... activation)
$cal = new ilCheckboxInputGUI('', self::CALENDAR_VISIBILITY);
$cal->setValue(1);
include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
$cal->setChecked(ilCalendarSettings::lookupCalendarActivated($a_obj_id));
$cal->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_calendar'));
$form->addItem($cal);
}
}
if(in_array(self::NEWS_VISIBILITY, $services))
{
if($ilSetting->get('block_activated_news'))
{
// Container tools (calendar, news, ... activation)
$news = new ilCheckboxInputGUI('', self::NEWS_VISIBILITY);
$news->setValue(1);
$a_obj_id,
self::NEWS_VISIBILITY,
$ilSetting->get('block_activated_news',true)
));
$news->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_news'));
$form->addItem($news);
}
}
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectServiceSettingsGUI::isModeActive (   $a_mode)
protected

Check if specific mode is active.

Parameters
type$a_mode
Returns
type

Definition at line 192 of file class.ilObjectServiceSettingsGUI.php.

References getModes().

Referenced by updateToolSettings().

{
return in_array($a_mode, $this->getModes());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilObjectServiceSettingsGUI::updateServiceSettingsForm (   $a_obj_id,
ilPropertyFormGUI  $form,
  $services 
)
static

Update service settings.

Parameters
type$a_obj_id
ilPropertyFormGUI$form
type$services

Definition at line 104 of file class.ilObjectServiceSettingsGUI.php.

References ilCalendarSettings\_getInstance(), ilContainer\_writeContainerSetting(), and ilPropertyFormGUI\getInput().

Referenced by ilObjGroupGUI\updateObject(), and ilObjCourseGUI\updateObject().

{
if(in_array(self::CALENDAR_VISIBILITY, $services))
{
include_once './Services/Calendar/classes/class.ilCalendarSettings.php';
{
include_once './Services/Container/classes/class.ilContainer.php';
ilContainer::_writeContainerSetting($a_obj_id,self::CALENDAR_VISIBILITY,(int) $form->getInput(self::CALENDAR_VISIBILITY));
}
}
if(in_array(self::NEWS_VISIBILITY, $services))
{
include_once './Services/Container/classes/class.ilContainer.php';
ilContainer::_writeContainerSetting($a_obj_id,self::NEWS_VISIBILITY,(int) $form->getInput(self::NEWS_VISIBILITY));
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectServiceSettingsGUI::updateToolSettings ( )
protected

Update settings.

Definition at line 165 of file class.ilObjectServiceSettingsGUI.php.

References $GLOBALS, ilCalendarSettings\_getInstance(), ilContainer\_writeContainerSetting(), editSettings(), getObjId(), isModeActive(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
$form = $this->initSettingsForm();
if($form->checkInput())
{
include_once './Services/Calendar/classes/class.ilCalendarSettings.php';
{
if($this->isModeActive(self::CALENDAR_VISIBILITY))
{
ilContainer::_writeContainerSetting($this->getObjId(),'show_calendar',(int) $form->getInput('calendar'));
}
}
ilUtil::sendSuccess($GLOBALS['lng']->txt('settings_saved'),true);
$GLOBALS['ilCtrl']->redirect($this);
}
ilUtil::sendFailure($GLOBALS['lng']->txt('err_check_input'));
$form->setValuesByPost();
$this->editSettings($form);
}

+ Here is the call graph for this function:

Field Documentation

ilObjectServiceSettingsGUI::$gui = null
private

Definition at line 19 of file class.ilObjectServiceSettingsGUI.php.

ilObjectServiceSettingsGUI::$modes = array()
private

Definition at line 20 of file class.ilObjectServiceSettingsGUI.php.

Referenced by getModes().

ilObjectServiceSettingsGUI::$obj_id = 0
private

Definition at line 21 of file class.ilObjectServiceSettingsGUI.php.

Referenced by getObjId().

const ilObjectServiceSettingsGUI::NEWS_VISIBILITY = 'cont_show_news'

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