ILIAS  Release_5_0_x_branch Revision 61816
 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 ()
 Returns the pending on screen notifications for a user request.
 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 24 of file class.ilNotificationGUI.php.

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

Member Function Documentation

ilNotificationGUI::_forwards ( )

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

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

Definition at line 102 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 176 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 58 of file class.ilNotificationGUI.php.

Referenced by showSettingsObject().

+ Here is the caller graph for this function:

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

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

Referenced by showSettingsObject().

+ Here is the caller graph for this function:

ilNotificationGUI::getHandler (   $type)

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

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

Returns the pending on screen notifications for a user request.

Todo:
this method should move to a better place as it handels channel sprecific things. ilUser $ilUser
Returns
string

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

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

{
global $ilUser;
if($ilUser->getId() == ANONYMOUS_USER_ID)
{
return '{}';
}
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 90 of file class.ilNotificationGUI.php.

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

{
global $ilUser;
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 110 of file class.ilNotificationGUI.php.

References $_POST, $ilUser, 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 167 of file class.ilNotificationGUI.php.

References $_REQUEST, $ilCtrl, $ilUser, 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 126 of file class.ilNotificationGUI.php.

References $ilCtrl, $ilUser, $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 18 of file class.ilNotificationGUI.php.

Referenced by addHandler().


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