From 060f21cb8b327dd57e009d5188c1e29eaeb1d035 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 1 Jun 2006 03:08:58 +0000 Subject: [PATCH] fix Insert A Link page has no head & body tags has no style --- docs/changelog/6.x.x.txt | 1 + lib/WebGUI/Operation/FormHelpers.pm | 97 ++++++++++++++++++++++++----- 2 files changed, 81 insertions(+), 17 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 351a55543..891738927 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -28,6 +28,7 @@ rough edges discussions in Community IRC. - fix: not set UTF-8 in setup page - fix: 6.99 nothing write to assetData.groupIdView & assetData.groupIdEdit + - fix: Insert A Link page has no head & body tags has no style 6.99.2 - fix - demo.plainblack.com getting started diff --git a/lib/WebGUI/Operation/FormHelpers.pm b/lib/WebGUI/Operation/FormHelpers.pm index b613ac82c..3cebf4735 100644 --- a/lib/WebGUI/Operation/FormHelpers.pm +++ b/lib/WebGUI/Operation/FormHelpers.pm @@ -45,8 +45,10 @@ sub www_formAssetTree { $url .= ";classLimiter=".$session->form->process("classLimiter","className") if ($session->form->process("classLimiter","className")); push(@crumb,''.$ancestor->get("menuTitle").''); } - my $output = ' - + my $output = ' + + + + |); + $session->style->setScript($session->url->extras('tinymce2/jscripts/tiny_mce/tiny_mce_popup.js'),{type=>"text/javascript"}); my $i18n = WebGUI::International->new($session); - my $f = WebGUI::HTMLForm->new($session,-action=>"#",-extras=>'name="linkchooser"'); + my $f = WebGUI::HTMLForm->new($session,-action=>"#"); $f->text( -name=>"url", -label=>$i18n->get(104), @@ -125,12 +157,11 @@ sub www_richEditPageTree { "_blank"=>$i18n->get('link in new window')}, ); $f->button( + -name=>"button", -value=>$i18n->get('done'), -extras=>'onclick="createLink()"' ); - $session->style->setScript($session->url->extras('tinymce2/jscripts/tiny_mce/tiny_mce_popup.js'),{type=>"text/javascript"}); - my $output = '
'.$i18n->get('insert a link').' -
'.$i18n->get('insert a link').''.$f->print.'
+ my $output = '
'.$i18n->get('insert a link').''.$f->print.'
'.$i18n->get('pages').' '; + +
'.$i18n->get('pages').' '; + $output .= '
'; my $base = WebGUI::Asset->newByUrl($session) || WebGUI::Asset->getRoot($session); my @crumb; my $ancestors = $base->getLineage(["self","ancestors"],{returnObjects=>1}); foreach my $ancestor (@{$ancestors}) { - push(@crumb,''.$ancestor->get("menuTitle").''); + push(@crumb,''.$ancestor->get("menuTitle").''); } - $output .= '

'.join(" > ", @crumb)."

\n"; + $output .= '
'.join(" > ", @crumb)."

\n"; my $children = $base->getLineage(["children"],{returnObjects=>1}); foreach my $child (@{$children}) { next unless $child->canView; - $output .= '['.$i18n->get("select").'] '.$child->get("menuTitle").''."
\n"; + $output .= '['.$i18n->get("select").'] '.$child->get("menuTitle").''."
\n"; } - $output .= '
'; + $output .= '
'; return $session->style->process($output, 'PBtmpl0000000000000137'); } @@ -178,14 +211,43 @@ Each link display a thumbnail of the image via www_richEditViewThumbnail. sub www_richEditImageTree { my $session = shift; $session->http->setCacheControl("none"); + $session->style->setRawHeadTags(q| |); my $base = WebGUI::Asset->newByUrl($session) || WebGUI::Asset->getRoot($session); my @crumb; my $ancestors = $base->getLineage(["self","ancestors"],{returnObjects=>1}); my $media; my @output; + push(@output, '
'); my $i18n = WebGUI::International->new($session, 'Operation_FormHelpers'); foreach my $ancestor (@{$ancestors}) { - push(@crumb,''.$ancestor->get("menuTitle").''); + push(@crumb,''.$ancestor->get("menuTitle").''); # check if we are in (a subdirectory of) Media if ($ancestor->get('assetId') eq 'PBasset000000000000003') { $media = $ancestor; @@ -203,17 +265,18 @@ sub www_richEditImageTree { # if not in Media, provide a direct link to it push(@output, '

[ '.$media->get('title').' ]

'); } - push(@output, '

'.join(" > ", @crumb)."

\n"); + push(@output, '
'.join(" > ", @crumb)."

\n"); my $children = $base->getLineage(["children"],{returnObjects=>1}); foreach my $child (@{$children}) { next unless $child->canView; if ($child->get("className") =~ /^WebGUI::Asset::File::Image/) { - push(@output, '['.$i18n->get("select","WebGUI").'] '); + push(@output, '['.$i18n->get("select","WebGUI").'] '); } else { - push(@output, "[".$i18n->get("select","WebGUI")."] "); + push(@output, ' ['.$i18n->get("select","WebGUI")."] "); } - push(@output, ''.$child->get("menuTitle").''."
\n"); + push(@output, ''.$child->get("menuTitle").''."
\n"); } + push(@output, '
'); return $session->style->process(join('', @output), 'PBtmpl0000000000000137'); }