zoneminder/web/ajax/modal.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
485 B
PHP
Raw Normal View History

2020-09-11 05:56:58 +08:00
<?php
if ( empty($_REQUEST['modal']) ) {
ajaxError('Modal Name Not Provided');
return;
}
2020-09-11 05:56:58 +08:00
$modal = validJsStr($_REQUEST['modal']);
$data = array();
ZM\Debug("Including modals/$modal.php");
# Shouldn't be necessary but at the moment we have last .conf file contents
ob_start();
@$result = include('modals/'.$modal.'.php');
$data['html'] = ob_get_contents();
ob_end_clean();
if ( !$result ) {
ajaxError("Unknown modal '".$modal."'");
return;
}
2020-09-11 05:56:58 +08:00
ajaxResponse($data);
return;
?>