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
This commit is contained in:
Sam Minnee 2008-03-11 03:29:30 +00:00
parent 557abf6e60
commit b8262b6d48
2 changed files with 9 additions and 0 deletions

View File

@ -203,6 +203,13 @@ class SSViewer extends Object {
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?"))
),