update Admin with asset even in operations
This commit is contained in:
parent
9d148236ba
commit
f0d4bfff13
1 changed files with 14 additions and 7 deletions
|
|
@ -254,14 +254,21 @@ if ($self->session->user->isRegistered || $self->session->setting->get("preventP
|
||||||
|
|
||||||
# TODO: Figure out if user is still in the admin console
|
# TODO: Figure out if user is still in the admin console
|
||||||
$var{'head.tags'} .= '<script type="text/javascript">';
|
$var{'head.tags'} .= '<script type="text/javascript">';
|
||||||
if ( $session->asset ) {
|
my $asset = $session->asset;
|
||||||
|
|
||||||
|
# If user is in an operation, find the right asset
|
||||||
|
if ( !$asset && $session->form->get('op') ) {
|
||||||
|
$asset = WebGUI::Asset->newByUrl( $session );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $asset ) {
|
||||||
my $assetDef = {
|
my $assetDef = {
|
||||||
assetId => $session->asset->getId,
|
assetId => $asset->getId,
|
||||||
title => $session->asset->getTitle,
|
title => $asset->getTitle,
|
||||||
url => $session->asset->getUrl,
|
url => $asset->getUrl,
|
||||||
icon => $session->asset->getIcon(1),
|
icon => $asset->getIcon(1),
|
||||||
type => $session->asset->assetName,
|
type => $asset->assetName,
|
||||||
helpers => $session->asset->getHelpers,
|
helpers => $asset->getHelpers,
|
||||||
};
|
};
|
||||||
$var{'head.tags'} .= sprintf <<'ADMINJS', JSON->new->encode( $assetDef );
|
$var{'head.tags'} .= sprintf <<'ADMINJS', JSON->new->encode( $assetDef );
|
||||||
if ( window.parent && window.parent.admin ) {
|
if ( window.parent && window.parent.admin ) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue