remove getValue for the third time maybe?

This commit is contained in:
Doug Bell 2011-05-19 19:23:51 -05:00
parent af2abb7a42
commit 258d939614

View file

@ -329,7 +329,7 @@ override getEditForm => sub {
# Get a list of all the buttons in this MCE # Get a list of all the buttons in this MCE
sub getAllButtons { sub getAllButtons {
my ( $self ) = @_; my ( $self ) = @_;
my @toolbarRows = map{[split "\n", $self->getValue("toolbarRow$_")]} (1..3); my @toolbarRows = map{[split "\n", $self->get("toolbarRow$_")]} (1..3);
my @toolbarButtons = map{ @{$_} } @toolbarRows; my @toolbarButtons = map{ @{$_} } @toolbarRows;
return @toolbarButtons; return @toolbarButtons;
} }
@ -344,13 +344,13 @@ sub getConfig {
my @plugins; my @plugins;
push @plugins, "safari"; push @plugins, "safari";
push @plugins, "contextmenu" push @plugins, "contextmenu"
if $self->getValue("enableContextMenu"); if $self->get("enableContextMenu");
push @plugins, "inlinepopups" push @plugins, "inlinepopups"
if $self->getValue("inlinePopups"); if $self->get("inlinePopups");
push @plugins, "media" push @plugins, "media"
if $self->getValue( 'allowMedia' ); if $self->get( 'allowMedia' );
my @toolbarRows = map{[split "\n", $self->getValue("toolbarRow$_")]} (1..3); my @toolbarRows = map{[split "\n", $self->get("toolbarRow$_")]} (1..3);
my @toolbarButtons = map{ @{$_} } @toolbarRows; my @toolbarButtons = map{ @{$_} } @toolbarRows;
my %config = ( my %config = (
mode => 'exact', mode => 'exact',
@ -364,16 +364,16 @@ sub getConfig {
( map { "theme_advanced_buttons" . ( $_ + 1 ) => ( join ',', @{ $toolbarRows[$_] } ) } ( 0 .. $#toolbarRows ) ), ( map { "theme_advanced_buttons" . ( $_ + 1 ) => ( join ',', @{ $toolbarRows[$_] } ) } ( 0 .. $#toolbarRows ) ),
ask => JSON::false(), ask => JSON::false(),
preformatted => $self->getValue("preformatted") ? JSON::true() : JSON::false(), preformatted => $self->get("preformatted") ? JSON::true() : JSON::false(),
force_br_newlines => $self->getValue("useBr") ? JSON::true() : JSON::false(), force_br_newlines => $self->get("useBr") ? JSON::true() : JSON::false(),
force_p_newlines => $self->getValue("useBr") ? JSON::false() : JSON::true(), force_p_newlines => $self->get("useBr") ? JSON::false() : JSON::true(),
$self->getValue("useBr") ? ( forced_root_block => JSON::false() ) : (), $self->get("useBr") ? ( forced_root_block => JSON::false() ) : (),
remove_linebreaks => $self->getValue("removeLineBreaks") ? JSON::true() : JSON::false(), remove_linebreaks => $self->get("removeLineBreaks") ? JSON::true() : JSON::false(),
nowrap => $self->getValue("nowrap") ? JSON::true() : JSON::false(), nowrap => $self->get("nowrap") ? JSON::true() : JSON::false(),
directionality => $self->getValue("directionality"), directionality => $self->get("directionality"),
theme_advanced_toolbar_location => $self->getValue("toolbarLocation"), theme_advanced_toolbar_location => $self->get("toolbarLocation"),
theme_advanced_statusbar_location => "bottom", theme_advanced_statusbar_location => "bottom",
valid_elements => $self->getValue("validElements"), valid_elements => $self->get("validElements"),
wg_userIsVisitor => $self->session->user->isVisitor ? JSON::true() : JSON::false(), wg_userIsVisitor => $self->session->user->isVisitor ? JSON::true() : JSON::false(),
); );
foreach my $button (@toolbarButtons) { foreach my $button (@toolbarButtons) {
@ -425,10 +425,10 @@ sub getConfig {
push @plugins, "-wgmacro"; push @plugins, "-wgmacro";
} }
if ( $button eq "code" ) { if ( $button eq "code" ) {
$config{theme_advanced_source_editor_width} = $self->getValue("sourceEditorWidth") $config{theme_advanced_source_editor_width} = $self->get("sourceEditorWidth")
if ( $self->getValue("sourceEditorWidth") > 0 ); if ( $self->get("sourceEditorWidth") > 0 );
$config{theme_advanced_source_editor_height} = $self->getValue("sourceEditorHeight") $config{theme_advanced_source_editor_height} = $self->get("sourceEditorHeight")
if ( $self->getValue("sourceEditorHeight") > 0 ); if ( $self->get("sourceEditorHeight") > 0 );
} }
} ## end foreach my $button (@toolbarButtons) } ## end foreach my $button (@toolbarButtons)
my $language = $i18n->getLanguage( '', "languageAbbreviation" ); my $language = $i18n->getLanguage( '', "languageAbbreviation" );
@ -436,10 +436,10 @@ sub getConfig {
$language = $i18n->getLanguage( "English", "languageAbbreviation" ); $language = $i18n->getLanguage( "English", "languageAbbreviation" );
} }
$config{language} = $language; $config{language} = $language;
$config{content_css} = $self->getValue("cssFile") $config{content_css} = $self->get("cssFile")
|| $self->session->url->extras('tinymce-webgui/defaultcontent.css'); || $self->session->url->extras('tinymce-webgui/defaultcontent.css');
$config{width} = $self->getValue("editorWidth") if ( $self->getValue("editorWidth") > 0 ); $config{width} = $self->get("editorWidth") if ( $self->get("editorWidth") > 0 );
$config{height} = $self->getValue("editorHeight") if ( $self->getValue("editorHeight") > 0 ); $config{height} = $self->get("editorHeight") if ( $self->get("editorHeight") > 0 );
$config{plugins} = join( ",", @plugins ); $config{plugins} = join( ",", @plugins );
return \%config; return \%config;
@ -514,7 +514,7 @@ sub getRichEditor {
return '' if ($self->disableRichEditor); return '' if ($self->disableRichEditor);
my $nameId = shift; my $nameId = shift;
my $i18n = WebGUI::International->new($self->session, 'Asset_RichEdit'); my $i18n = WebGUI::International->new($self->session, 'Asset_RichEdit');
my $ask = $self->getValue("askAboutRichEdit"); my $ask = $self->askAboutRichEdit;
# if ($ask) { # if ($ask) {
# $config{oninit} = 'turnOffTinyMCE_'.$nameId; # $config{oninit} = 'turnOffTinyMCE_'.$nameId;
# } # }