Magento后台产品多图管理模块文件:app/design/adminhtml/default/default/template/catalog/product/helper/gallery.phtml
找到
<thead>
<tr class="headings">
<th><?php echo Mage::helper('catalog')->__('Image') ?></th>
<th><?php echo Mage::helper('catalog')->__('Label') ?></th>
<th><?php echo Mage::helper('catalog')->__('Sort Order') ?></th>
<?php foreach ($_block->getImageTypes() as $typeId=>$type): ?>
<th><?php echo $type['label'] ?></th>
<?php endforeach; ?>
<th><?php echo Mage::helper('catalog')->__('Exclude') ?></th>
<th class="last"><?php echo Mage::helper('catalog')->__('Remove') ?> | <em onclick="checkAll()">全选</em> | <em onclick="uncheckAll()">全不选</em></th>
</tr>
</thead>
js部分
<script>
function uncheckAll() {
var a = window.document.getElementsByTagName("input");
for (var i = 0; i < a.length; i++) {
if (a[i].type == "checkbox" && a[i].disabled == false) {
a[i].checked = true;
a[i].click();
}
}
}
function checkAll() {
var a = window.document.getElementsByTagName("input");
for (var i = 0; i < a.length; i++) {
if (a[i].type == "checkbox" && a[i].disabled == false) {
a[i].checked = false;
a[i].click();
}
}
}
</script>