ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilNotificationGUI Class Reference
+ Collaboration diagram for ilNotificationGUI:

Public Member Functions

 __construct ()
 Constructor public.
 _forwards ()
 executeCommand ()
 getHandler ($type)
 getOSDNotificationsObject ()
 removeOSDNotificationsObject ()
 addHandler ($channel, ilNotificationHandler $handler)
 showSettingsObject ()
 addLocatorItems ()

Private Member Functions

 getAvailableTypes ($types=array())
 getAvailableChannels ($types=array())
 saveCustomizingOptionObject ()
 saveSettingsObject ()

Private Attributes

 $handler = array()

Detailed Description

Constructor & Destructor Documentation

ilNotificationGUI::__construct ( )

Constructor public.

Definition at line 26 of file class.ilNotificationGUI.php.

{
$this->type = "not";
require_once 'Services/Notifications/classes/class.ilNotificationSetupHelper.php';
}

Member Function Documentation

ilNotificationGUI::_forwards ( )

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

{
return array();
}
ilNotificationGUI::addHandler (   $channel,
ilNotificationHandler  $handler 
)

Definition at line 92 of file class.ilNotificationGUI.php.

References $handler.

{
if (!array_key_exists($channel, $this->handler) || !is_array($this->handler[$channel]))
$this->handler[$channel] = array();
$this->handler[$channel][] = $handler;
}
ilNotificationGUI::addLocatorItems ( )

Definition at line 159 of file class.ilNotificationGUI.php.

References $_GET, and $ilCtrl.

{
global $ilLocator, $ilCtrl;
if (is_object($this->object)) {
$ilLocator->addItem($this->object->getTitle(), $ilCtrl->getLinkTarget($this, ''), '', $_GET["ref_id"]);
}
}
ilNotificationGUI::executeCommand ( )

Definition at line 36 of file class.ilNotificationGUI.php.

References $cmd, and $ilCtrl.

{
global $ilCtrl;
if (!$ilCtrl->getCmd())
return;
$cmd = $ilCtrl->getCmd() . 'Object';
$this->$cmd();
}
ilNotificationGUI::getAvailableChannels (   $types = array())
private

Definition at line 55 of file class.ilNotificationGUI.php.

Referenced by showSettingsObject().

+ Here is the caller graph for this function:

ilNotificationGUI::getAvailableTypes (   $types = array())
private

Definition at line 51 of file class.ilNotificationGUI.php.

Referenced by showSettingsObject().

+ Here is the caller graph for this function:

ilNotificationGUI::getHandler (   $type)

Definition at line 47 of file class.ilNotificationGUI.php.

{
return $this->handler[$type];
}
ilNotificationGUI::getOSDNotificationsObject ( )

Definition at line 59 of file class.ilNotificationGUI.php.

References $_REQUEST, $GLOBALS, $result, exit, and ilNotificationOSDHandler\getNotificationsForUser().

{
global $ilUser;
if ($ilUser->getId() == ANONYMOUS_USER_ID) {
return '{}';
}
$GLOBALS['WEB_ACCESS_WITHOUT_SESSION'] = true;
require_once 'Services/Notifications/classes/class.ilNotificationEchoHandler.php';
require_once 'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
$notifications = ilNotificationOSDHandler::getNotificationsForUser($ilUser->getId(), true, (int)$_REQUEST['max_age']);
$result = new stdClass();
$result->notifications = $notifications;
$result->server_time = time();
echo json_encode($result);
}

+ Here is the call graph for this function:

ilNotificationGUI::removeOSDNotificationsObject ( )

Definition at line 79 of file class.ilNotificationGUI.php.

References $_REQUEST, $GLOBALS, exit, and ilNotificationOSDHandler\removeNotification().

{
global $ilUser;
$GLOBALS['WEB_ACCESS_WITHOUT_SESSION'] = true;
require_once 'Services/Notifications/classes/class.ilNotificationEchoHandler.php';
require_once 'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
}

+ Here is the call graph for this function:

ilNotificationGUI::saveCustomizingOptionObject ( )
private

Definition at line 99 of file class.ilNotificationGUI.php.

References $_POST, and showSettingsObject().

{
global $ilUser;
if ($_POST['enable_custom_notification_configuration']) {
$ilUser->writePref('use_custom_notification_setting', 1);
}
else {
$ilUser->writePref('use_custom_notification_setting', 0);
}
}

+ Here is the call graph for this function:

ilNotificationGUI::saveSettingsObject ( )
private

Definition at line 151 of file class.ilNotificationGUI.php.

References $_REQUEST, $ilCtrl, ilNotificationDatabaseHandler\setUserConfig(), and showSettingsObject().

{
global $ilUser, $ilCtrl;
require_once 'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
ilNotificationDatabaseHandler::setUserConfig($ilUser->getId(), $_REQUEST['notification'] ? $_REQUEST['notification'] : array());
}

+ Here is the call graph for this function:

ilNotificationGUI::showSettingsObject ( )

Definition at line 113 of file class.ilNotificationGUI.php.

References $ilCtrl, $lng, $tpl, getAvailableChannels(), getAvailableTypes(), ilNotificationDatabaseHandler\loadUserConfig(), and ilCheckboxInputGUI\setValue().

Referenced by saveCustomizingOptionObject(), and saveSettingsObject().

{
global $tpl, $ilCtrl, $ilUser, $lng;
require_once 'Services/Notifications/classes/class.ilNotificationSettingsTable.php';
require_once 'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
$userTypes = ilNotificationDatabaseHandler::loadUserConfig($ilUser->getId());
$lng->loadLanguageModule('notification');
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$chk = new ilCheckboxInputGUI($lng->txt('enable_custom_notification_configuration'), 'enable_custom_notification_configuration');
$chk->setValue('1');
$chk->setChecked($ilUser->getPref('use_custom_notification_setting') == 1);
$form->addItem($chk);
$form->setFormAction($ilCtrl->getFormAction($this, 'showSettingsObject'));
$form->addCommandButton('saveCustomizingOption', $lng->txt('save'));
$form->addCommandButton('showSettings', $lng->txt('cancel'));
$table = new ilNotificationSettingsTable($this, 'a title', $this->getAvailableChannels(array('set_by_user')), $userTypes);
$table->setFormAction($ilCtrl->getFormAction($this, 'saveSettings'));
$table->setData($this->getAvailableTypes(array('set_by_user')));
if ($ilUser->getPref('use_custom_notification_setting') == 1) {
$table->addCommandButton('saveSettings', $lng->txt('save'));
$table->addCommandButton('showSettings', $lng->txt('cancel'));
$table->setEditable(true);
}
else {
$table->setEditable(false);
}
$tpl->setContent($form->getHtml() . $table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilNotificationGUI::$handler = array()
private

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

Referenced by addHandler().


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