diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2023-10-19 09:37:12 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-10-19 09:37:12 +0000 |
| commit | 8e2ceb4ba5a3b9f8477454bbb93aec17613dc8d9 (patch) | |
| tree | 498b23fda2de918edf8c285b326b3e10733d47c3 | |
| parent | b77df6fc173a0c15e51f35f136fed24080e5b996 (diff) | |
remove flash leftover, closes #3371
Closes #3371
Merge request studip/studip!2291
| -rw-r--r-- | config/config.inc.php.dist | 7 | ||||
| -rw-r--r-- | config/config_develop.inc.php | 7 | ||||
| -rw-r--r-- | db/migrations/5.5.4_remove_flash_from_config.php | 36 | ||||
| -rw-r--r-- | lib/classes/StudipCoreFormat.php | 28 | ||||
| -rw-r--r-- | public/assets/flash/player.swf | bin | 11254 -> 0 bytes | |||
| -rw-r--r-- | public/assets/flash/player_flv.swf | bin | 11803 -> 0 bytes |
6 files changed, 44 insertions, 34 deletions
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 @@ +<?php +final class RemoveFlashFromConfig extends Migration +{ + private const OLD_DESCRIPTION = 'Sollen externe Medien über [img/flash/audio/video] eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=proxy benutzen.'; + private const NEW_DESCRIPTION = 'Sollen externe Medien über [img/audio/video] eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=proxy benutzen.'; + + + public function description() + { + return 'Removes reference to flash from config description'; + } + + protected function up() + { + $query = "UPDATE `config` + SET `description` = :new_description + WHERE `field` = 'LOAD_EXTERNAL_MEDIA' + AND `description` = :old_description"; + DBManager::get()->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 = '<object type="application/x-shockwave-flash" id="FlashPlayer" data="'.Assets::url().'flash/player_flv.swf" width="'.$width.'" height="'.$height.'"> - <param name="movie" value="'.Assets::url().'flash/player_flv.swf"> - <param name="allowFullScreen" value="true"> - <param name="FlashVars" value="flv='.urlencode(decodeHTML($media_url)).'&startimage='.$link.$flash_config.'"> - <embed src="'.Assets::url().'flash/player_flv.swf" movie="$media_url" type="application/x-shockwave-flash" FlashVars="flv='.urlencode(decodeHTML($media_url)).'&startimage='.$link.$flash_config.'"> - </object>'; - } 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 Binary files differdeleted file mode 100644 index 497cfce..0000000 --- a/public/assets/flash/player.swf +++ /dev/null diff --git a/public/assets/flash/player_flv.swf b/public/assets/flash/player_flv.swf Binary files differdeleted file mode 100644 index 9aba8bf..0000000 --- a/public/assets/flash/player_flv.swf +++ /dev/null |
