forked from extern/egroupware
Added an option to force a certian theme on users
This commit is contained in:
parent
dce1ad12c8
commit
955bf76715
@ -1,3 +1,6 @@
|
|||||||
|
[0.9.12]
|
||||||
|
- Created a config option to force users to use a certian theme.
|
||||||
|
|
||||||
[0.9.10]
|
[0.9.10]
|
||||||
- Fixed the cron programs, they where out of date in the table structures
|
- Fixed the cron programs, they where out of date in the table structures
|
||||||
- Added the ["flags"]["nofooter"] . ["flags"]["noappfooter"] flags.
|
- Added the ["flags"]["nofooter"] . ["flags"]["noappfooter"] flags.
|
||||||
|
@ -334,20 +334,41 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include(PHPGW_SERVER_ROOT . "/phpgwapi/themes/" .
|
if ($phpgw_info['server']['force_theme'] == 'user_choice')
|
||||||
$phpgw_info["user"]["preferences"]["common"]["theme"] . ".theme");
|
{
|
||||||
|
@include(PHPGW_SERVER_ROOT . '/phpgwapi/themes/' . $phpgw_info['user']['preferences']['common']['theme'] . '.theme');
|
||||||
|
|
||||||
if ($phpgw_info["theme"]["bg_color"] == "") {
|
if ($phpgw_info['theme']['bg_color'] == '')
|
||||||
/* Looks like there was a problem finding that theme. Try the default */
|
{
|
||||||
echo "Warning: error locating selected theme";
|
/* Looks like there was a problem finding that theme. Try the default */
|
||||||
include (PHPGW_SERVER_ROOT . "/phpgwapi/themes/default.theme");
|
echo 'Warning: error locating selected theme';
|
||||||
if ($phpgw_info["theme"]["bg_color"] == "") {
|
include (PHPGW_SERVER_ROOT . '/phpgwapi/themes/default.theme');
|
||||||
/* Hope we don't get to this point. Better then the user seeing a */
|
if ($phpgw_info['theme']['bg_color'] == '')
|
||||||
/* complety back screen and not know whats going on */
|
{
|
||||||
echo "<body bgcolor=FFFFFF>Fatal error: no themes found";
|
/* Hope we don't get to this point. Better then the user seeing a */
|
||||||
exit;
|
/* 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 *
|
* If they are using frames, we need to set some variables *
|
||||||
|
@ -87,6 +87,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php if ($phpgw_info["server"]["force_theme"] == "user_choice"){ ?>
|
||||||
<tr>
|
<tr>
|
||||||
<?php $selected_theme[$phpgw_info["user"]["preferences"]["common"]["theme"]] = " selected"; ?>
|
<?php $selected_theme[$phpgw_info["user"]["preferences"]["common"]["theme"]] = " selected"; ?>
|
||||||
<td><?php echo lang("Theme (colors/fonts) Selection") . ":"; ?><br></td>
|
<td><?php echo lang("Theme (colors/fonts) Selection") . ":"; ?><br></td>
|
||||||
@ -101,6 +102,8 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo lang("Show navigation bar as"); ?>: </td>
|
<td><?php echo lang("Show navigation bar as"); ?>: </td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -39,6 +39,27 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<?php $selected = array(); ?>
|
<?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"; ?>
|
<?php/* $selected[$current_config["useframes"]] = " selected"; ?>
|
||||||
<tr bgcolor="e6e6e6">
|
<tr bgcolor="e6e6e6">
|
||||||
<td>Frame support:</td>
|
<td>Frame support:</td>
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
echo "</head>\n";
|
echo "</head>\n";
|
||||||
echo "<BODY BGCOLOR=\"FFFFFF\" margintop=\"0\" marginleft=\"0\" marginright=\"0\" marginbottom=\"0\">";
|
echo "<BODY BGCOLOR=\"FFFFFF\" margintop=\"0\" marginleft=\"0\" marginright=\"0\" marginbottom=\"0\">";
|
||||||
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\"><tr>";
|
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\"><tr>";
|
||||||
echo " <td align=\"left\" bgcolor=\"486591\"> <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\"> <font color=\"fefefe\">phpGroupWare version ".$phpgw_info["server"]["versions"]["phpgwapi"]." setup</font></td>";
|
||||||
echo " <td align=\"right\" bgcolor=\"486591\">";
|
echo " <td align=\"right\" bgcolor=\"486591\">";
|
||||||
if ($nologoutbutton) {
|
if ($nologoutbutton) {
|
||||||
echo " </td>";
|
echo " </td>";
|
||||||
@ -332,7 +332,22 @@
|
|||||||
reset ($list);
|
reset ($list);
|
||||||
return $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 = ""){
|
function app_setups($appname = ""){
|
||||||
global $phpgw_info;
|
global $phpgw_info;
|
||||||
$d = dir(PHPGW_SERVER_ROOT);
|
$d = dir(PHPGW_SERVER_ROOT);
|
||||||
|
Loading…
Reference in New Issue
Block a user