Added ability to pass caller assetId to RenderThingMacro
This commit is contained in:
parent
a2425bdbc4
commit
995eb34b5a
3 changed files with 5 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
7.10.19
|
||||
- Added ability to pass caller assetId to RenderThingMacro
|
||||
|
||||
7.10.18
|
||||
- fixed #12138: Version tag gets create by entering and direct leaving
|
||||
|
|
|
|||
|
|
@ -3933,6 +3933,7 @@ sub www_viewThingData {
|
|||
my $thingId = shift || $session->form->process('thingId');
|
||||
my $thingDataId = shift || $session->form->process('thingDataId');
|
||||
my $templateId = shift || $session->form->process('templateId');
|
||||
my $callerAssetId = shift || $session->form->process('callerAssetId');
|
||||
my $var = $self->get;
|
||||
my $url = $self->getUrl;
|
||||
my $i18n = WebGUI::International->new($self->session, "Asset_Thingy");
|
||||
|
|
@ -3945,6 +3946,7 @@ sub www_viewThingData {
|
|||
$var->{"addThing_url"} = $session->url->append($url, 'func=editThing;thingId=new');
|
||||
$var->{"manage_url"} = $session->url->append($url, 'func=manage');
|
||||
$var->{"thing_label"} = $thingProperties->{label};
|
||||
$var->{"callerAssetId"} = $callerAssetId;
|
||||
|
||||
if($self->hasPrivileges($thingProperties->{groupIdEdit})){
|
||||
$var->{"edit_url"} = $session->url->append($url,'func=editThingData;thingId='
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ Optional. Specifies the templateId or template url to use. If omitted, the def
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($session, $thingDataUrl, $templateHint ) = @_;
|
||||
my ($session, $thingDataUrl, $templateHint, $callerAssetId ) = @_;
|
||||
my $i18n = WebGUI::International->new($session, 'Macro_RenderThingData');
|
||||
return $i18n->get('no template') if !$templateHint;
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ sub process {
|
|||
return ( $i18n->get('bad url') . $thingDataUrl ) if !$thing || !$thingId || !$thingDataId;
|
||||
|
||||
# Render
|
||||
my $output = $thing->www_viewThingData( $thingId, $thingDataId, $templateHint );
|
||||
my $output = $thing->www_viewThingData( $thingId, $thingDataId, $templateHint, $callerAssetId );
|
||||
|
||||
# FIX: Temporary solution (broken map due to template rendering <script> tags)
|
||||
return $i18n->get('bad tags') if $output =~ /script>/;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue