small code cleanup

This commit is contained in:
2023-10-22 05:28:11 +02:00
parent 0441d71f41
commit 5ab1feac4f
3 changed files with 28 additions and 37 deletions

View File

@@ -30,7 +30,7 @@ function debug ($text) {
/**
* Echoes HTML code to display all collected error messages
*/
function insertErrorsHtml() {
function echoErrorsHtml() {
global $_ERRORS;
if (count ($_ERRORS) == 0) return;
@@ -61,13 +61,29 @@ function insertErrorsHtml() {
}
/**
* Hides the dialog box asking for an ICS URL if one
* was already specified by the user
* Shows a dialog box asking for an ICS URL if one
* was not specified by the user
*/
function hideMissingIcsDialog () {
function echoIcsUrlDialog () {
global $_GET;
if (isset ($_GET["ics_url"]) && $_GET["ics_url"] != "") {
echo "hidden";
if (!isset ($_GET["ics_url"]) || $_GET["ics_url"] == "") {
echo '
<!-- Dialog to ask user for ICS URL if not specified through GET -->
<div class="dialog-parent <?php hideMissingIcsDialog(); ?>">
<div class="dialog">
<div class="dialog-content">
Es wurde keine ICS URL als GET Parameter &uuml;bergeben.<br>
<br>
<label>Anzuzeigende ICS URL:</label>
<input type="text" form="dialog-form" name="ics_url" />
</div>
<div class="dialog-buttons">
<form id="dialog-form" method="get"></form>
<input type="submit" form="dialog-form" value="OK" />
</div>
</div>
</div>
';
}
}