Cleans up platform delete

main
Yasen Pramatarov 2024-10-30 17:03:42 +02:00
parent d51b16619f
commit 5327a82685
3 changed files with 4 additions and 4 deletions

View File

@ -113,6 +113,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
case 'platform': case 'platform':
if (isset($action) && $action === 'edit') { if (isset($action) && $action === 'edit') {
include '../app/templates/config-platform-edit.php'; include '../app/templates/config-platform-edit.php';
} elseif (isset($action) && $action === 'delete') {
include '../app/templates/config-platform-delete.php';
} else { } else {
if ($userObject->hasRight($user_id, 'view config file')) { if ($userObject->hasRight($user_id, 'view config file')) {
include '../app/templates/config-platform.php'; include '../app/templates/config-platform.php';
@ -170,8 +172,6 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_GET['agent'])) { if (isset($_GET['agent'])) {
$agentDetails = $agentObject->getAgentDetails($platform_id, $agent); $agentDetails = $agentObject->getAgentDetails($platform_id, $agent);
include '../app/templates/config-delete-agent.php'; include '../app/templates/config-delete-agent.php';
} else {
include '../app/templates/config-delete-platform.php';
} }
break; break;
} }

View File

@ -24,7 +24,7 @@ foreach ($platformDetails[0] as $key => $value) {
<input type="hidden" name="delete" value="true" /> <input type="hidden" name="delete" value="true" />
<p class="h5 text-danger">Are you sure you want to delete this platform?</p> <p class="h5 text-danger">Are you sure you want to delete this platform?</p>
<br /> <br />
<a class="btn btn-secondary" href="<?= htmlspecialchars($app_root) ?>?page=config#platform<?= htmlspecialchars($platform_id) ?>" />Cancel</a> <a class="btn btn-secondary" href="<?= htmlspecialchars($app_root) ?>?page=config&item=platform#platform<?= htmlspecialchars($platform_id) ?>" />Cancel</a>
<input type="submit" class="btn btn-danger" value="Delete" /> <input type="submit" class="btn btn-danger" value="Delete" />
</form> </form>
</div> </div>

View File

@ -28,7 +28,7 @@ foreach ($platformDetails[0] as $key => $value) {
<?php } ?> <?php } ?>
<br /> <br />
<input type="hidden" name="platform" value="<?= htmlspecialchars($platform_id) ?>" /> <input type="hidden" name="platform" value="<?= htmlspecialchars($platform_id) ?>" />
<a class="btn btn-secondary" href="<?= htmlspecialchars($app_root) ?>?page=config#platform<?= htmlspecialchars($platform_id) ?>" />Cancel</a> <a class="btn btn-secondary" href="<?= htmlspecialchars($app_root) ?>?page=config&item=platform#platform<?= htmlspecialchars($platform_id) ?>" />Cancel</a>
<input type="submit" class="btn btn-primary" value="Save" /> <input type="submit" class="btn btn-primary" value="Save" />
</form> </form>
</div> </div>