Added new reset button. bug #4123

This commit is contained in:
thepurpleblob 2006-02-06 16:30:30 +00:00
parent 0ae6a2cad5
commit 7be6fd6684

View file

@ -15,8 +15,10 @@
} }
// get parameters // get parameters
$params = new Object; $param = new Object;
$param->filter = required_param( 'filter' ); $param->filter = required_param( 'filter' );
$param->submit = optional_param( 'submit','',PARAM_ALPHA );
$param->reset = optional_param( 'reset','',PARAM_ALPHA );
$filtername = substr( $param->filter, strpos( $param->filter, '/' )+1 ) ; $filtername = substr( $param->filter, strpos( $param->filter, '/' )+1 ) ;
// get translated strings for use on page // get translated strings for use on page
@ -25,11 +27,16 @@
$txt->administration = get_string( 'administration' ); $txt->administration = get_string( 'administration' );
$txt->configuration = get_string( 'configuration' ); $txt->configuration = get_string( 'configuration' );
//====================== //======================
// Process Actions // Process Actions
//====================== //======================
// if reset pressed let filter config page handle it
$forcereset = false;
if (!empty($param->reset)) {
$forcereset = true;
}
else
if ($config = data_submitted()) { if ($config = data_submitted()) {
// check session key // check session key
@ -80,7 +87,10 @@
<?php include "$CFG->dirroot/$param->filter/filterconfig.html"; ?> <?php include "$CFG->dirroot/$param->filter/filterconfig.html"; ?>
<center><input type="submit" value="<?php print_string('savechanges'); ?>" /></center> <center>
<input type="submit" name="submit" value="<?php print_string('savechanges'); ?>" />
<input type="submit" name="reset" value="<?php echo print_string('resettodefaults'); ?>" />
</center>
</form> </form>
<?php <?php