Added an option to force a certian theme on users

This commit is contained in:
jengo 2001-04-27 10:02:33 +00:00
parent dce1ad12c8
commit 955bf76715
5 changed files with 76 additions and 13 deletions

View File

@ -1,3 +1,6 @@
[0.9.12]
- Created a config option to force users to use a certian theme.
[0.9.10]
- Fixed the cron programs, they where out of date in the table structures
- Added the ["flags"]["nofooter"] . ["flags"]["noappfooter"] flags.

View File

@ -334,20 +334,41 @@
}
}
include(PHPGW_SERVER_ROOT . "/phpgwapi/themes/" .
$phpgw_info["user"]["preferences"]["common"]["theme"] . ".theme");
if ($phpgw_info['server']['force_theme'] == 'user_choice')
{
@include(PHPGW_SERVER_ROOT . '/phpgwapi/themes/' . $phpgw_info['user']['preferences']['common']['theme'] . '.theme');
if ($phpgw_info["theme"]["bg_color"] == "") {
/* Looks like there was a problem finding that theme. Try the default */
echo "Warning: error locating selected theme";
include (PHPGW_SERVER_ROOT . "/phpgwapi/themes/default.theme");
if ($phpgw_info["theme"]["bg_color"] == "") {
/* Hope we don't get to this point. Better then the user seeing a */
/* complety back screen and not know whats going on */
echo "<body bgcolor=FFFFFF>Fatal error: no themes found";
exit;
if ($phpgw_info['theme']['bg_color'] == '')
{
/* Looks like there was a problem finding that theme. Try the default */
echo 'Warning: error locating selected theme';
include (PHPGW_SERVER_ROOT . '/phpgwapi/themes/default.theme');
if ($phpgw_info['theme']['bg_color'] == '')
{
/* Hope we don't get to this point. Better then the user seeing a */
/* complety back screen and not know whats going on */
echo '<body bgcolor="FFFFFF"><b>Fatal error: no themes found</b>';
exit;
}
}
}
else
{
@include(PHPGW_SERVER_ROOT . '/phpgwapi/themes/' . $phpgw_info['server']['force_theme'] . '.theme');
if ($phpgw_info['theme']['bg_color'] == '')
{
/* Looks like there was a problem finding that theme. Try the default */
echo 'Warning: error locating selected theme';
include (PHPGW_SERVER_ROOT . '/phpgwapi/themes/default.theme');
if ($phpgw_info['theme']['bg_color'] == '')
{
/* Hope we don't get to this point. Better then the user seeing a */
/* complety back screen and not know whats going on */
echo '<body bgcolor="FFFFFF"><b>Fatal error: no themes found</b>';
exit;
}
}
}
/*************************************************************************\
* If they are using frames, we need to set some variables *

View File

@ -87,6 +87,7 @@
</tr>
<?php } ?>
<?php if ($phpgw_info["server"]["force_theme"] == "user_choice"){ ?>
<tr>
<?php $selected_theme[$phpgw_info["user"]["preferences"]["common"]["theme"]] = " selected"; ?>
<td><?php echo lang("Theme (colors/fonts) Selection") . ":"; ?><br></td>
@ -101,6 +102,8 @@
</select>
</td>
</tr>
<?php } ?>
<tr>
<td><?php echo lang("Show navigation bar as"); ?>: </td>
<td>

View File

@ -39,6 +39,27 @@
</tr>
<?php $selected = array(); ?>
<?php $selected[$current_config["force_theme"]] = " selected"; ?>
<tr bgcolor="e6e6e6">
<td>Use theme:<br></td>
<td>
<select name="newsettings[force_theme]">
<?php
$themes = $phpgw_setup->list_themes();
echo '<option value="user_choice"' . $selected['user_choice'] . '>Users Choice</option>';
while (list ($key, $value) = each ($themes))
{
echo '<option value="'.$value.'" '.$selected[$value].'>'.$value.'</option>';
}
?>
</select>
</td>
</tr>
<?php $selected = array(); ?>
<?php/* $selected[$current_config["useframes"]] = " selected"; ?>
<tr bgcolor="e6e6e6">
<td>Frame support:</td>

View File

@ -24,7 +24,7 @@
echo "</head>\n";
echo "<BODY BGCOLOR=\"FFFFFF\" margintop=\"0\" marginleft=\"0\" marginright=\"0\" marginbottom=\"0\">";
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\"><tr>";
echo " <td align=\"left\" bgcolor=\"486591\">&nbsp;<font color=\"fefefe\">phpGroupWare version ".$phpgw_info["server"]["versions"]["phpgwapi"]." - 'All your base are belong to us' setup</font></td>";
echo " <td align=\"left\" bgcolor=\"486591\">&nbsp;<font color=\"fefefe\">phpGroupWare version ".$phpgw_info["server"]["versions"]["phpgwapi"]." setup</font></td>";
echo " <td align=\"right\" bgcolor=\"486591\">";
if ($nologoutbutton) {
echo "&nbsp;</td>";
@ -332,7 +332,22 @@
reset ($list);
return $list;
}
function list_themes()
{
$dh = opendir(PHPGW_SERVER_ROOT . '/phpgwapi/themes');
while ($file = readdir($dh))
{
if (eregi("\.theme$", $file))
{
$list[] = substr($file,0,strpos($file,'.'));
}
}
//$dh->close();
reset ($list);
return $list;
}
function app_setups($appname = ""){
global $phpgw_info;
$d = dir(PHPGW_SERVER_ROOT);