Commit c95615ba authored by Ad Schellevis's avatar Ad Schellevis

(legacy) tabs to spaces in head.inc

parent 7aefb9f8
<?php <?php
function system_get_language_code() { function system_get_language_code() {
global $config; global $config;
$code = "en-US"; // Set default code. $code = "en-US"; // Set default code.
// a language code, as per [RFC3066] // a language code, as per [RFC3066]
if (isset($config['system']['language'])) { if (isset($config['system']['language'])) {
$language = $config['system']['language']; $language = $config['system']['language'];
$code = str_replace("_", "-", $language); $code = str_replace("_", "-", $language);
} }
return $code; return $code;
} }
// link menu system // link menu system
...@@ -37,8 +37,8 @@ $menuSystem = $menu->getItems($_SERVER['REQUEST_URI']); ...@@ -37,8 +37,8 @@ $menuSystem = $menu->getItems($_SERVER['REQUEST_URI']);
/* XXX workaround for dashboard */ /* XXX workaround for dashboard */
if (!isset($menuBreadcrumbs)) { if (!isset($menuBreadcrumbs)) {
/* XXX generating breadcrumbs requires getItems() call */ /* XXX generating breadcrumbs requires getItems() call */
$menuBreadcrumbs = $menu->getBreadcrumbs(); $menuBreadcrumbs = $menu->getBreadcrumbs();
} }
$g['theme'] = get_current_theme(); $g['theme'] = get_current_theme();
...@@ -50,145 +50,143 @@ $pagetitle .= sprintf(' | %s.%s', $config['system']['hostname'], $config['system ...@@ -50,145 +50,143 @@ $pagetitle .= sprintf(' | %s.%s', $config['system']['hostname'], $config['system
<!--[if IE 8 ]><html lang="<?=system_get_language_code();?>" class="ie ie8 lte9 lte8 no-js"><![endif]--> <!--[if IE 8 ]><html lang="<?=system_get_language_code();?>" class="ie ie8 lte9 lte8 no-js"><![endif]-->
<!--[if IE 9 ]><html lang="<?=system_get_language_code();?>" class="ie ie9 lte9 no-js"><![endif]--> <!--[if IE 9 ]><html lang="<?=system_get_language_code();?>" class="ie ie9 lte9 no-js"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="<?=system_get_language_code();?>" class="no-js"><!--<![endif]--> <!--[if (gt IE 9)|!(IE)]><!--><html lang="<?=system_get_language_code();?>" class="no-js"><!--<![endif]-->
<head> <head>
<meta charset="UTF-8" />
<meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="robots" content="index, follow, noodp, noydir" />
<meta name="robots" content="index, follow, noodp, noydir" /> <meta name="keywords" content="" />
<meta name="keywords" content="" /> <meta name="description" content="" />
<meta name="description" content="" /> <meta name="copyright" content="" />
<meta name="copyright" content="" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title><?= $pagetitle ?></title>
<title><?= $pagetitle ?></title>
<!-- include (theme) style -->
<!-- include (theme) style --> <link href="/ui/themes/<?=$g['theme'];?>/build/css/main.css" media="screen, projection" rel="stylesheet">
<link href="/ui/themes/<?=$g['theme'];?>/build/css/main.css" media="screen, projection" rel="stylesheet">
<!-- TODO: move to theme style -->
<!-- TODO: move to theme style --> <style>
<style> .menu-level-3-item {
.menu-level-3-item { font-size: 90%;
font-size: 90%; padding-left: 54px !important;
padding-left: 54px !important; }
} </style>
</style>
<!-- Favicon -->
<!-- Favicon --> <link href="/ui/themes/<?=$g['theme'];?>/build/images/favicon.png" rel="shortcut icon">
<link href="/ui/themes/<?=$g['theme'];?>/build/images/favicon.png" rel="shortcut icon">
<!-- Stylesheet for fancy select/dropdown -->
<!-- Stylesheet for fancy select/dropdown --> <link rel="stylesheet" type="text/css" href="/ui/themes/<?=$g['theme'];?>/build/css/bootstrap-select.css">
<link rel="stylesheet" type="text/css" href="/ui/themes/<?=$g['theme'];?>/build/css/bootstrap-select.css">
<!-- bootstrap dialog -->
<!-- bootstrap dialog --> <link href="/ui/themes/<?=$g['theme'];?>/build/css/bootstrap-dialog.css" rel="stylesheet" type="text/css" />
<link href="/ui/themes/<?=$g['theme'];?>/build/css/bootstrap-dialog.css" rel="stylesheet" type="text/css" />
<!-- Font awesome -->
<!-- Font awesome --> <link rel="stylesheet" href="/ui/css/font-awesome.min.css">
<link rel="stylesheet" href="/ui/css/font-awesome.min.css">
<!--[if lt IE 9]><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><![endif]-->
<!--[if lt IE 9]><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><![endif]-->
<!-- nvd3 -->
<!-- nvd3 --> <link rel="stylesheet" href="/ui/css/nv.d3.css">
<link rel="stylesheet" href="/ui/css/nv.d3.css">
<script>var theme = '<?=$g['theme'];?>'; </script>
<script>var theme = '<?=$g['theme'];?>'; </script>
<!-- JQuery -->
<!-- JQuery --> <script type="text/javascript" src="/ui/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="/ui/js/jquery-1.11.2.min.js"></script>
<!-- Ticker used for notices-->
<!-- Ticker used for notices--> <script type="text/javascript" src="/javascript/ticker.js"></script>
<script type="text/javascript" src="/javascript/ticker.js"></script>
<!-- d3 -->
<!-- d3 --> <script type="text/javascript" src="/ui/js/d3.min.js"></script>
<script type="text/javascript" src="/ui/js/d3.min.js"></script>
<!-- nvd3 -->
<!-- nvd3 --> <script type="text/javascript" src="/ui/js/nv.d3.min.js"></script>
<script type="text/javascript" src="/ui/js/nv.d3.min.js"></script>
<!-- append some helper functions to integrate into the legacy code -->
<!-- append some helper functions to integrate into the legacy code --> <script type="text/javascript" src="/javascript/opnsense_legacy.js"></script>
<script type="text/javascript" src="/javascript/opnsense_legacy.js"></script>
<?php
<?php /*
/* * Find all javascript files that need to be included
* Find all javascript files that need to be included * for this page ... from the arrays ... :)
* for this page ... from the arrays ... :) * Coded by: Erik Kristensen
* Coded by: Erik Kristensen */
*/
$dir = trim(basename($_SERVER['SCRIPT_FILENAME'], '.php'));
$dir = trim(basename($_SERVER['SCRIPT_FILENAME'], '.php')); $path = '/usr/local/www/javascript/' . $dir . '/';
$path = '/usr/local/www/javascript/' . $dir . '/'; if (is_dir($path)) {
if (is_dir($path)) { if ($dh = opendir($path)) {
if ($dh = opendir($path)) { while (($file = readdir($dh)) !== false) {
while (($file = readdir($dh)) !== false) { if (is_dir($file))
if (is_dir($file)) continue;
continue; echo "\t<script type=\"text/javascript\" src=\"/javascript/{$dir}/{$file}\"></script>\n";
echo "\t<script type=\"text/javascript\" src=\"/javascript/{$dir}/{$file}\"></script>\n"; }
} closedir($dh);
closedir($dh); }
} }
}
?>
?>
<?php if (basename($_SERVER["SCRIPT_FILENAME"] != "index.php")): ?>
<?php if (basename($_SERVER["SCRIPT_FILENAME"] != "index.php")): ?> <script type="text/javascript">
<script type="text/javascript"> //<![CDATA[
//<![CDATA[ $( document ).ready(function() {
$( document ).ready(function() { $('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="tooltip"]').tooltip(); $("input").attr("autocomplete","off");
$("input").attr("autocomplete","off"); // hide empty menu items
// hide empty menu items $('#mainmenu > div > .collapse').each(function(){
$('#mainmenu > div > .collapse').each(function(){ // cleanup empty second level menu containers
// cleanup empty second level menu containers $(this).find("div.collapse").each(function(){
$(this).find("div.collapse").each(function(){ if ($(this).children().length == 0 ) {
if ($(this).children().length == 0 ) { $("#mainmenu").find('[href="#'+$(this).attr('id')+'"]').remove();
$("#mainmenu").find('[href="#'+$(this).attr('id')+'"]').remove(); $(this).remove();
$(this).remove(); }
} });
});
// cleanup empty first level menu items
// cleanup empty first level menu items if ($(this).children().length == 0) {
if ($(this).children().length == 0) { $("#mainmenu").find('[href="#'+$(this).attr('id')+'"]').remove();
$("#mainmenu").find('[href="#'+$(this).attr('id')+'"]').remove(); }
} });
});
// link showhelp class behavior
// link showhelp class behavior $("a[class='showhelp']").click(function (event) {
$("a[class='showhelp']").click(function (event) { $("*[for='" + $(this).attr('id') + "']").toggleClass("hidden show");
$("*[for='" + $(this).attr('id') + "']").toggleClass("hidden show"); event.preventDefault();
event.preventDefault(); });
});
// handle all help messages show/hide
// handle all help messages show/hide $('[id*="show_all_help"]').click(function(event) {
$('[id*="show_all_help"]').click(function(event) { $('[id*="show_all_help"]').toggleClass("fa-toggle-on fa-toggle-off");
$('[id*="show_all_help"]').toggleClass("fa-toggle-on fa-toggle-off"); $('[id*="show_all_help"]').toggleClass("text-success text-danger");
$('[id*="show_all_help"]').toggleClass("text-success text-danger"); if ($('[id*="show_all_help"]').hasClass("fa-toggle-on")) {
if ($('[id*="show_all_help"]').hasClass("fa-toggle-on")) { $('[for*="help_for"]').addClass("show");
$('[for*="help_for"]').addClass("show"); $('[for*="help_for"]').removeClass("hidden");
$('[for*="help_for"]').removeClass("hidden"); } else {
} else { $('[for*="help_for"]').addClass("hidden");
$('[for*="help_for"]').addClass("hidden"); $('[for*="help_for"]').removeClass("show");
$('[for*="help_for"]').removeClass("show"); }
} event.preventDefault();
event.preventDefault(); });
});
// hide submenu items
// hide submenu items $('#mainmenu .list-group-item').click(function(){
$('#mainmenu .list-group-item').click(function(){ if($(this).attr('href').substring(0,1) == '#') {
if($(this).attr('href').substring(0,1) == '#') { $('#mainmenu .list-group-item').each(function(){
$('#mainmenu .list-group-item').each(function(){ if ($(this).attr('aria-expanded') == 'true' && $(this).data('parent') != '#mainmenu') {
if ($(this).attr('aria-expanded') == 'true' && $(this).data('parent') != '#mainmenu') { $("#"+$(this).attr('href').substring(1,999)).collapse('hide');
$("#"+$(this).attr('href').substring(1,999)).collapse('hide'); }
} });
}); }
} });
}); });
//]]>
}); </script>
//]]>
</script> <?php endif; ?>
<?php endif; ?>
<?php if (!isset($closehead) || !$closehead):?></head><?php endif;?> <?php if (!isset($closehead) || !$closehead):?></head><?php endif;?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment