From 8975ef5ef24fd8f0dcc59cabc81b1635bd42983a Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Fri, 30 Nov 2007 19:34:38 +0000 Subject: [PATCH] added url.raw for Post assets to get a URL without the #id stuff at the end --- lib/WebGUI/Asset/Post.pm | 1 + lib/WebGUI/Help/Asset_Post.pm | 1 + lib/WebGUI/i18n/English/Asset_Post.pm | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index 730a6117d..f100ea21c 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -516,6 +516,7 @@ sub getTemplateVars { $var{"reply.url"} = $self->getReplyUrl; $var{'reply.withquote.url'} = $self->getReplyUrl(1); $var{'url'} = $self->getUrl.'#id'.$self->getId; + $var{'url.raw'} = $self->getUrl; $var{'rating.value'} = $self->get("rating")+0; $var{'rate.url.thumbsUp'} = $self->getRateUrl(1); $var{'rate.url.thumbsDown'} = $self->getRateUrl(-1); diff --git a/lib/WebGUI/Help/Asset_Post.pm b/lib/WebGUI/Help/Asset_Post.pm index 3882e1b6c..107edd2c8 100644 --- a/lib/WebGUI/Help/Asset_Post.pm +++ b/lib/WebGUI/Help/Asset_Post.pm @@ -99,6 +99,7 @@ our $HELP = { { 'name' => 'reply.url' }, { 'name' => 'reply.withQuote.url' }, { 'name' => 'url' }, + { 'name' => 'url.raw', description => 'help url.raw' }, { 'name' => 'rating.value' }, { 'name' => 'rate.url.thumbsUp' }, { 'name' => 'rate.url.thumbsDown' }, diff --git a/lib/WebGUI/i18n/English/Asset_Post.pm b/lib/WebGUI/i18n/English/Asset_Post.pm index c41931fa1..93de2251b 100644 --- a/lib/WebGUI/i18n/English/Asset_Post.pm +++ b/lib/WebGUI/i18n/English/Asset_Post.pm @@ -620,6 +620,11 @@ user subscribed to.|, lastUpdated => 1184174365 }, + 'help url.raw' => { + message => 'The URL to the post asset without the #id... at the end. Useful for performing other functions on the post like func=promote or func=demote', + lastUpdated => 0, + context => "Help for the 'url.raw' template var.", + } }; 1;