From 3121a62822cab7a034b424d030788ba4d231ed17 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 28 May 2002 00:58:36 +0000 Subject: [PATCH] Added link when op or func is found in the URL. --- lib/WebGUI/Macro/PageTitle.pm | 12 +++++++++++- lib/WebGUI/Macro/RootTitle.pm | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Macro/PageTitle.pm b/lib/WebGUI/Macro/PageTitle.pm index fe4f23e61..b7bd2e5da 100644 --- a/lib/WebGUI/Macro/PageTitle.pm +++ b/lib/WebGUI/Macro/PageTitle.pm @@ -12,12 +12,22 @@ package WebGUI::Macro::PageTitle; use strict; use WebGUI::Session; +use WebGUI::URL; + +#------------------------------------------------------------------- +sub _replacement { + if ($session{env}{QUERY_STRING} =~ /op/ || $session{env}{QUERY_STRING} =~ /func/) { + return ''.$session{page}{title}.''; + } else { + return $session{page}{title}; + } +} #------------------------------------------------------------------- sub process { my ($output); $output = $_[0]; - $output =~ s/\^PageTitle\;/$session{page}{title}/g; + $output =~ s/\^PageTitle\;/_replacement()/ge; return $output; } diff --git a/lib/WebGUI/Macro/RootTitle.pm b/lib/WebGUI/Macro/RootTitle.pm index 415072730..776dbba62 100644 --- a/lib/WebGUI/Macro/RootTitle.pm +++ b/lib/WebGUI/Macro/RootTitle.pm @@ -27,7 +27,7 @@ sub _recurse { } else { $output = _recurse($data{parentId},$_[1]); } - return $output; + return $output; } #-------------------------------------------------------------------