egroupware/notifications/inc/hook_after_navbar.inc.php

38 lines
1.6 KiB
PHP
Raw Normal View History

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
*
* @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;
if ($GLOBALS['egw_info']['user']['apps']['notifications'])
{
2016-05-06 11:19:36 +02:00
$notification_config = Api\Config::read('notifications');
Api\Translation::add_app('notifications');
$popup_poll_interval = empty($notification_config['popup_poll_interval']) ? 60 : $notification_config['popup_poll_interval'];
echo '<script src="'. $GLOBALS['egw_info']['server']['webserver_url']. '/notifications/js/notificationajaxpopup.js?'.
filemtime(EGW_SERVER_ROOT.'/notifications/js/notificationajaxpopup.js'). '" type="text/javascript" id="notifications_script_id" data-poll-interval="'.$popup_poll_interval.'"></script>';
2006-09-07 09:04:15 +02:00
echo '
<div id="egwpopup" style="display: none; z-index: 999;">
<div id="egwpopup_header">'.lang('Notification'). '<span style="float:right;">'.
Api\Html::submit_button('egwpopup_close_button', 'X', '', true, 'id="egwpopup_close_button"', 'close') .
'</span></div>
<div id="egwpopup_message"></div>
<div id="egwpopup_footer">
<input id="egwpopup_ok_button" class="et2_button et2_button_text" type="button" value="'. lang('ok'). '">
2006-09-07 09:04:15 +02:00
</div>
</div>
';
unset($notification_config);
2006-09-25 10:23:30 +02:00
}