convert delconfirm function to php file

This commit is contained in:
Andrew Bauer 2020-09-18 09:43:29 -05:00
parent 6e6b9a464b
commit 1b2f0514b9
3 changed files with 24 additions and 30 deletions

View File

@ -9,9 +9,6 @@ $modal = validJsStr($_REQUEST['modal']);
$data = array(); $data = array();
switch ( $modal ) { switch ( $modal ) {
case 'delconfirm' :
$data['html'] = getDelConfirmHTML();
break;
case 'storage' : case 'storage' :
if ( !isset($_REQUEST['id']) ) ajaxError('Storage Id Not Provided'); if ( !isset($_REQUEST['id']) ) ajaxError('Storage Id Not Provided');
$data['html'] = getStorageModalHTML($_REQUEST['id']); $data['html'] = getStorageModalHTML($_REQUEST['id']);

View File

@ -0,0 +1,24 @@
<?php
// This is the HTML representing the Delete confirmation modal on the Events page
?>
<div id="deleteConfirm" class="modal fade" class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete Confirmation</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p><?php echo translate('ConfirmDeleteEvents') ?></p>
</div>
<div class="modal-footer">
<button id="delCancelBtn" type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo translate('Cancel') ?></button>
<button id ="delConfirmBtn" type="button" class="btn btn-danger"><?php echo translate('Delete') ?></button>
</div>
</div>
</div>
</div>

View File

@ -815,33 +815,6 @@ function getStatsTableHTML($eid, $fid, $row='') {
return $result; return $result;
} }
// This is the HTML representing the Delete confirmation modal on the Events page
function getDelConfirmHTML() {
$result = '';
$result .= '<div id="deleteConfirm" class="modal fade" class="modal" tabindex="-1">'.PHP_EOL;
$result .= '<div class="modal-dialog">'.PHP_EOL;
$result .= '<div class="modal-content">'.PHP_EOL;
$result .= '<div class="modal-header">'.PHP_EOL;
$result .= '<h5 class="modal-title">Delete Confirmation</h5>'.PHP_EOL;
$result .= '<button type="button" class="close" data-dismiss="modal" aria-label="Close">'.PHP_EOL;
$result .= '<span aria-hidden="true">&times;</span>'.PHP_EOL;
$result .= '</button>'.PHP_EOL;
$result .= '</div>'.PHP_EOL;
$result .= '<div class="modal-body">'.PHP_EOL;
$result .= '<p>' .translate('ConfirmDeleteEvents'). '</p>'.PHP_EOL;
$result .= '</div>'.PHP_EOL;
$result .= '<div class="modal-footer">'.PHP_EOL;
$result .= '<button id="delCancelBtn" type="button" class="btn btn-secondary" data-dismiss="modal">' .translate('Cancel'). '</button>'.PHP_EOL;
$result .= '<button id ="delConfirmBtn" type="button" class="btn btn-danger">' .translate('Delete'). '</button>'.PHP_EOL;
$result .= '</div>'.PHP_EOL;
$result .= '</div>'.PHP_EOL;
$result .= '</div>'.PHP_EOL;
$result .= '</div>'.PHP_EOL;
return $result;
}
function getStorageModalHTML($sid) { function getStorageModalHTML($sid) {
$result = ''; $result = '';
$null = ''; $null = '';