From 8e2ceb4ba5a3b9f8477454bbb93aec17613dc8d9 Mon Sep 17 00:00:00 2001 From: David Siegfried Date: Thu, 19 Oct 2023 09:37:12 +0000 Subject: remove flash leftover, closes #3371 Closes #3371 Merge request studip/studip!2291 --- config/config.inc.php.dist | 7 ----- config/config_develop.inc.php | 7 ----- db/migrations/5.5.4_remove_flash_from_config.php | 36 +++++++++++++++++++++++ lib/classes/StudipCoreFormat.php | 28 +++++------------- public/assets/flash/player.swf | Bin 11254 -> 0 bytes public/assets/flash/player_flv.swf | Bin 11803 -> 0 bytes 6 files changed, 44 insertions(+), 34 deletions(-) create mode 100644 db/migrations/5.5.4_remove_flash_from_config.php delete mode 100644 public/assets/flash/player.swf delete mode 100644 public/assets/flash/player_flv.swf diff --git a/config/config.inc.php.dist b/config/config.inc.php.dist index d7a0f83..98c38a4 100644 --- a/config/config.inc.php.dist +++ b/config/config.inc.php.dist @@ -35,8 +35,6 @@ // +---------------------------------------------------------------------------+ global - $FLASHPLAYER_DEFAULT_CONFIG_MIN, - $FLASHPLAYER_DEFAULT_CONFIG_MAX, $INST_ADMIN_DATAFIELDS_VIEW, $INST_MODULES, $INST_TYPE, @@ -266,11 +264,6 @@ $SYMBOL_SHORT = array( this options are only needed, if you are using the addional Stud.IP modules (please see in config_local.inc.php which modules are activated). It's a good idea to leave this settings untouched...*/ - -// cofiguration for flash player -$FLASHPLAYER_DEFAULT_CONFIG_MIN = "&showstop=1&showvolume=1&bgcolor=A6B6C6&bgcolor1=A6B6C6&bgcolor2=7387AC&playercolor=7387AC&buttoncolor=254580&buttonovercolor=E9EFFD&slidercolor1=CAD7E1&slidercolor2=A6B6C6&sliderovercolor=E9EFFD&loadingcolor=E9B21A&buffer=5&buffercolor=white&buffershowbg=0&playeralpha=90&playertimeout=500&shortcut=1&phpstream=0&onclick=playpause&showloading=always"; -$FLASHPLAYER_DEFAULT_CONFIG_MAX = "&showstop=1&showvolume=1&bgcolor=A6B6C6&bgcolor1=A6B6C6&bgcolor2=7387AC&playercolor=7387AC&buttoncolor=254580&buttonovercolor=E9EFFD&slidercolor1=CAD7E1&slidercolor2=A6B6C6&sliderovercolor=E9EFFD&loadingcolor=E9B21A&buffer=5&buffercolor=white&buffershowbg=0&playeralpha=90&playertimeout=500&shortcut=1&showtime=1&showfullscreen=1&showplayer=always&phpstream=0&onclick=playpause&showloading=always"; - /* * use this to customize the fields shown in the standard/extended view on the instiute member page * valid values are 'raum', 'sprechzeiten', 'telefon', 'email', 'homepage' and userinstrole datafield ids diff --git a/config/config_develop.inc.php b/config/config_develop.inc.php index 26787a2..a38726a 100644 --- a/config/config_develop.inc.php +++ b/config/config_develop.inc.php @@ -36,8 +36,6 @@ global $CALENDAR_MAX_EVENTS, - $FLASHPLAYER_DEFAULT_CONFIG_MIN, - $FLASHPLAYER_DEFAULT_CONFIG_MAX, $INST_ADMIN_DATAFIELDS_VIEW, $INST_MODULES, $INST_STATUS_GROUPS, @@ -323,11 +321,6 @@ $SYMBOL_SHORT = [ this options are only needed, if you are using the addional Stud.IP modules (please see in config_local.inc.php which modules are activated). It's a good idea to leave this settings untouched...*/ - -// cofiguration for flash player -$FLASHPLAYER_DEFAULT_CONFIG_MIN = "&showstop=1&showvolume=1&bgcolor=A6B6C6&bgcolor1=A6B6C6&bgcolor2=7387AC&playercolor=7387AC&buttoncolor=254580&buttonovercolor=E9EFFD&slidercolor1=CAD7E1&slidercolor2=A6B6C6&sliderovercolor=E9EFFD&loadingcolor=E9B21A&buffer=5&buffercolor=white&buffershowbg=0&playeralpha=90&playertimeout=500&shortcut=1&phpstream=0&onclick=playpause&showloading=always"; -$FLASHPLAYER_DEFAULT_CONFIG_MAX = "&showstop=1&showvolume=1&bgcolor=A6B6C6&bgcolor1=A6B6C6&bgcolor2=7387AC&playercolor=7387AC&buttoncolor=254580&buttonovercolor=E9EFFD&slidercolor1=CAD7E1&slidercolor2=A6B6C6&sliderovercolor=E9EFFD&loadingcolor=E9B21A&buffer=5&buffercolor=white&buffershowbg=0&playeralpha=90&playertimeout=500&shortcut=1&showtime=1&showfullscreen=1&showplayer=always&phpstream=0&onclick=playpause&showloading=always"; - //Here you have to add the datafield_ids as elements. They will be shown in the standard / extended view on inst_admin.php $INST_ADMIN_DATAFIELDS_VIEW = [ 'default' => [], diff --git a/db/migrations/5.5.4_remove_flash_from_config.php b/db/migrations/5.5.4_remove_flash_from_config.php new file mode 100644 index 0000000..56cb322 --- /dev/null +++ b/db/migrations/5.5.4_remove_flash_from_config.php @@ -0,0 +1,36 @@ +execute($query, [ + ':new_description' => self::NEW_DESCRIPTION, + ':old_description' => self::OLD_DESCRIPTION, + ]); + } + + protected function down() + { + $query = "UPDATE `config` + SET `description` = :old_description + WHERE `field` = 'LOAD_EXTERNAL_MEDIA' + AND `description` = :new_description"; + DBManager::get()->execute($query, [ + ':new_description' => self::NEW_DESCRIPTION, + ':old_description' => self::OLD_DESCRIPTION, + ]); + } +} diff --git a/lib/classes/StudipCoreFormat.php b/lib/classes/StudipCoreFormat.php index b656252..389256f 100644 --- a/lib/classes/StudipCoreFormat.php +++ b/lib/classes/StudipCoreFormat.php @@ -148,7 +148,7 @@ class StudipCoreFormat extends TextFormat 'callback' => 'StudipCoreFormat::markupCode' ], 'media' => [ - 'start' => '\[(img|flash|audio|video)(.*?)\](.*?)(?=\s|$)', + 'start' => '\[(img|audio|video)(.*?)\](.*?)(?=\s|$)', 'callback' => 'StudipCoreFormat::markupMedia' ], 'emails' => [ @@ -524,7 +524,7 @@ class StudipCoreFormat extends TextFormat } /** - * Stud.IP markup for images, audio, video and flash-films + * Stud.IP markup for images, audio and video */ protected static function markupMedia($markup, $matches) { @@ -598,24 +598,12 @@ class StudipCoreFormat extends TextFormat $media_url = idna_link($url); } - if ($tag === "flash") { - $width = $width ? $width : 200; - $height = round($width * 0.75); - $flash_config = $width > 200 ? $GLOBALS['FLASHPLAYER_DEFAULT_CONFIG_MAX'] : $GLOBALS['FLASHPLAYER_DEFAULT_CONFIG_MIN']; - $media = ' - - - - - '; - } else { - $media = sprintf($format_strings[$tag], - $media_url, - isset($width) ? "width: ".$width."px;" : "", - $title, - $title - ); - } + $media = sprintf($format_strings[$tag], + $media_url, + isset($width) ? "width: ".$width."px;" : "", + $title, + $title + ); if ($tag === 'audio') { $random_id = 'audio-' . mb_substr(md5(uniqid('audio', true)), -8); diff --git a/public/assets/flash/player.swf b/public/assets/flash/player.swf deleted file mode 100644 index 497cfce..0000000 Binary files a/public/assets/flash/player.swf and /dev/null differ diff --git a/public/assets/flash/player_flv.swf b/public/assets/flash/player_flv.swf deleted file mode 100644 index 9aba8bf..0000000 Binary files a/public/assets/flash/player_flv.swf and /dev/null differ -- cgit v1.0