ILIAS  Release_4_4_x_branch Revision 61816
 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'
const AUTO_RATING_NEW_OBJECTS = 'cont_auto_rate_new_obj'
const INFO_TAB_VISIBILITY = 'cont_show_info_tab'

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:
class.ilObjectServiceSettingsGUI.php 46447 2013-11-27 15:11:25Z akill

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 29 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 200 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 209 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 42 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 186 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 195 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 62 of file class.ilObjectServiceSettingsGUI.php.

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

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

{
global $ilSetting;
// info tab
if(in_array(self::INFO_TAB_VISIBILITY, $services))
{
$info = new ilCheckboxInputGUI($GLOBALS['lng']->txt('obj_tool_setting_info_tab'), self::INFO_TAB_VISIBILITY);
$info->setValue(1);
$a_obj_id,
self::INFO_TAB_VISIBILITY,
true
));
//$info->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_info_tab'));
$info->setInfo($GLOBALS['lng']->txt('obj_tool_setting_info_tab_info'));
$form->addItem($info);
}
// calendar
if(in_array(self::CALENDAR_VISIBILITY, $services))
{
include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
{
// Container tools (calendar, news, ... activation)
$cal = new ilCheckboxInputGUI($GLOBALS['lng']->txt('obj_tool_setting_calendar'), 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'));
$cal->setInfo($GLOBALS['lng']->txt('obj_tool_setting_calendar_info'));
$form->addItem($cal);
}
}
// news
if(in_array(self::NEWS_VISIBILITY, $services))
{
if($ilSetting->get('block_activated_news'))
{
// Container tools (calendar, news, ... activation)
$news = new ilCheckboxInputGUI($GLOBALS['lng']->txt('obj_tool_setting_news'), 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'));
$news->setInfo($GLOBALS['lng']->txt('obj_tool_setting_news_info'));
$form->addItem($news);
}
}
// auto rating
if(in_array(self::AUTO_RATING_NEW_OBJECTS, $services))
{
$GLOBALS['lng']->loadLanguageModule("rating");
// auto rating for new objects
$rate = new ilCheckboxInputGUI($GLOBALS['lng']->txt('rating_new_objects_auto'), self::AUTO_RATING_NEW_OBJECTS);
$rate->setValue(1);
//$rate->setOptionTitle($GLOBALS['lng']->txt('rating_new_objects_auto'));
$rate->setInfo($GLOBALS['lng']->txt('rating_new_objects_auto_info'));
$a_obj_id,
self::AUTO_RATING_NEW_OBJECTS,
false
));
$form->addItem($rate);
}
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 249 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 144 of file class.ilObjectServiceSettingsGUI.php.

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

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

{
// info
if(in_array(self::INFO_TAB_VISIBILITY, $services))
{
include_once './Services/Container/classes/class.ilContainer.php';
ilContainer::_writeContainerSetting($a_obj_id,self::INFO_TAB_VISIBILITY,(int) $form->getInput(self::INFO_TAB_VISIBILITY));
}
// calendar
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));
}
}
// news
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));
}
// rating
if(in_array(self::AUTO_RATING_NEW_OBJECTS, $services))
{
include_once './Services/Container/classes/class.ilContainer.php';
ilContainer::_writeContainerSetting($a_obj_id,self::AUTO_RATING_NEW_OBJECTS,(int) $form->getInput(self::AUTO_RATING_NEW_OBJECTS));
}
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 222 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 21 of file class.ilObjectServiceSettingsGUI.php.

ilObjectServiceSettingsGUI::$modes = array()
private

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

Referenced by getModes().

ilObjectServiceSettingsGUI::$obj_id = 0
private

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

Referenced by getObjId().

const ilObjectServiceSettingsGUI::AUTO_RATING_NEW_OBJECTS = 'cont_auto_rate_new_obj'

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