Added 'anchor' option to link inserter

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2@50776 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-03-10 03:02:12 +00:00
parent c5dd22d7d2
commit 72a8fb3f03
2 changed files with 9 additions and 0 deletions

View File

@ -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, '<base') !== false) {
$thisURLRelativeToBase = Director::makeRelative(Director::absoluteURL($_SERVER['REQUEST_URI']));
$output = preg_replace('/(<a[^>+]href *= *")#/i', '\\1' . $thisURLRelativeToBase . '#', $output);
}
return $output;
}

View File

@ -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?"))
),