Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
0677991a
Commit
0677991a
authored
Dec 08, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
www: also generate the page title for #461
parent
ebe08f4c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
27 deletions
+26
-27
fbegin.inc
src/www/fbegin.inc
+0
-23
guiconfig.inc
src/www/guiconfig.inc
+1
-2
head.inc
src/www/head.inc
+25
-2
No files found.
src/www/fbegin.inc
View file @
0677991a
...
...
@@ -66,29 +66,6 @@ if ($pagename == 'wizard.php') {
}
}
// link menu system
$menu
=
new
OPNsense\Base\Menu\MenuSystem
();
// add interfaces to "Interfaces" menu tab... kind of a hack, may need some improvement.
$cnf
=
OPNsense\Core\Config
::
getInstance
();
$ifarr
=
array
();
foreach
(
$cnf
->
object
()
->
interfaces
->
children
()
as
$key
=>
$node
)
{
$ifarr
[
$key
]
=
$node
->
descr
?
$node
->
descr
->
__toString
()
:
strtoupper
(
$key
);
}
natcasesort
(
$ifarr
);
$ordid
=
0
;
foreach
(
$ifarr
as
$key
=>
$descr
)
{
$menu
->
appendItem
(
'Interfaces'
,
$key
,
array
(
'url'
=>
'/interfaces.php?if='
.
$key
,
'visiblename'
=>
'['
.
$descr
.
']'
,
'cssclass'
=>
'fa fa-sitemap'
,
'order'
=>
$ordid
++
,
));
}
unset
(
$ifarr
);
$menuSystem
=
$menu
->
getItems
(
$_SERVER
[
'REQUEST_URI'
]);
$menuBreadcrumbs
=
$menu
->
getBreadcrumbs
();
$aclObj
=
new
\OPNsense\Core\ACL
();
/* display a top alert bar if need be */
...
...
src/www/guiconfig.inc
View file @
0677991a
...
...
@@ -297,9 +297,8 @@ function pprint_port($port) {
return
$pport
;
}
function
gentitle
(
$breadcrumbs
)
function
gentitle
(
$breadcrumbs
,
$navlevelsep
=
': '
)
{
$navlevelsep
=
': '
;
$output
=
$breadcrumbs
;
if
(
isset
(
$breadcrumbs
[
0
][
'name'
]))
{
...
...
src/www/head.inc
View file @
0677991a
...
...
@@ -13,10 +13,33 @@ function system_get_language_code() {
return
$code
;
}
// link menu system
$menu
=
new
OPNsense\Base\Menu\MenuSystem
();
// add interfaces to "Interfaces" menu tab... kind of a hack, may need some improvement.
$cnf
=
OPNsense\Core\Config
::
getInstance
();
$ifarr
=
array
();
foreach
(
$cnf
->
object
()
->
interfaces
->
children
()
as
$key
=>
$node
)
{
$ifarr
[
$key
]
=
$node
->
descr
?
$node
->
descr
->
__toString
()
:
strtoupper
(
$key
);
}
natcasesort
(
$ifarr
);
$ordid
=
0
;
foreach
(
$ifarr
as
$key
=>
$descr
)
{
$menu
->
appendItem
(
'Interfaces'
,
$key
,
array
(
'url'
=>
'/interfaces.php?if='
.
$key
,
'visiblename'
=>
'['
.
$descr
.
']'
,
'cssclass'
=>
'fa fa-sitemap'
,
'order'
=>
$ordid
++
,
));
}
unset
(
$ifarr
);
$menuSystem
=
$menu
->
getItems
(
$_SERVER
[
'REQUEST_URI'
]);
$menuBreadcrumbs
=
$menu
->
getBreadcrumbs
();
$g
[
'theme'
]
=
get_current_theme
();
$pagetitle
=
gentitle
(
$pgtitle
);
/* XXX zap me */
$pagetitle
=
gentitle
(
array_reverse
(
count
(
$menuBreadcrumbs
)
?
$menuBreadcrumbs
:
$pgtitle
),
' | '
);
$pagetitle
.=
sprintf
(
' | %s.%s'
,
$config
[
'system'
][
'hostname'
],
$config
[
'system'
][
'domain'
]);
?><!doctype html>
<!--[if IE 8 ]><html lang="
<?=
system_get_language_code
();
?>
" class="ie ie8 lte9 lte8 no-js"><![endif]-->
...
...
@@ -33,7 +56,7 @@ $pagetitle = gentitle( $pgtitle ); /* XXX zap me */
<meta
name=
"copyright"
content=
""
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
/>
<title>
<?
php
echo
(
$config
[
'system'
][
'hostname'
]
.
"."
.
$config
[
'system'
][
'domain'
]
.
" - "
.
$pagetitle
);
?>
</title>
<title>
<?
=
$pagetitle
?>
</title>
<!-- include (theme) style -->
<link
href=
"/ui/themes/
<?=
$g
[
'theme'
];
?>
/build/css/main.css"
media=
"screen, projection"
rel=
"stylesheet"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment