package WebGUI::Macro::AssetToggle; use strict; use WebGUI::International; use WebGUI::Asset::Template; =head1 NAME Package WebGUI::Macro::AssetToggle =head1 DESCRIPTION Macro for displaying a url to the user for Managing Assets. =head2 process ( [manageAssetsTxt,template ] ) process takes three optional parameters for customizing the content and layout of the account link. =head3 manageAssetsTxt this is the link text displayed to the user and it's only displayed if they are in the Turn On Admin group. If this is blank an internationalized default is used. =head3 template A template from the Macro/AdminToggle namespace to use for formatting the link. =cut #------------------------------------------------------------------- sub process { my $session = shift; return "" unless $session->user->canUseAdminMode; my ($linkText, $templateName) = @_; my $i18n = WebGUI::International->new($session,'Macro_AssetToggle'); my %var; $var{'toggle.url'} = $session->url->page('op=assetManager'); $var{'toggle.text'} = $linkText || $i18n->get(111); # we're using the AdminToggle's template here. my $template = $templateName ? WebGUI::Asset::Template->newByUrl($session, $templateName) : WebGUI::Asset::Template->new($session, "PBtmpl0000000000000036"); return $template->process(\%var); } 1;