Start page is a required select box with the option of putting in a custom value

This commit is contained in:
johnnyq
2023-11-08 22:17:51 -05:00
parent 5bd4c32f4d
commit 88a6fdd36d
2 changed files with 33 additions and 11 deletions
+12
View File
@@ -107,6 +107,9 @@ $config_theme_mode = "dark_mode";
// Telemetry
$config_telemetry = intval($row['config_telemetry']);
// Select Arrays
$colors_array = array (
'blue',
'green',
@@ -208,3 +211,12 @@ $ticket_status_array = array(
'Scheduled',
'Closed'
);
$start_page_select_array = array (
'dashboard.php'=>'Personal Dashboard',
'dashboard_financial.php'=>'Administrative Dashboard',
'dashboard_technical.php' => 'Technical Dashboard',
'clients.php'=> 'Client Management',
'tickets.php'=> 'Support Tickets',
'invoices.php' => 'Invoices'
);
+11 -1
View File
@@ -16,7 +16,17 @@ require_once "inc_all_settings.php";
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-home"></i></span>
</div>
<input type="text" class="form-control" name="start_page" value="<?php echo nullable_htmlentities($config_start_page); ?>">
<select class="form-control select2" name="start_page" data-tags="true" required>
<?php if (!in_array($config_start_page, array_keys($start_page_select_array))) { ?>
<option selected> <?php echo nullable_htmlentities($config_start_page); ?></option>
<?php } ?>
<?php foreach ($start_page_select_array as $start_page_value => $start_page_name) { ?>
<option <?php if ($start_page_value == $config_start_page) { echo "selected"; } ?>
value="<?php echo nullable_htmlentities($start_page_value); ?>">
<?php echo nullable_htmlentities($start_page_name); ?>
</option>
<?php }?>
</select>
</div>
</div>