From b8262b6d48b9c21b779b0180ab4cd9aac265d9ec Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 11 Mar 2008 03:29:30 +0000 Subject: [PATCH] Merged revisions 50783 via svnmerge from http://svn.silverstripe.com/open/modules/sapphire/branches/2.2.2 ........ r50783 | sminnee | 2008-03-10 16:02:12 +1300 (Mon, 10 Mar 2008) | 1 line Added 'anchor' option to link inserter ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@50883 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/SSViewer.php | 7 +++++++ forms/HtmlEditorField.php | 2 ++ 2 files changed, 9 insertions(+) diff --git a/core/SSViewer.php b/core/SSViewer.php index c8534a417..9802e8037 100644 --- a/core/SSViewer.php +++ b/core/SSViewer.php @@ -202,6 +202,13 @@ class SSViewer extends Object { SSViewer::$topLevel = null; if(isset($_GET['debug_profile'])) Profiler::unmark("SSViewer::process", " for $template"); + + + // If we have our crazy base tag, then fix # links referencing the current page. + if(strpos($output, '+]href *= *")#/i', '\\1' . $thisURLRelativeToBase . '#', $output); + } return $output; } diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index 13597d4ca..9e9db7760 100755 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -360,6 +360,7 @@ class HtmlEditorField_Toolbar extends ViewableData { array( "internal" => _t('HtmlEditorField.LINKINTERNAL',"Page on the site"), "external" => _t('HtmlEditorField.LINKEXTERNAL',"Another website"), + "anchor" => _t('HtmlEditorField.LINKANCHOR',"Anchor on this page"), "email" => _t('HtmlEditorField.LINKEMAIL', "Email address"), "file" => _t('HtmlEditorField.LINKFILE', "Download a file"), ) @@ -368,6 +369,7 @@ class HtmlEditorField_Toolbar extends ViewableData { new TextField("external", _t('HtmlEditorField.URL', "URL"), 'http://'), new EmailField("email", _t('HtmlEditorField.EMAIL', "Email address")), new TreeDropdownField("file",_t('HtmlEditorField.FILE', "File"),"File", "Filename"), + new TextField("Anchor", _t('HtmlEditorField.ANCHORVALUE', "Anchor")), new TextField("Description", _t('HtmlEditorField.LINKDESCR', "Link description")), new CheckboxField("TargetBlank", _t('HtmlEditorField.LINKOPENNEWWIN', "Open link in a new window?")) ),