- Ability to move to junk and restore from junk via "Move to junk" and "Restore" buttons on node edit page and in node local menu
- Automatic "garbage collector" which may delete nodes from junk permanently if they exceed their junk lifetime (i.e. automatically delete nodes for being in Junk for more then 5 days). Though there is an option to never delete junked nodes automatically.
- It uses CTools Page Manager (http://drupal.org/project/ctools) to limit access to the junked node and alter it's output. This way it doesn't ruin node output of latest Panels 3.0 module (which also uses CTools Page Manager) but integrates with it.
- Integration with Views 2 (http://drupal.org/project/views) providing own fields and filters
- Integration with Rules (http://drupal.org/project/rules) providing 2 events - one for moving node to junk and one for restoring
- Option to unpublish node after moving to junk automatically
- Option to filter out junked nodes in core node listings (and any other using db_rewrite_sql) and in any View
Here are the reasons why Junk module should be contributed to Drupal community while having some cross-functionality with following modules:
- Trash module (http://drupal.org/project/trash) doesn't work with contributed modules which implement altering node view callback (such as Panels 3) - Trash simply ruins other module's functionality and that is because of Trash architecture which is it's core feature. It also uses "-1" node.status which is something like hacking Drupal core. All this was the first reason why I decided to develop Junk (being active Panels user).
- Trasbin module (http://drupal.org/project/trashbin) - is a very simple and lightweight module which only provides 1 Rules event which you can use to mark node as "trashed" by another module. It doesn't store trashed nodes and doesn't have any mechanism of restoring or viewing trashed nodes to stay lightweight.
- Killfile module (http://drupal.org/project/killfile) doesn't have any clean way of viewing and restoring killfiled nodes (http://drupal.org/node/339437) and limits access to nodes via menu rather then give user options like altering output, unpublishing, using Rules.
Junk module all-in-one solution for indicated purpose and it doesn't hack core or ruin other modules while integrating with CTools, Views and Rules.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | junk.zip | 15.24 KB | AliraSirin |
| #8 | junk.zip | 15.53 KB | AliraSirin |
| #4 | junk.zip | 15.46 KB | AliraSirin |
| #1 | junk.zip | 16.82 KB | AliraSirin |
Comments
Comment #1
AliraSirin commentedThe module is attached.
Comment #2
avpadernoComment #3
avpadernoSchema descriptions should not be passed to
t()anymore. See system_schema() for an example of what done by Drupal core code.There is no need to set Drupal variables to the default value; the default value is returned from
variable_get()when the Drupal variable has not been already set.Menu callback titles, and descriptions should not be passed to
t()because that is already done by Drupal core code.An empty string should not be passed to
t(); you cannot translate an empty string, which is an emptry string independently from the language set.See the Drupal coding standards to understand how a module code should be written. In particular, see the part about how to format the code.
The string is not translated.
Is there a case where numbers need to be translated?
If the module would call
system_settings_form(), that code would not be necessary.As there are already projects with the same purpose, the proposed module should first resolve the points I listed.
Comment #4
AliraSirin commentedThank you for the review! Here is the new version with fixed format and other points resolved.
Comment #5
avpadernohook_enable()is settings two Drupal variables that the code doesn't use; if those variables are used from another module, then the code should first verify if that module is enabled.Comment #6
AliraSirin commentedThanks for the new review! Though I have some questions on the points:
1. About the variables in hook_enable() - this variables are used by CTools Page Manager module, Junk has a dependency on it defined in .info file. So it can't be enabled without Page Manager being enabled already. OG Panels module which uses CTools Page Manager same way doesn't check if it's enabled when setting variable on hook_enable(). So is it really necessary?
2. Could you please provide more detailes on this point?
Comment #7
avpadernoIf those variables are used from the module from which your module depends, then what I reported is not necessary. It's not clear if the names of the variables were not correct, so I pointed out that part of the code.
About the code reported in point #2, you wrote , when I guess you meant .
Comment #8
AliraSirin commentedAh, now I feel like an idiot with the second point :)
Here is an updated version with all points resolved.
Comment #9
avpadernoSee comment #3, point #2.
Comment #10
AliraSirin commentedI'm sorry. That's quite strange cause I remember fixing it.
Comment #11
avpadernoI apologize for the time it took me before to review the code.
Comment #12
AliraSirin commentedThank you kiamlaluno and no need to apologize, I know you are quite busy here.
Comment #15
avpaderno