diff --git a/phpgwapi/doc/CHANGELOG b/phpgwapi/doc/CHANGELOG index fdae99b34b..670913c1f7 100644 --- a/phpgwapi/doc/CHANGELOG +++ b/phpgwapi/doc/CHANGELOG @@ -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. diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php index b61425df0a..aed4e6a1f4 100644 --- a/phpgwapi/inc/functions.inc.php +++ b/phpgwapi/inc/functions.inc.php @@ -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 "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 'Fatal error: no themes found'; + 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 'Fatal error: no themes found'; + exit; + } + } + } /*************************************************************************\ * If they are using frames, we need to set some variables * diff --git a/preferences/settings.php b/preferences/settings.php index e792616591..8723c8d45a 100755 --- a/preferences/settings.php +++ b/preferences/settings.php @@ -87,6 +87,7 @@ +
@@ -101,6 +102,8 @@ + + : diff --git a/preferences/setup/config.inc.php b/preferences/setup/config.inc.php index d9438420a0..ff41bb9e78 100644 --- a/preferences/setup/config.inc.php +++ b/preferences/setup/config.inc.php @@ -39,6 +39,27 @@ + + + Use theme:
+ + + + + + + + Frame support: diff --git a/setup/inc/phpgw_setup.inc.php b/setup/inc/phpgw_setup.inc.php index 5fd93bb19d..913b610084 100644 --- a/setup/inc/phpgw_setup.inc.php +++ b/setup/inc/phpgw_setup.inc.php @@ -24,7 +24,7 @@ echo "\n"; echo ""; echo ""; - echo " "; + echo " "; echo " "; @@ -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);
 phpGroupWare version ".$phpgw_info["server"]["versions"]["phpgwapi"]." - 'All your base are belong to us' setup phpGroupWare version ".$phpgw_info["server"]["versions"]["phpgwapi"]." setup"; if ($nologoutbutton) { echo "