Fix a problem similar to the Trash/utf-8 in the Clipboard.
This commit is contained in:
parent
ef6eabfa9e
commit
61210fb776
2 changed files with 34 additions and 16 deletions
|
|
@ -662,22 +662,39 @@ sub www_manageClipboard {
|
|||
assetManager.AddColumn('".$i18n->get("last updated")."','','center','');
|
||||
assetManager.AddColumn('".$i18n->get("size")."','','right','');
|
||||
\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
|
||||
})
|
||||
."','" . $plus . "<a href=\"".$child->getUrl("op=assetManager")."\">" . $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";
|
||||
$output .= "assetManager.AddLineSortData('','".$title."','".$child->getName
|
||||
."','".$child->get("revisionDate")."','".$child->get("assetSize")."');\n";
|
||||
}
|
||||
# To avoid string escaping issues
|
||||
my $json = JSON->new->utf8(1);
|
||||
my $amethod = sub {
|
||||
my ($method, @args) = @_;
|
||||
my $array = $json->encode(\@args);
|
||||
$array =~ s/^\[//;
|
||||
$array =~ s/\]$//;
|
||||
$output .= "assetManager.$method($array);\n";
|
||||
};
|
||||
foreach my $child (@{$self->getAssetsInClipboard($limit)}) {
|
||||
my $plus = $child->getChildCount({includeTrash => 1}) ? "+ " : " ";
|
||||
my $title = $child->getTitle;
|
||||
my $name = $child->getName;
|
||||
$amethod->('AddLine',
|
||||
WebGUI::Form::checkbox($self->session,{
|
||||
name=>'assetId',
|
||||
value=>$child->getId
|
||||
}),
|
||||
qq($plus<a href=").$child->getUrl("op=assetManager").qq(">$title</a>),
|
||||
'<p style="display:inline;vertical-align:middle;"><img src="'
|
||||
.$child->getIcon(1)
|
||||
.qq(" style="border-style:none;vertical-align:middle;" alt="$name" /></p> $name),
|
||||
$self->session->datetime->epochToHuman($child->get("revisionDate")),
|
||||
formatBytes($child->get("assetSize"))
|
||||
);
|
||||
$amethod->('AddLineSortData',
|
||||
'',
|
||||
$title,
|
||||
$name,
|
||||
$child->get('revisionDate'),
|
||||
$child->get('assetSize'),
|
||||
);
|
||||
}
|
||||
$output .= '
|
||||
assetManager.AddButton("'.$i18n->get("delete").'","deleteList","manageClipboard");
|
||||
assetManager.AddButton("'.$i18n->get("restore").'","restoreList","manageClipboard");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue