Commit 0d905150 authored by Franco Fichtner's avatar Franco Fichtner

system: simplify and prettify theme selection

parent e7916b44
...@@ -61,7 +61,6 @@ $g = array( ...@@ -61,7 +61,6 @@ $g = array(
"product_email" => "coreteam@opnsense.org", "product_email" => "coreteam@opnsense.org",
"hidedownloadbackup" => false, "hidedownloadbackup" => false,
"hidebackupbeforeupgrade" => false, "hidebackupbeforeupgrade" => false,
"disablethemeselection" => false,
"disablehelpmenu" => false, "disablehelpmenu" => false,
"disablehelpicon" => false, "disablehelpicon" => false,
"disablecrashreporter" => false, "disablecrashreporter" => false,
......
...@@ -1901,18 +1901,16 @@ function array_exclude($needle, $haystack) { ...@@ -1901,18 +1901,16 @@ function array_exclude($needle, $haystack) {
return $result; return $result;
} }
function get_current_theme() { function get_current_theme()
{
global $config, $g; global $config, $g;
/*
* if user has selected a custom template, use it. $theme = 'opnsense';
* otherwise default to pfsense tempalte
*/ if (isset($config['theme']) && is_dir('/usr/local/www/themes/' . $config['theme'])) {
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 = $config['theme']; $theme = $config['theme'];
else }
$theme = "opnsense";
return $theme; return $theme;
} }
......
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require("guiconfig.inc"); require_once("guiconfig.inc");
require_once("functions.inc"); require_once("functions.inc");
require_once("filter.inc"); require_once("filter.inc");
require_once("shaper.inc"); require_once("shaper.inc");
...@@ -164,10 +165,7 @@ if ($_POST) { ...@@ -164,10 +165,7 @@ if ($_POST) {
set_language($config['system']['language']); set_language($config['system']['language']);
} }
/* pfSense themes */ update_if_changed("System Theme", $config['theme'], $_POST['theme']);
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 */ /* XXX - billm: these still need updating after figuring out how to check if they actually changed */
$olddnsservers = $config['system']['dnsserver']; $olddnsservers = $config['system']['dnsserver'];
...@@ -466,19 +464,8 @@ include("head.inc"); ...@@ -466,19 +464,8 @@ include("head.inc");
</strong> </strong>
</td> </td>
</tr> </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> <tr>
<td width="22%" valign="top" class="vncell">&nbsp;</td> <td width="22%" valign="top" class="vncell"><?=gettext("Theme"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<select name="theme" class="selectpicker" data-style="btn-default" data-width="auto"> <select name="theme" class="selectpicker" data-style="btn-default" data-width="auto">
<?php <?php
...@@ -504,7 +491,6 @@ include("head.inc"); ...@@ -504,7 +491,6 @@ include("head.inc");
</strong> </strong>
</td> </td>
</tr> </tr>
<?php endif; ?>
<tr> <tr>
<td width="22%" valign="top">&nbsp;</td> <td width="22%" valign="top">&nbsp;</td>
<td width="78%"> <td width="78%">
......
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