Added provision for resetting values to default. Bug #4123

This commit is contained in:
thepurpleblob 2006-02-06 16:48:32 +00:00
parent e9512cdda9
commit f6dc60844f

View File

@ -1,57 +1,69 @@
<?php
// check/set default config settings for media plugin
// $forcereset is set in calling routine
if (!isset($CFG->filter_mediaplugin_enable_mp3)) {
if (!isset($forcereset)) {
$forcereset = false;
}
if (!isset($CFG->filter_mediaplugin_enable_mp3) or $forcereset) {
if (isset($CFG->filter_mediaplugin_ignore_mp3)) {
set_config( 'filter_mediaplugin_enable_mp3', !$CFG->filter_mediaplugin_ignore_mp3 );
set_config( 'filter_mediaplugin_ignore_mp3', '' );
}
else {
set_config( 'filter_mediaplugin_enable_mp3', 1 );
}
}
if (!isset($CFG->filter_mediaplugin_enable_swf)) {
if (!isset($CFG->filter_mediaplugin_enable_swf) or $forcereset) {
if (isset($CFG->filter_mediaplugin_ignore_swf)) {
set_config( 'filter_mediaplugin_enable_swf', !$CFG->filter_mediaplugin_ignore_swf );
set_config( 'filter_mediaplugin_ignore_swf','' );
}
else {
set_config( 'filter_mediaplugin_enable_swf', 1 );
}
}
if (!isset($CFG->filter_mediaplugin_enable_mov)) {
if (!isset($CFG->filter_mediaplugin_enable_mov) or $forcereset) {
if (isset($CFG->filter_mediaplugin_ignore_mov)) {
set_config( 'filter_mediaplugin_enable_mov', !$CFG->filter_mediaplugin_ignore_mov );
set_config( 'filter_mediaplugin_ignore_mov', '' );
}
else {
set_config( 'filter_mediaplugin_enable_mov', 1 );
}
}
if (!isset($CFG->filter_mediaplugin_enable_mpg)) {
if (!isset($CFG->filter_mediaplugin_enable_mpg) or $forcereset) {
if (isset($CFG->filter_mediaplugin_ignore_mpg)) {
set_config( 'filter_mediaplugin_enable_mpg', !$CFG->filter_mediaplugin_ignore_mpg );
set_config( 'filter_mediaplugin_ignore_mpg', '' );
}
else {
set_config( 'filter_mediaplugin_enable_mpg', 1 );
}
}
if (!isset($CFG->filter_mediaplugin_enable_wmv)) {
if (!isset($CFG->filter_mediaplugin_enable_wmv) or $forcereset) {
if (isset($CFG->filter_mediaplugin_ignore_wmv)) {
set_config( 'filter_mediaplugin_enable_wmv', !$CFG->filter_mediaplugin_ignore_wmv );
set_config( 'filter_mediaplugin_ignore_wmv', '' );
}
else {
set_config( 'filter_mediaplugin_enable_wmv', 1 );
}
}
if (!isset($CFG->filter_mediaplugin_enable_avi)) {
if (!isset($CFG->filter_mediaplugin_enable_avi) or $forcereset) {
if (isset($CFG->filter_mediaplugin_ignore_avi)) {
set_config( 'filter_mediaplugin_enable_avi', !$CFG->filter_mediaplugin_ignore_avi );
set_config( 'filter_mediaplugin_ignore_avi', '' );
}
else {
set_config( 'filter_mediaplugin_enable_avi', 1 );
}
}
if (!isset($CFG->filter_mediaplugin_enable_flv)) {
if (!isset($CFG->filter_mediaplugin_enable_flv) or $forcereset) {
if (isset($CFG->filter_mediaplugin_ignore_flv)) {
set_config( 'filter_mediaplugin_enable_flv', !$CFG->filter_mediaplugin_ignore_flv );
set_config( 'filter_mediaplugin_ignore_flv','' );
}
else {
set_config( 'filter_mediaplugin_enable_flv', 1 );