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
0d905150
Commit
0d905150
authored
Feb 22, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: simplify and prettify theme selection
parent
e7916b44
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
29 deletions
+12
-29
globals.inc
src/etc/inc/globals.inc
+0
-1
util.inc
src/etc/inc/util.inc
+8
-10
system.php
src/www/system.php
+4
-18
No files found.
src/etc/inc/globals.inc
View file @
0d905150
...
...
@@ -61,7 +61,6 @@ $g = array(
"product_email"
=>
"coreteam@opnsense.org"
,
"hidedownloadbackup"
=>
false
,
"hidebackupbeforeupgrade"
=>
false
,
"disablethemeselection"
=>
false
,
"disablehelpmenu"
=>
false
,
"disablehelpicon"
=>
false
,
"disablecrashreporter"
=>
false
,
...
...
src/etc/inc/util.inc
View file @
0d905150
...
...
@@ -1901,18 +1901,16 @@ function array_exclude($needle, $haystack) {
return
$result
;
}
function
get_current_theme
()
{
function
get_current_theme
()
{
global
$config
,
$g
;
/*
* if user has selected a custom template, use it.
* otherwise default to pfsense tempalte
*/
if
((
$g
[
"disablethemeselection"
]
===
true
)
&&
!
empty
(
$g
[
"default_theme"
])
&&
(
is_dir
(
$g
[
"www_path"
]
.
'/themes/'
.
$g
[
"default_theme"
])))
$theme
=
$g
[
"default_theme"
];
elseif
(
$config
[
'theme'
]
<>
""
&&
(
is_dir
(
$g
[
"www_path"
]
.
'/themes/'
.
$config
[
'theme'
])))
$theme
=
'opnsense'
;
if
(
isset
(
$config
[
'theme'
])
&&
is_dir
(
'/usr/local/www/themes/'
.
$config
[
'theme'
]))
{
$theme
=
$config
[
'theme'
];
else
$theme
=
"opnsense"
;
}
return
$theme
;
}
...
...
src/www/system.php
View file @
0d905150
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
...
...
@@ -26,7 +27,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
require
(
"guiconfig.inc"
);
require
_once
(
"guiconfig.inc"
);
require_once
(
"functions.inc"
);
require_once
(
"filter.inc"
);
require_once
(
"shaper.inc"
);
...
...
@@ -164,10 +165,7 @@ if ($_POST) {
set_language
(
$config
[
'system'
][
'language'
]);
}
/* pfSense themes */
if
(
!
$g
[
'disablethemeselection'
])
{
update_if_changed
(
"System Theme"
,
$config
[
'theme'
],
$_POST
[
'theme'
]);
}
/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
$olddnsservers
=
$config
[
'system'
][
'dnsserver'
];
...
...
@@ -466,19 +464,8 @@ include("head.inc");
</strong>
</td>
</tr>
</tbody>
</table>
<?php
if
(
!
$g
[
'disablethemeselection'
])
:
?>
<table
width=
"100%"
border=
"0"
cellpadding=
"6"
cellspacing=
"0"
summary=
"main area"
class=
"table table-striped"
>
<thead>
<tr>
<th
colspan=
"2"
valign=
"top"
class=
"listtopic"
>
<?=
gettext
(
"Theme"
);
?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td
width=
"22%"
valign=
"top"
class=
"vncell"
>
</td>
<td
width=
"22%"
valign=
"top"
class=
"vncell"
>
<?=
gettext
(
"Theme"
);
?>
</td>
<td
width=
"78%"
class=
"vtable"
>
<select
name=
"theme"
class=
"selectpicker"
data-style=
"btn-default"
data-width=
"auto"
>
<?php
...
...
@@ -504,7 +491,6 @@ include("head.inc");
</strong>
</td>
</tr>
<?php
endif
;
?>
<tr>
<td
width=
"22%"
valign=
"top"
>
</td>
<td
width=
"78%"
>
...
...
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