Skip to content
Snippets Groups Projects
Commit 8e2ceb4b authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

remove flash leftover, closes #3371

Closes #3371

Merge request studip/studip!2291
parent b77df6fc
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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' => [],
......
<?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,
]);
}
}
......@@ -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)).'&amp;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)).'&amp;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);
......
File deleted
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment