diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 5702e6ba0..70b625d91 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -19,6 +19,8 @@ - fixed: Adding Flat Discount Coupon causes "Problem w/ Request" error - fixed: No label for yes/no radio buttons - fixed: Gallery Edit Album buttons did not work properly in IE + - fixed: Cannot embed YouTube videos in IE6/7. Fixed by adding an "Allow Media" + switch to the RichEdit asset. 7.5.12 - skipping this release diff --git a/docs/upgrades/upgrade_7.5.12-7.5.13.pl b/docs/upgrades/upgrade_7.5.12-7.5.13.pl index e61a4f13a..6649ed010 100644 --- a/docs/upgrades/upgrade_7.5.12-7.5.13.pl +++ b/docs/upgrades/upgrade_7.5.12-7.5.13.pl @@ -31,9 +31,22 @@ my $session = start(); # this line required fixShop($session); addSelectableProfileTemplates($session); addCouponThankYouMessage($session); +addRichEditMedia( $session ); finish($session); # this line required +#---------------------------------------------------------------------------- +# Add the "allowMedia" field to Rich Edit assets +sub addRichEditMedia { + my $session = shift; + print "\tAdding Media switch to Rich Edit..." unless $quiet; + + $session->db->write( + q{ ALTER TABLE RichEdit ADD COLUMN allowMedia INT }, + ); + + print "DONE!\n" unless $quiet; +} #---------------------------------------------------------------------------- sub fixShop { diff --git a/lib/WebGUI/Asset/RichEdit.pm b/lib/WebGUI/Asset/RichEdit.pm index 6af39eef1..58b9dd6dc 100644 --- a/lib/WebGUI/Asset/RichEdit.pm +++ b/lib/WebGUI/Asset/RichEdit.pm @@ -148,6 +148,10 @@ sub definition { fieldType => "yesNo", defaultValue => 0, }, + allowMedia => { + fieldType => "yesNo", + defaultValue => 0, + }, }, }); return $class->SUPER::definition($session, $definition); @@ -394,6 +398,12 @@ sub getEditForm { -label=>$i18n->get('inline popups'), -hoverHelp=>$i18n->get('inline popups description'), -name=>"inlinePopups" + ); + $tabform->getTab("properties")->yesNo( + value => $self->getValue("allowMedia"), + label => $i18n->get('editForm allowMedia label'), + hoverHelp => $i18n->get('editForm allowMedia description'), + name => "allowMedia", ); return $tabform; } @@ -452,6 +462,8 @@ sub getRichEditor { if $self->getValue("enableContextMenu"); push @plugins, "inlinepopups" if $self->getValue("inlinePopups"); + push @plugins, "media" + if $self->getValue( 'allowMedia' ); my @toolbarRows = map{[split "\n", $self->getValue("toolbarRow$_")]} (1..3); my @toolbarButtons = map{ @{$_} } @toolbarRows; diff --git a/lib/WebGUI/i18n/English/Asset_RichEdit.pm b/lib/WebGUI/i18n/English/Asset_RichEdit.pm index 216d47f89..ed50f9a1d 100644 --- a/lib/WebGUI/i18n/English/Asset_RichEdit.pm +++ b/lib/WebGUI/i18n/English/Asset_RichEdit.pm @@ -457,6 +457,20 @@ option is set to Yes, then all whitespace entered into the form will be preserve lastUpdated => 1206653834, }, + 'editForm allowMedia label' => { + message => q{Allow Media}, + lastUpdated => 0, + context => q{Label for asset property to allow multimedia items such as Flash}, + }, + + 'editForm allowMedia description' => { + message => q{Setting this to "yes" will allow Flash and other media to be embedded through + the rich editor. Note: Setting to "No" will not explicitly forbid Flash, but it + is not guaranteed to work.}, + lastUpdated => 0, + context => q{Description of asset property.}, + }, + }; 1;