Commit 703f0554 authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Add $RT::WikiImplicitLinks option (defaults to false)

Support for Wiki links doing useful things

git-svn-id: svn+ssh://svn.bestpractical.com/svn/bps-public/rt/branches/QUEBEC-EXPERIMENTAL@3603 e417ac7c-1bcc-0310-8ffa-8f5827389a85
parent d5bd79a3
......@@ -329,6 +329,12 @@ Set($MessageBoxWidth , 72);
# Default wrapping: "HARD" (choices "SOFT", "HARD")
Set($MessageBoxWrap, "HARD");
# Support implicit links in WikiText custom fields? A true value
# causes InterCapped or ALLCAPS words in WikiText fields to
# automatically become links to searches for those words. If used on
# RTFM articles, it links to the RTFM article with that name.
Set($WikiImplicitLinks, 0);
# if TrustHTMLAttachments is not defined, we will display them
# as text. This prevents malicious HTML and javascript from being
# sent in a request (although there is probably more to it than that)
......
......@@ -45,7 +45,8 @@
%# END BPS TAGGED BLOCK }}}
% my $content = $Object->LargeContent || $Object->Content;
% $content = $m->comp('/Elements/ScrubHTML', Content => $content);
% my $wiki_content = Text::WikiFormat::format( $content."\n" , {}, { extended => 1, absolute_links => 1, implicit_links => 1} );
% my $base = $Object->Object->WikiBase;
% my $wiki_content = Text::WikiFormat::format( $content."\n" , {}, { extended => 1, absolute_links => 1, implicit_links => $RT::WikiImplicitLinks, prefix => $base} );
<%$wiki_content|n%>
<%init>
use Text::WikiFormat;
......
......@@ -166,6 +166,13 @@ sub Content {
}
sub Object {
my $self = shift;
my $Object = $self->__Value('ObjectType')->new($self->CurrentUser);
$Object->Load($self->__Value('ObjectId'));
return($Object);
}
sub Delete {
my $self = shift;
$self->SetDisabled(1);
......
......@@ -1862,6 +1862,10 @@ sub LoadCustomFieldByIdentifier {
sub BasicColumns {
}
sub WikiBase {
return $RT::WebPath. "/index.html?q=";
}
eval "require RT::Record_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Record_Vendor.pm});
eval "require RT::Record_Local";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment