Make WordPress Core

Ticket #2508: edit-comments.php.diff

File edit-comments.php.diff, 1.6 KB (added by robmiller, 19 years ago)
  • edit-comments.php

     
    2323                }
    2424        }
    2525}
     26
     27function getNumChecked(form)
     28{
     29        var num = 0;
     30        for (i = 0, n = form.elements.length; i < n; i++) {
     31                if(form.elements[i].type == "checkbox") {
     32                        if(form.elements[i].checked == true)
     33                                num++;
     34                }
     35        }
     36        return num;
     37}
    2638//-->
    2739</script>
    2840<div class="wrap">
     
    168180                } // end foreach
    169181        ?></table>
    170182    <p><a href="javascript:;" onclick="checkAll(document.getElementById('deletecomments')); return false; "><?php _e('Invert Checkbox Selection') ?></a></p>
    171             <p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="return confirm('<?php _e("You are about to delete these comments permanently \\n  \'Cancel\' to stop, \'OK\' to delete.") ?>')" />
     183            <p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); return confirm('<?php printf(__("You are about to delete %s comments permanently \\n  \'Cancel\' to stop, \'OK\' to delete."), "' + numchecked + '"); ?>')" />
    172184                        <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam &raquo;') ?>" onclick="return confirm('<?php _e("You are about to mark these comments as spam \\n  \'Cancel\' to stop, \'OK\' to mark as spam.") ?>')" /></p>
    173185  </form>
    174186<?php