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

View File

@ -4,12 +4,12 @@
* Raspbian WiFi Configuration Portal (RaspAP) * Raspbian WiFi Configuration Portal (RaspAP)
* *
* Simple AP setup & WiFi management for Debian-based devices. * 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 * 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: * 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) * lighttpd (version 1.4.59 installed via apt)
* php-cgi (version 7.4.33 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 Lawrence Yau <sirlagz@gmail.com>
* @author Bill Zimmerman <billzimmerman@gmail.com> * @author Bill Zimmerman <billzimmerman@gmail.com>
@ -104,30 +104,28 @@ initializeApp();
<!-- Sidebar --> <!-- Sidebar -->
<?php require_once 'includes/sidebar.php'; ?> <?php require_once 'includes/sidebar.php'; ?>
<!-- End of Sidebar --> <!-- End of Sidebar -->
<!-- Content Wrapper -->
<!-- Content Wrapper --> <div id="content-wrapper" class="d-flex flex-column">
<div id="content-wrapper" class="d-flex flex-column"> <!-- Main Content -->
<div id="content">
<!-- Main Content --> <!-- Topbar -->
<div id="content"> <?php require_once 'includes/navbar.php'; ?>
<!-- Topbar --> <!-- End of Topbar -->
<?php require_once 'includes/navbar.php'; ?> <!-- Begin Page Content -->
<!-- End of Topbar --> <div class="container-fluid">
<!-- Begin Page Content --> <?php require_once 'includes/page_actions.php'; ?>
<div class="container-fluid"> </div><!-- /.container-fluid -->
<?php require_once 'includes/page_actions.php'; ?> </div><!-- End of Main Content -->
</div><!-- /.container-fluid --> <!-- Footer -->
</div><!-- End of Main Content --> <footer class="sticky-footer bg-grey-100">
<!-- Footer --> <div class="container my-auto">
<footer class="sticky-footer bg-grey-100"> <div class="copyright text-center my-auto">
<div class="container my-auto"> <span></span>
<div class="copyright text-center my-auto"> </div>
<span></span> </div>
</div> </footer>
</div> <!-- End Footer -->
</footer> </div><!-- End of Content Wrapper -->
<!-- End Footer -->
</div><!-- End of Content Wrapper -->
</div><!-- End of Page Wrapper --> </div><!-- End of Page Wrapper -->
<!-- Scroll to Top Button--> <!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top" style="display: inline;"> <a class="scroll-to-top rounded" href="#page-top" style="display: inline;">
@ -152,15 +150,6 @@ initializeApp();
<!-- Custom RaspAP JS --> <!-- Custom RaspAP JS -->
<script src="app/js/custom.js"></script> <script src="app/js/custom.js"></script>
<?php <?php loadFooterScripts($extraFooterScripts); ?>
// 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;
}
?>
</body> </body>
</html> </html>