Add indicator to trash and clipboard for assets with children

This commit is contained in:
Graham Knop 2007-07-31 16:38:29 +00:00
parent 1a4b77b435
commit 27b3a4d644
4 changed files with 8 additions and 3 deletions

View file

@ -12,6 +12,7 @@
- fix: Recover Password by Profile Field can now work with subclasses of
WebGUI::Auth::WebGUI and with custom WebGUI::Form::Controls as profile
fields.
- Add indicator to trash and clipboard in asset has children
7.4.0

View file

@ -390,13 +390,14 @@ $self->session->style->setLink($self->session->url->extras('assetManager/assetMa
\n";
foreach my $child (@{$self->getAssetsInClipboard($limit)}) {
my $title = $child->getTitle;
my $plus = $child->getChildCount({includeTrash => 1}) ? "+ " : "    ";
$title =~ s/\'/\\\'/g;
$output .= "assetManager.AddLine('"
.WebGUI::Form::checkbox($self->session,{
name=>'assetId',
value=>$child->getId
})
."','<a href=\"".$child->getUrl("func=manageAssets")."\">".$title
."','" . $plus . "<a href=\"".$child->getUrl("func=manageAssets")."\">" . $title
."</a>','<p style=\"display:inline;vertical-align:middle;\"><img src=\"".$child->getIcon(1)."\" style=\"border-style:none;vertical-align:middle;\" alt=\"".$child->getName."\" /></p> ".$child->getName
."','".$self->session->datetime->epochToHuman($child->get("revisionDate"))
."','".formatBytes($child->get("assetSize"))."');\n";

View file

@ -176,7 +176,9 @@ Returns the number of children this asset has. This excludes assets in the trash
sub getChildCount {
my $self = shift;
my ($count) = $self->session->db->quickArray("select count(*) from asset where state in ('published','archived') and parentId=?", [$self->getId]);
my $opts = shift || {};
my $stateWhere = $opts->{includeTrash} ? '' : "state in ('published','archived') and";
my ($count) = $self->session->db->quickArray("select count(*) from asset where $stateWhere parentId=?", [$self->getId]);
return $count;
}

View file

@ -293,12 +293,13 @@ sub www_manageTrash {
foreach my $child (@{$self->getAssetsInTrash($limit)}) {
my $title = $child->getTitle;
$title =~ s/\'/\\\'/g;
my $plus =$child->getChildCount({includeTrash => 1}) ? "+ " : "&nbsp;&nbsp;&nbsp;&nbsp;";
$output .= "assetManager.AddLine('"
.WebGUI::Form::checkbox($self->session, {
name=>'assetId',
value=>$child->getId
})
."','<a href=\"".$child->getUrl("func=manageAssets")."\">".$title
."','" . $plus . "<a href=\"".$child->getUrl("func=manageAssets")."\">" . $title
."</a>','<p style=\"display:inline;vertical-align:middle;\"><img src=\"".$child->getIcon(1)."\" style=\"vertical-align:middle;border-style:none;\" alt=\"".$child->getName."\" /></p> ".$child->getName
."','".$self->session->datetime->epochToHuman($child->get("revisionDate"))
."','".formatBytes($child->get("assetSize"))."');\n";