From: <jfi...@us...> - 2002-12-17 11:04:53
|
Update of /cvsroot/mantisbt/mantisbt/core In directory sc8-pr-cvs1:/tmp/cvs-serv26900 Modified Files: config_api.php Log Message: * core/config_api.php (config_obsolete): + support an array as the second param + cleanup the output a bit + add a comment about using WARNINGs in the future + don't exit, there might be more than one obsolete variable that can be fixed at the same time Index: config_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/config_api.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- config_api.php 18 Oct 2002 21:04:49 -0000 1.7 +++ config_api.php 17 Dec 2002 11:04:51 -0000 1.8 @@ -68,13 +68,23 @@ # Checks if an obsolete configuration variable is still in use. If so, an error # will be generated and the script will exit. This is called from login_page.php and # admin_check.php. - function config_obsolete($var, $replace) { - if ( config_is_set( $var ) ) { - echo '$g_' . $var . ' is now obsolete'; - if ($replace != '') { - echo ', please use $g_' . $replace; + function config_obsolete( $p_var, $p_replace ) { + # @@@ we could trigger a WARNING here, once we have errors that can + # have extra data plugged into them (we need to give the old and + # new config option names in the warning text) + + if ( config_is_set( $p_var ) ) { + echo '<p>$g_' . $p_var . ' is now obsolete'; + if ( is_array( $p_replace ) ) { + echo ', please see the following options: <ul>'; + foreach ( $p_replace as $t_option ) { + echo '<li>$g_' . $t_option . '</li>'; + } + echo '</li>'; + } else if ( ! is_blank( $p_replace ) ) { + echo ', please use $g_' . $p_replace; } - exit; + echo '</p>'; } } ?> |