';
// Header tabs.
$output .= '
';
// Content tabs.
$output .= '
';
$output .= '
';
$output .= __('Console configuration');
$output .= '
';
$inputs = [];
// Load filter.
$fields = \events_get_event_filter_select();
$inputs[] = [
'label' => \__('Set condition'),
'arguments' => [
'type' => 'select',
'fields' => $fields,
'name' => 'filter_id',
'selected' => 0,
'return' => true,
'nothing' => \__('All new events'),
'nothing_value' => 0,
'class' => 'fullwidth',
],
];
$times_interval = [
10 => '10 '.__('seconds'),
15 => '15 '.__('seconds'),
30 => '30 '.__('seconds'),
60 => '60 '.__('seconds'),
];
$times_sound = [
2 => '2 '.__('seconds'),
5 => '5 '.__('seconds'),
10 => '10 '.__('seconds'),
15 => '15 '.__('seconds'),
30 => '30 '.__('seconds'),
60 => '60 '.__('seconds'),
];
$inputs[] = [
'class' => 'interval-sounds',
'direct' => 1,
'block_content' => [
[
'label' => __('Interval'),
'arguments' => [
'type' => 'select',
'fields' => $times_interval,
'name' => 'interval',
'selected' => 10,
'return' => true,
],
],
[
'label' => __('Sound duration'),
'arguments' => [
'type' => 'select',
'fields' => $times_sound,
'name' => 'time_sound',
'selected' => 10,
'return' => true,
],
],
],
];
$sounds = [
'aircraftalarm.wav' => 'Air craft alarm',
'air_shock_alarm.wav' => 'Air shock alarm',
'alien_alarm.wav' => 'Alien alarm',
'alien_beacon.wav' => 'Alien beacon',
'bell_school_ringing.wav' => 'Bell school ringing',
'Door_Alarm.wav' => 'Door alarm',
'EAS_beep.wav' => 'EAS beep',
'Firewarner.wav' => 'Fire warner',
'HardPCMAlarm.wav' => 'Hard PCM Alarm',
'negativebeep.wav' => 'Negative beep',
'Star_Trek_emergency_simulation.wav' => 'StarTrek emergency simulation',
];
$eventsounds = db_get_all_rows_sql('SELECT * FROM tevent_sound WHERE active = 1');
foreach ($eventsounds as $key => $row) {
$sounds[$row['sound']] = $row['name'];
}
$inputs[] = [
'class' => 'test-sounds',
'direct' => 1,
'block_content' => [
[
'label' => \__('Sound melody'),
'arguments' => [
'type' => 'select',
'fields' => $sounds,
'name' => 'sound_id',
'selected' => 'Star_Trek_emergency_simulation.wav',
'return' => true,
'class' => 'fullwidth',
],
],
[
'arguments' => [
'type' => 'button',
'name' => 'melody_sound',
'label' => __('Test sound'),
'attributes' => ['icon' => 'sound'],
'return' => true,
],
],
],
];
// Print form.
$output .= HTML::printForm(
[
'form' => [
'action' => '',
'method' => 'POST',
],
'inputs' => $inputs,
],
true,
false
);
$output .= '';
$output .= '
';
$output .= '
';
$output .= __('Discovered alerts');
$output .= '
';
$output .= '
';
$output .= html_print_image(
'images/no-alerts-discovered.png',
true,
[
'title' => __('No alerts discovered'),
'class' => 'invert_filter',
]
);
$output .= '';
$output .= __('Congrats! there’s nothing to show');
$output .= '';
$output .= '
';
$output .= '
';
$output .= html_print_input_hidden(
'ajax_file_sound_console',
ui_get_full_url('ajax.php', false, false, false),
true
);
$output .= html_print_input_hidden(
'meta',
is_metaconsole(),
true
);
$output .= '
';
$output .= '
';
$output .= '
';
$output .= '
';
$output .= '';
$output .= '
';
$output .= '
';
$output .= '
';
echo $output;
?>
';
while (ob_get_length() > 0) {
ob_end_flush();
}
echo '';