' . getHeader( $session );
-
- ### Crumbtrail
- my $crumb_markup = '
%s >';
- my $ancestorIter = $currentAsset->getLineageIterator( ['ancestors'] );
-
- $output .= '
';
- while ( 1 ) {
- my $ancestor;
- eval { $ancestor = $ancestorIter->() };
- if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
- $session->log->error($x->full_message);
- next;
- }
- last unless $ancestor;
- $output .= sprintf $crumb_markup,
- $ancestor->getUrl( 'op=assetManager;method=manage' ),
- $ancestor->get( "menuTitle" ),
- ;
- }
-
- # And ourself
- $output .= sprintf q{ },
- $currentAsset->getUrl,
- ($currentAsset->canEdit && $currentAsset->canEditIfLocked ? 1 : 0),
- $currentAsset->get( "menuTitle" ),
- ;
- $output .= '
';
-
- ### The page of assets
- $output .= sprintf <
asset->getUrl, WebGUI::Form::CsrfToken->new($session)->toHtml, $i18n->get( 'with selected' ), $i18n->get( "update" ), $i18n->get( "delete" ), $i18n->get( '43' ), $i18n->get( 'cut' ), $i18n->get( "Copy" ), $i18n->get( "duplicate" );
-
-EOHTML
-
- ### Clearing div
- $output .= q{
};
-
- tie my %options, 'Tie::IxHash';
- my $hasClips = 0;
- my $clipNum = 0;
- foreach my $asset (@{$currentAsset->getAssetsInClipboard(1)}) {
- $options{$asset->getId} = '
'.$asset->getTitle;
- $hasClips = 1;
- $clipNum++;
- }
- if ($hasClips) {
- $output .= ' '
- .'';
- }
-
- ## Packages
- $output .= '';
-
- ### Clearing div
- $output .= q{
};
- $output .= q{ };
-
- ### Write the JavaScript that will take over
- $output .= '
-ENDJS
-
- return $ac->render( $output );
-}
-
-#----------------------------------------------------------------------------
-
-=head2 www_search ( session )
-
-Search assets underneath this asset.
-
-=cut
-
-sub www_search {
- my $session = shift;
- my $ac = WebGUI::AdminConsole->new( $session, "assets" );
- my $i18n = WebGUI::International->new( $session, "Asset" );
- my $currentAsset = getCurrentAsset($session);
- my $output = '' . getHeader( $session );
-
- $session->style->setCss( $session->url->extras( 'yui-webgui/build/assetManager/assetManager.css' ));
- $session->style->setScript( $session->url->extras( 'yui/build/yahoo-dom-event/yahoo-dom-event.js' ) );
- $session->style->setScript( $session->url->extras( 'yui-webgui/build/assetManager/assetManager.js' ) );
- $session->style->setScript( $session->url->extras( 'yui-webgui/build/form/form.js' ) );
- my $keywords = $session->form->get('keywords') || $session->scratch->get('assetManagerSearchKeywords');
-
- ### Show the form
- $output .= q{
}
- ;
-
- ### Run the search
- if ( $keywords || $session->form->get( 'class' ) ) {
- my @classes = $session->form->get( 'class' );
- my $keywordsScrubbed = $keywords;
-
- # Detect a helper word key
- my @assetIds = ($keywords =~ /assetid:\s*([^\s]+)/gi);
-
- # purge helper word keys
- if (@assetIds) {
- $keywordsScrubbed =~ s/\bassetid:\s*[^\s]+//gi;
- }
- $keywordsScrubbed =~ s/^\s+//g;
- $keywordsScrubbed =~ s/\s+$//g;
-
- my $p = getSearchPaginator( $session, {
- assetIds => \@assetIds,
- keywords => $keywordsScrubbed,
- classes => \@classes,
- orderByColumn => $session->form->get( 'orderByColumn' ),
- orderByDirection => $session->form->get( 'orderByDirection' ),
- } );
-
- if ( $p->getRowCount == 0 ) {
- $output .= q{
} . $i18n->get( 'no results' ) . q{
};
- }
- else {
- ### Display the search results
- $output .= q{
}
- ;
-
- ### Page links
- $output .= q{
} . $p->getBarAdvanced . q{
};
-
- ### Page description
- $output .= sprintf q{
} . $i18n->get( 'page indicator' ) . q{
},
- $p->getPageNumber,
- $p->getNumberOfPages,
- ;
-
- ### Clearing div
- $output .= q{
};
- }
- }
-
- $output .= '
';
-
- $session->scratch->set('assetManagerSearchKeywords', $keywords);
- return $ac->render( $output );
-}
-
-
-1;