improvements to admin/content/spam
| Project: | Spam |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | minor |
| Assigned: | gnassar |
| Status: | active |
Jump to:
admin/content/spam is useful, because it allows the user to see both node and comment spam in one page. it could do with some improvements though.
#1 - allow delete from admin/content/comments/list/spam
It would be good to allow the user to delete spam nodes and comments directly from this page. Obviously this would be somewhat redundant, as the functionality is already provided by admin/content/comments/list/spam and admin/content/node, however bringing them all together would make the workflow much quicker, and less confusing for new users.
#2 - provide link to spam
admin/content/spam currently provides a link to the comment edit form via the title of the comment (ie. comment/edit/15138). The link on the title of the comment should instead re-direct to the actual comment (ie. path/to/node#comment-15138), and a separate link should be provided to edit the comment, probably in the same was as it's done on admin/content/comments/list/spam - with a column called "operations", and a link called "edit".
Obviously neither of these are critical, and I might have a crack at it some time in the future, depending on how much time I have.

#1
#1 -- that's already available. It's not in admin/content/spam, though -- maybe that's what you meant? I thought it'd be useful to have it there too; I think the reason that it's not is due to the potential difference in deleting different kinds of content. Really, when I think of it in those terms, I almost think the admin/content/spam page shouldn't exist, and instead spam administration should happen in each individual content type. Not sure what the usefulness is of seeing ex. comment and profile spam in the same place. But I'll probably leave it as-is unless my worries actually start being realized.
#2 -- agreed. Not a massively high priority, but a link to the comment makes more sense. That will get changed at some point. Should be a one-liner, as soon as I get a chance to look at it.
#2
#1 - yes, that's what I meant. I agree this is a bit convoluted. The other problem is the lack of consistencey between comment spam (which has it's own tab), and content spam (which doesn't). Removing the admin/content/spam page would make it difficult to place the feedback tab anywhere though.
I think the best solution would probably be to move ALL spam related admin pages to admin/content/spam, and have separate tabs for content and comments. Also move the admin/settings/spam page there too*, so you end up with 5 tabs:
* there are a number of other modules that are doing this, and it make far more sense. No point cluttering the admin page, and the admin/settings/spam page still relates to content really...
#2 - And then generally try to make the node spam and comment spam tables have similar features to the admin/content/(comment|content) tables, plus the relevant spam stuff..
#3
There'd have to be a tab for user profile spam as well. And what happens when somebody uses the API to write another content module? Seems like that menu would get pretty cluttered itself.
I think I'd prefer:
* perhaps an Akismet-style overview page; I don't know how useful that would be, so I'd think for UI purposes that would be better used as a "statistics" page that is farther down the menu list
* a "Spam" page, with all types of content marked a spam, and a clearly exposed filter to allow you to just see ex. comment spam if you wish
* "Feedback"
* and on whatever the front page of these would be, a link to the spam settings page in Settings. I have never liked combining the "action" and "settings" pages -- when I'm looking for module configuration, I like the ability to click on "site configuration" and look for the module. That's more intuitive to me. But a link to the Settings page would remedy that for those for whom it isn't.
This will probably all wait a while -- I want to leave the 6.x-1.x version untouched for a little bit (save new issues) and put a beta release out if it's as stable as I'm hoping it proves to be.
#4
A combined spam page as well as per-content-type spam pages was requested based on user feedback in earlier iterations of this module, if I remember correctly. I suppose getting rid of the per-content-type pages isn't a big deal if it's possible to filter the overview page on a per-content-type basis. Less redundancy, and in the end probably more powerful.
The location of the Settings page is one of those things that never seems to be right. Wherever you put it, it works for some and not for others. That said, it really isn't important to me where it ends up, so move it if you like.
#5
subscribe
#6
Hrm, I'm just having a poke around trying to get the delete function in there. This is what I have so far, not sure if it's the best way to go about it (and it doesn't actually work yet):
diff -u spam/spam.module /var/www/drupal/sites/all/modules/spam/spam.module--- spam/spam.module 2009-08-10 13:03:11.000000000 +1000
+++ /var/www/drupal/sites/all/modules/spam/spam.module 2009-11-17 15:43:27.000000000 +1100
@@ -1337,7 +1337,7 @@
'#suffix' => '</div>',
);
// Set desired callbacks as a subset of spam_spam_operations().
- $options = array('markasnotspam'=>array(), 'publish'=>array(), 'unpublish'=>array());
+ $options = array('markasnotspam'=>array(), 'publish'=>array(), 'unpublish'=>array(), 'delete'=>array());
$alloptions = module_invoke_all('spam_operations');
foreach ($options as $operation => $array) {
$options[$operation] = $alloptions[$operation]['label'];
@@ -1488,6 +1488,11 @@
'callback' => 'spam_operations_callback',
'callback arguments' => array('unpublish'),
),
+ 'delete' => array(
+ 'label' => t('Delete'),
+ 'callback' => 'spam_operations_callback',
+ 'callback arguments' => array('delete'),
+ ),
);
return $operations;
}
@@ -2108,3 +2113,14 @@
cache_clear_all();
spam_update_statistics(t('publish @type', array('@type' => $type)));
}
+
+/**
+ * Invoke delete action for given content type.
+ * TODO: Integrate with the Actions module.
+ */
+function spam_delete($type, $id, $extra = array()) {
+ spam_log(SPAM_VERBOSE, 'node_delete', t('deleted'), $type, $id);
+ spam_invoke_module($type, 'delete', $id, $extra);
+ cache_clear_all();
+ spam_update_statistics(t('delete @type', array('@type' => $type)));
+}