diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-10-12 19:32:14 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-10-12 19:32:14 +0000 |
commit | fe39586a31d0568d399944230784d2b97e2c1c70 (patch) | |
tree | 64e9244a9f6639c00260e79527a7baf05d0cd4d7 | |
parent | ca02851e1098a392b41612bf661b36159ab74764 (diff) | |
download | pfsense-fe39586a31d0568d399944230784d2b97e2c1c70.zip pfsense-fe39586a31d0568d399944230784d2b97e2c1c70.tar.gz |
If /usr/local/www/themes/$themename/tabcontrols.php exists, then eval
it and allow the tabbing colors and nifty corners to be overriden.
The file simply needs to look like:
<?php
$tab_active_bg = "#EEEEEE";
$tab_inactive_bg = "#777777";
$nifty_tabs_corners = "#FFF";
$font_color = "white";
?>
-rw-r--r-- | etc/inc/pfsense-utils.inc | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 91f3cd3..b8e0342 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -2318,35 +2318,46 @@ function display_top_tabs(& $tab_array) { unset ($tab_array); $tab_array = & $tab_temp; + $tab_active_bg = "#EEEEEE"; + $tab_inactive_bg = "#777777"; + $nifty_tabs_corners = "#FFF"; + $font_color = "white"; + + /* if tabcontrols.php exist for a theme, allow it to be overriden */ + $themename = $config['theme']; + $filename = "/usr/local/www/themes/{$themename}/tabcontrols.php"; + if(file_exists($filename)) + eval($filename); + echo "<table cellpadding='0' cellspacing='0'>\n"; echo " <tr>\n"; $tabscounter = 0; foreach ($tab_array as $ta) { if ($ta[1] == true) { - echo " <td bgcolor='#EEEEEE' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><div id='tabactive'></div></td>\n"; + echo " <td bgcolor='{$tab_active_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><div id='tabactive'></div></td>\n"; } else { - echo " <td bgcolor='#777777' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><div id='tabdeactive{$tabscounter}'></div></td>\n"; + echo " <td bgcolor='{$tab_inactive_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><div id='tabdeactive{$tabscounter}'></div></td>\n"; } $tabscounter++; } echo "</tr>\n<tr>\n"; foreach ($tab_array as $ta) { if ($ta[1] == true) { - echo " <td height=\"15\" valign=\"middle\" bgcolor='#EEEEEE' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><B> {$ta[0]}"; + echo " <td height=\"15\" valign=\"middle\" bgcolor='{$tab_active_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><B> {$ta[0]}"; echo " "; echo "<font size='-12'> </font></B></td>\n"; } else { - echo " <td height=\"15\" valign=\"middle\" bgcolor='#777777' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><B> <a href='{$ta[2]}'>"; - echo "<font color='white'>{$ta[0]}</font></a> "; + echo " <td height=\"15\" valign=\"middle\" bgcolor='{$tab_inactive_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><B> <a href='{$ta[2]}'>"; + echo "<font color='{$font_color}'>{$ta[0]}</font></a> "; echo "<font size='-12'> </font></B></td>\n"; } } echo "</tr>\n<tr>\n"; foreach ($tab_array as $ta) { if ($ta[1] == true) { - echo " <td bgcolor='#EEEEEE' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"></td>\n"; + echo " <td bgcolor='{$tab_active_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"></td>\n"; } else { - echo " <td bgcolor='#777777' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"></td>\n"; + echo " <td bgcolor='{$tab_inactive_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"></td>\n"; } $tabscounter++; } @@ -2355,9 +2366,9 @@ function display_top_tabs(& $tab_array) { echo "<script type=\"text/javascript\">"; echo "NiftyCheck();\n"; - echo "Rounded(\"div#tabactive\",\"top\",\"#FFF\",\"#EEEEEE\",\"smooth\");\n"; + echo "Rounded(\"div#tabactive\",\"top\",\"{$nifty_tabs_corners}\",\"{$tab_active_bg}\",\"smooth\");\n"; for ($x = 0; $x < $tabscounter; $x++) - echo "Rounded(\"div#tabdeactive{$x}\",\"top\",\"#FFF\",\"#777777\",\"smooth\");\n"; + echo "Rounded(\"div#tabdeactive{$x}\",\"top\",\"{$nifty_tabs_corners}\",\"{$tab_inactive_bg}\",\"smooth\");\n"; echo "</script>"; } |