. * --------------------------------------------------------------------- */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access this file directly"); } /** * This class manages the ajax notifications settings */ class NotificationAjaxSetting extends NotificationSetting { static public function getTypeName($nb = 0) { return __('Browser followups configuration'); } public function getEnableLabel() { return __('Enable followups from browser'); } static public function getMode() { return Notification_NotificationTemplate::MODE_AJAX; } function showFormConfig() { global $CFG_GLPI; echo "
"; echo "
"; echo ""; echo ""; echo "". ""; if ($CFG_GLPI['notifications_ajax']) { $sounds = [ 'sound_a' => __('Sound') . ' A', 'sound_b' => __('Sound') . ' B', 'sound_c' => __('Sound') . ' C', 'sound_d' => __('Sound') . ' D', ]; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } else { echo ""; } $options['candel'] = false; if ($CFG_GLPI['notifications_ajax']) { $options['addbuttons'] = ['test_ajax_send' => __('Send a test browser notification to you')]; } $this->showFormButtons($options); } }
"._n('Browser notification', 'Browser notifications', Session::getPluralNumber()). "
" . __('Default notification sound') . ""; $rand_sound = mt_rand(); Dropdown::showFromArray("notifications_ajax_sound", $sounds, [ 'value' => $CFG_GLPI["notifications_ajax_sound"], 'display_emptychoice' => true, 'emptylabel' => __('Disabled'), 'rand' => $rand_sound, ]); echo " 
" . __('Time to check for new notifications (in seconds)') . ""; Dropdown::showNumber('notifications_ajax_check_interval', ['value' => $CFG_GLPI["notifications_ajax_check_interval"], 'min' => 5, 'max' => 120, 'step' => 5]); echo "" . __('URL of the icon') . ""; echo "
" . __('Notifications are disabled.') . "" . __('See configuration') . "