From 45157d246ba800d3466e456b96634572464afcb3 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 8 Feb 2005 16:07:23 +0000 Subject: [PATCH] fixed a template link bug --- lib/WebGUI/HTMLForm.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/WebGUI/HTMLForm.pm b/lib/WebGUI/HTMLForm.pm index 2b3a1b89f..297fd87e6 100644 --- a/lib/WebGUI/HTMLForm.pm +++ b/lib/WebGUI/HTMLForm.pm @@ -2169,11 +2169,13 @@ sub template { rearrange([qw(name value label namespace afterEdit extras uiLevel defaultValue subtext)], @p); if (_uiLevelChecksOut($uiLevel)) { $label = $label || WebGUI::International::get(356); - if (WebGUI::Grouping::isInGroup(8)) { - if ($afterEdit) { - $buttons = editIcon("op=editTemplate&tid=".$value."&namespace=".$namespace."&afterEdit=".WebGUI::URL::escape($afterEdit)); - } - $buttons .= manageIcon("op=listTemplates&namespace=$namespace"); + my $template = WebGUI::Asset->newByDynamicClass($value); + if (defined $template && $template->canEdit) { + # if ($afterEdit) { + $buttons = editIcon("func=edit",$template->get("url")); + #"&namespace=".$namespace."&afterEdit=".WebGUI::URL::escape($afterEdit)); + # } + #$buttons .= manageIcon("op=listTemplates&namespace=$namespace"); } $output = WebGUI::Form::template({ "name"=>$name,