1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Create loadFooterScripts(), update page_actions + formatting

This commit is contained in:
billz 2023-09-15 20:02:37 +02:00
parent 66b3b20bf4
commit 0116d87445
3 changed files with 40 additions and 44 deletions

View File

@ -819,3 +819,15 @@ function getTooltip($msg, $id, $visible = true, $data_html = false)
echo '<i class="fas fa-question-circle text-muted ' .$opt1.'" id="' .$id. '" data-toggle="tooltip" ' .$opt2. ' data-placement="auto" title="' . _($msg). '"></i>';
}
// Load non default JS/ECMAScript in footer
function loadFooterScripts($extraFooterScripts)
{
foreach ($extraFooterScripts as $script) {
echo '<script type="text/javascript" src="' , $script['src'] , '"';
if ($script['defer']) {
echo ' defer="defer"';
}
echo '></script>' , PHP_EOL;
}
}

View File

@ -13,7 +13,7 @@
DisplayWPAConfig();
break;
case "/network_conf":
DisplayNetworkingConfig($extraFooterScripts);
DisplayNetworkingConfig();
break;
case "/hostapd_conf":
DisplayHostAPDConfig();
@ -30,12 +30,6 @@
case "/torproxy_conf":
DisplayTorProxyConfig();
break;
case "/firewall_conf":
DisplayFirewallConfig();
break;
case "/ddclient_conf":
DisplayDDClientConfig();
break;
case "/auth_conf":
DisplayAuthConfig($_SESSION['user_id']);
break;
@ -54,4 +48,5 @@
default:
DisplayDashboard($extraFooterScripts);
}
?>
?>

View File

@ -4,12 +4,12 @@
* Raspbian WiFi Configuration Portal (RaspAP)
*
* Simple AP setup & WiFi management for Debian-based devices.
* Enables use of simple web interface rather than SSH to control WiFi and related services on the Raspberry Pi.
* Enables use of simple web interface rather than SSH to control WiFi and related services on the Raspberry Pi.
* Recommended distribution is Raspberry Pi OS (64-bit) Lite. Specific instructions to install the supported software are
* in the README and original post by @SirLagz. For a quick run through, the packages required for the WebGUI are:
* lighttpd (version 1.4.59 installed via apt)
* php-cgi (version 7.4.33 installed via apt)
* along with their supporting packages, php7.3 will also need to be enabled.
* along with their supporting packages, php7.4 will also need to be enabled.
*
* @author Lawrence Yau <sirlagz@gmail.com>
* @author Bill Zimmerman <billzimmerman@gmail.com>
@ -104,30 +104,28 @@ initializeApp();
<!-- Sidebar -->
<?php require_once 'includes/sidebar.php'; ?>
<!-- End of Sidebar -->
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column">
<!-- Main Content -->
<div id="content">
<!-- Topbar -->
<?php require_once 'includes/navbar.php'; ?>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid">
<?php require_once 'includes/page_actions.php'; ?>
</div><!-- /.container-fluid -->
</div><!-- End of Main Content -->
<!-- Footer -->
<footer class="sticky-footer bg-grey-100">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span></span>
</div>
</div>
</footer>
<!-- End Footer -->
</div><!-- End of Content Wrapper -->
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column">
<!-- Main Content -->
<div id="content">
<!-- Topbar -->
<?php require_once 'includes/navbar.php'; ?>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid">
<?php require_once 'includes/page_actions.php'; ?>
</div><!-- /.container-fluid -->
</div><!-- End of Main Content -->
<!-- Footer -->
<footer class="sticky-footer bg-grey-100">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span></span>
</div>
</div>
</footer>
<!-- End Footer -->
</div><!-- End of Content Wrapper -->
</div><!-- End of Page Wrapper -->
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top" style="display: inline;">
@ -152,15 +150,6 @@ initializeApp();
<!-- Custom RaspAP JS -->
<script src="app/js/custom.js"></script>
<?php
// Load non default JS/ECMAScript in footer.
foreach ($extraFooterScripts as $script) {
echo '<script type="text/javascript" src="' , $script['src'] , '"';
if ($script['defer']) {
echo ' defer="defer"';
}
echo '></script>' , PHP_EOL;
}
?>
<?php loadFooterScripts($extraFooterScripts); ?>
</body>
</html>