Do not display a select all button in the AssetManager unless there's more than 1 asset.

This commit is contained in:
Colin Kuskie 2009-06-17 17:44:45 +00:00
parent 4320d39b1c
commit d1038fb698
2 changed files with 8 additions and 2 deletions

View file

@ -464,16 +464,21 @@ ENDHTML
tie my %options, 'Tie::IxHash';
my $hasClips = 0;
my $clipNum = 0;
foreach my $asset (@{$currentAsset->getAssetsInClipboard(1)}) {
$options{$asset->getId} = '<img src="'.$asset->getIcon(1).'" alt="'.$asset->getName.'" style="border: 0px;" /> '.$asset->getTitle;
$hasClips = 1;
$clipNum++;
}
if ($hasClips) {
$output .= '<div class="functionPane"><fieldset><legend>'.$i18n->get(1082).'</legend>'
.WebGUI::Form::formHeader($session, {action=>$currentAsset->getUrl})
.WebGUI::Form::hidden($session,{name=>"func",value=>"pasteList"})
.WebGUI::Form::checkbox($session,{extras=>'onclick="toggleClipboardSelectAll(this.form);"'})
.' '.$i18n->get("select all").'<br />'
.( $clipNum > 1
? WebGUI::Form::checkbox($session,{extras=>'onclick="toggleClipboardSelectAll(this.form);"'}).' '.$i18n->get("select all").'<br />'
: ''
)
.WebGUI::Form::checkList($session,{name=>"assetId",vertical=>1,options=>\%options})
.'<br />'
.WebGUI::Form::submit($session,{value=>"Paste"})