2006-09-07 09:04:15 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2016-05-06 11:19:36 +02:00
|
|
|
* EGroupware - Notifications
|
|
|
|
*
|
2006-09-07 09:04:15 +02:00
|
|
|
* serves the hook "after_navbar" to create the notificationwindow
|
2008-08-15 11:38:58 +02:00
|
|
|
*
|
|
|
|
* @abstract notificatonwindow is an empty and non displayed 1px div which gets rezised
|
2006-09-07 09:04:15 +02:00
|
|
|
* and populated if a notification is about to be displayed.
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @package notifications
|
|
|
|
* @subpackage ajaxpoup
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @author Cornelius Weiss <nelius@cwtech.de>
|
2006-09-25 12:20:46 +02:00
|
|
|
* @version $Id$
|
2006-09-07 09:04:15 +02:00
|
|
|
*/
|
2016-05-06 11:19:36 +02:00
|
|
|
|
|
|
|
use EGroupware\Api;
|
2011-06-15 12:05:11 +02:00
|
|
|
if ($GLOBALS['egw_info']['user']['apps']['notifications'])
|
2009-08-25 13:22:04 +02:00
|
|
|
{
|
2016-05-06 11:19:36 +02:00
|
|
|
$notification_config = Api\Config::read('notifications');
|
|
|
|
Api\Translation::add_app('notifications');
|
2018-01-11 17:23:58 +01:00
|
|
|
$langRequire = array (
|
|
|
|
'app' => 'notifications',
|
|
|
|
'lang' => Api\Translation::$userlang,
|
|
|
|
'etag' => Api\Translation::etag('notifications', Api\Translation::$userlang)
|
|
|
|
);
|
2009-04-06 23:46:11 +02:00
|
|
|
$popup_poll_interval = empty($notification_config['popup_poll_interval']) ? 60 : $notification_config['popup_poll_interval'];
|
2018-08-02 16:31:51 +02:00
|
|
|
$minjs = $GLOBALS['egw_info']['server']['debug_minify'] === 'True' ? '' : '.min';
|
|
|
|
echo '<script src="'. $GLOBALS['egw_info']['server']['webserver_url']. '/notifications/js/notificationajaxpopup'.$minjs.'.js?'.
|
|
|
|
filemtime(EGW_SERVER_ROOT.'/notifications/js/notificationajaxpopup'.$minjs.'.js').
|
2021-06-05 20:39:39 +02:00
|
|
|
'" type="module" id="notifications_script_id" data-poll-interval="'.$popup_poll_interval.
|
2018-01-11 17:23:58 +01:00
|
|
|
'" data-langRequire="'. htmlspecialchars(json_encode($langRequire)).'"></script>';
|
2006-09-07 09:04:15 +02:00
|
|
|
echo '
|
2009-02-23 21:45:31 +01:00
|
|
|
<div id="egwpopup" style="display: none; z-index: 999;">
|
2017-05-16 18:03:50 +02:00
|
|
|
<div id="egwpopup_header">'.lang('Notifications').
|
2018-06-06 11:05:19 +02:00
|
|
|
'<span class="button_right_toggle"></span><span class="egwpopup_seenall" title="'. lang('mark all as read').'"></span>'.
|
2017-05-17 14:04:31 +02:00
|
|
|
'<span class="egwpopup_deleteall" title="'.lang('delete all messages').'"></span></div>
|
2017-05-15 17:34:27 +02:00
|
|
|
<div id="egwpopup_list"></div>
|
2006-09-07 09:04:15 +02:00
|
|
|
</div>
|
|
|
|
';
|
2013-07-22 15:29:20 +02:00
|
|
|
unset($notification_config);
|
2006-09-25 10:23:30 +02:00
|
|
|
}
|