2012-02-14 Hirofumi Kosaka <kosaka@rworks.jp>
* include/functions_api.php: Added get_all_alert_templates function to API. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5583 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
34ee7aeac0
commit
33843e6cd3
|
@ -1,3 +1,8 @@
|
||||||
|
2012-02-14 Hirofumi Kosaka <kosaka@rworks.jp>
|
||||||
|
|
||||||
|
* include/functions_api.php: Added get_all_alert_templates
|
||||||
|
function to API.
|
||||||
|
|
||||||
2012-02-13 Miguel de Dios <miguel.dedios@artica.es>
|
2012-02-13 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* godmode/reporting/visual_console_builder.editor.js: fixed the resize
|
* godmode/reporting/visual_console_builder.editor.js: fixed the resize
|
||||||
|
|
|
@ -2209,6 +2209,42 @@ function set_delete_alert_template($id_template, $thrash1, $other, $thrash3) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all alert tamplates, and print all the result like a csv.
|
||||||
|
*
|
||||||
|
* @param $thrash1 Don't use.
|
||||||
|
* @param $thrash2 Don't use.
|
||||||
|
* @param array $other it's array, but only <csv_separator> is available.
|
||||||
|
* example:
|
||||||
|
*
|
||||||
|
* api.php?op=get&op2=all_alert_templates&return_type=csv&other=;
|
||||||
|
*
|
||||||
|
* @param $thrash3 Don't use.
|
||||||
|
*/
|
||||||
|
function get_all_alert_templates($thrash1, $thrash2, $other, $thrash3) {
|
||||||
|
|
||||||
|
if (!isset($other['data'][0]))
|
||||||
|
$separator = ';'; // by default
|
||||||
|
else
|
||||||
|
$separator = $other['data'][0];
|
||||||
|
|
||||||
|
$filter_templates = false;
|
||||||
|
|
||||||
|
$template = alerts_get_alert_templates();
|
||||||
|
|
||||||
|
if ($template !== false) {
|
||||||
|
$data['type'] = 'array';
|
||||||
|
$data['data'] = $template;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$template) {
|
||||||
|
returnError('error_get_all_alert_templates', __('Error getting all alert templates.'));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
returnData('csv', $data, ';');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an alert tamplate, and print the result like a csv.
|
* Get an alert tamplate, and print the result like a csv.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue