started asset helpers
This commit is contained in:
parent
8d432c8be6
commit
a9ff59d7b2
3 changed files with 56 additions and 9 deletions
|
|
@ -210,6 +210,7 @@ sub www_getTreeData {
|
||||||
assetSize => $asset->assetSize,
|
assetSize => $asset->assetSize,
|
||||||
lockedBy => ($asset->isLockedBy ? $asset->lockedBy->username : ''),
|
lockedBy => ($asset->isLockedBy ? $asset->lockedBy->username : ''),
|
||||||
actions => $asset->canEdit && $asset->canEditIfLocked,
|
actions => $asset->canEdit && $asset->canEditIfLocked,
|
||||||
|
helpers => $asset->getHelpers,
|
||||||
);
|
);
|
||||||
|
|
||||||
$fields{ className } = {};
|
$fields{ className } = {};
|
||||||
|
|
@ -225,6 +226,15 @@ sub www_getTreeData {
|
||||||
$assetInfo->{ totalAssets } = $p->getRowCount;
|
$assetInfo->{ totalAssets } = $p->getRowCount;
|
||||||
$assetInfo->{ sort } = $session->form->get( 'orderByColumn' );
|
$assetInfo->{ sort } = $session->form->get( 'orderByColumn' );
|
||||||
$assetInfo->{ dir } = lc $session->form->get( 'orderByDirection' );
|
$assetInfo->{ dir } = lc $session->form->get( 'orderByDirection' );
|
||||||
|
$assetInfo->{ currentAsset } = { title => $asset->getTitle, helpers => $asset->getHelpers };
|
||||||
|
|
||||||
|
$assetInfo->{ crumbtrail } = [];
|
||||||
|
for my $asset ( @{ $asset->getLineage( ['ancestors'], { returnObjects => 1 } ) } ) {
|
||||||
|
push @{ $assetInfo->{crumbtrail} }, {
|
||||||
|
title => $asset->getTitle,
|
||||||
|
url => $asset->getUrl
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
$session->http->setMimeType( 'application/json' );
|
$session->http->setMimeType( 'application/json' );
|
||||||
|
|
||||||
|
|
@ -357,10 +367,9 @@ __DATA__
|
||||||
<div class="yui-content">
|
<div class="yui-content">
|
||||||
<div id="viewTab"><iframe src="<tmpl_var viewUrl>" name="view" style="width: 100%; height: 80%"></iframe></div>
|
<div id="viewTab"><iframe src="<tmpl_var viewUrl>" name="view" style="width: 100%; height: 80%"></iframe></div>
|
||||||
<div id="treeTab">
|
<div id="treeTab">
|
||||||
<div id="treeDataTableContainer">
|
<div id="treeCrumbtrail"></div>
|
||||||
</div>
|
<div id="treeDataTableContainer"></div>
|
||||||
<div id="treePagination">
|
<div id="treePagination"></div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1172,6 +1172,34 @@ sub getExtraHeadTags {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 getHelpers ( )
|
||||||
|
|
||||||
|
Get the AssetHelpers for this asset.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub getHelpers {
|
||||||
|
my ( $self ) = @_;
|
||||||
|
|
||||||
|
my $default = [
|
||||||
|
{
|
||||||
|
class => 'WebGUI::AssetHelper::EditBranch',
|
||||||
|
label => 'Edit Branch',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url => $self->getUrl( 'func=edit' ),
|
||||||
|
label => 'Edit',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url => $self->getUrl( 'func=view' ),
|
||||||
|
label => 'View',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -723,18 +723,18 @@ WebGUI.Admin.Tree.prototype.formatTitle
|
||||||
= function ( elCell, oRecord, oColumn, orderNumber ) {
|
= function ( elCell, oRecord, oColumn, orderNumber ) {
|
||||||
elCell.innerHTML = '<span class="hasChildren">'
|
elCell.innerHTML = '<span class="hasChildren">'
|
||||||
+ ( oRecord.getData( 'childCount' ) > 0 ? "+" : " " )
|
+ ( oRecord.getData( 'childCount' ) > 0 ? "+" : " " )
|
||||||
+ '</span> <a href="' + appendToUrl(oRecord.getData( 'url' ), 'op=assetManager;method=manage') + '">'
|
+ '</span> <span class="clickable">'
|
||||||
+ oRecord.getData( 'title' )
|
+ oRecord.getData( 'title' )
|
||||||
+ '</a>'
|
+ '</span>'
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
WebGUI.Admin.Tree.prototype.goto
|
WebGUI.Admin.Tree.prototype.goto
|
||||||
= function ( assetUrl ) {
|
= function ( assetUrl ) {
|
||||||
var callback = {
|
var callback = {
|
||||||
success : this.dataTable.onDataReturnInitializeTable,
|
success : this.onDataReturnInitializeTable,
|
||||||
failure : this.dataTable.onDataReturnInitializeTable,
|
failure : this.onDataReturnInitializeTable,
|
||||||
scope : this.dataTable,
|
scope : this,
|
||||||
argument: this.dataTable.getState()
|
argument: this.dataTable.getState()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -748,6 +748,16 @@ WebGUI.Admin.Tree.prototype.goto
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* onDataReturnInitializeTable ( sRequest, oResponse, oPayload )
|
||||||
|
* Initialize the table with a new response from the server
|
||||||
|
*/
|
||||||
|
WebGUI.Admin.Tree.prototype.onDataReturnInitializeTable
|
||||||
|
= function ( sRequest, oResponse, oPayload ) {
|
||||||
|
this.dataTable.onDataReturnInitializeTable.call( this.dataTable, sRequest, oResponse, oPayload );
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* removeHighlightFromRow ( child )
|
* removeHighlightFromRow ( child )
|
||||||
* Remove the highlight from a row by removing the "highlight" class.
|
* Remove the highlight from a row by removing the "highlight" class.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue