I would like to submit a module I' ve created that allows site administrators to enable other users to download the ePub version of the book contents available on the website. What this module basically does is to enable an ePub content type, allowing the admin to create as much ePub contents as he needs. Every ePub content has to be linked to a book outline, and has to have a few extra fields like title, language, author and so on. Once an ePub content is properly created and linked to a book outline, a 'Download ePub' tab will appear on the book outline page, allowing the user to download the .epub file containing the book content on his pc/handheld device. The module also features all the CRUD functionalities to administer the ePub contents, a configuration section, and a 'create ePub' content tab that shows up on book outlines when the module is activated but no ePub content still exists on it.
Further improvements for this module could be custom css file/image for each epub, better advanced_help contents and some unit tests.
I consider it ready for production, since I took quite a lot of care about coding standards, secure queries and comments/documentation.
Finally, this module has a dependency: another module I' ve written called iso_639. What this second tiny module does basically is to create a field and a widget to enable a select list containing all the iso 639 language codes. The field is used for picking a language when creating an epub, I thought that separating this functionality was good for the sake of code reusing and for keeping the module clean and tidy.
Further improvements for this module could be custom css file/image for each epub, better advanced_help contents and some unit tests.
I consider it ready for production, since I took quite a lot of care about coding standards, secure queries and comments/documentation.
Finally, this module has a dependency: another module I' ve written called iso_639. What this second tiny module does basically is to create a field and a widget to enable a select list containing all the iso 639 language codes. The field is used for picking a language when creating an epub, I thought that separating this functionality was good for the sake of code reusing and for keeping the module clean and tidy.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | epub module revision 3.zip | 50.99 KB | omissis |
| #17 | epub module revision 2.zip | 51.38 KB | omissis |
| #1 | epub module.zip | 39.84 KB | omissis |
Comments
Comment #1
omissis commentedComment #2
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.
Comment #3
alexkb commentedHey omissis,
Were you going to provide your iso_639 module too? as your module can't be installed without it.
I've actually recently completed an epub exporter for the epublish module. It's very custom written for a clients needs at present, so its not ready for submitting to drupal.org yet. I was also tossing up, whether it would be better to have an epub like api, that everything can use, like book, epublish, and others.
Looking over your code you've done a lot of work, so well done. I notice though, that you're using additional php libraries that the user installing the module must download first - I've found it easier to create the epub file without the use of external libraries, using the ZipArchive features of php. I'll post back my notes on this in my spare time - perhaps I can help you co-maintain this module.
Anyway, when you post the iso_639 module, I'll be sure to check this out. Cheers.
Comment #4
avpaderno@alexkb: Purpose of the review is to
For such cases, there isn't any reason to install the module.
omissis correctly uploaded a single module, as we review a single theme/module per applicant.
Comment #5
omissis commentedFirst of all thank you for checking the module :)
I am not sure about the issue you' re having with the iso_639 module: it' s included in the zip file, but if I got it well from kiamlaluno's comment that' s not the correct way of submitting a module.
So should I open another Issue for iso_639 itself?
@alexkb: it would be great to get the ideas you were talking about into code, perhaps we can kinda merge the two modules or talk about future developments.
Comment #6
avpaderno@omissis: If iso_639.module is included in the same archive, that is fine; if I review the code, I will report just what I find wrong in the main module. There is no reason to open a different issue for the other module (which is not possible, then); you can create the other project when you will have your CVS account.
Comment #7
omissis commentedok, I will wait for news then. thx :)
Comment #8
alexkb commentedHey omissis, sorry for the delayed reply - I've whacked the crux of what I was doing into this post: http://www.akb.id.au/2010/epub-files-with-php/
Probably best to just go with what you've got though, and we can discuss things in the issue queue for your new module.
Comment #9
omissis commentedI am going to read it asap, thanks :)
Btw I just sent you an email so we can discuss privately about it without generating too much noise here.
Comment #10
kyle_mathews commentedWas this module published as a project? I'm very interested in helping out. Some folks just came out with a wordpress plugin doing something similar to this: http://anthologize.org/
Comment #12
davidzz commentedHi,
I'm very interested in this module as well. What's the current status?
Comment #13
omissis commentedHi, in the meanwhile I added some new features to the module, if you want to try it feel free to drop me your email via the contact form and I'll send you everything.
'Course every feedback is more than welcome :)
Comment #14
avpadernoYou should upload the new archive here too. It doesn't make sense to review code, when the code is already changed; there are chances reviewers would report something that has been already changed.
Comment #15
omissis commentedWell actually I didn' t submit any other update to avoid confusion. Anyway when a reviewer will take a look at the application and will read about the updates he will eventually ask I think. We' ll see, thanks for the suggestion in the meanwhile.
Comment #16
avpadernol()is never used togethert(). See the documentation fort(), where such code is reported to not be correct.The function
t()is then available tohook_install(), andhook_uninstall().t().The character
`is specific to MySQL; there is no need to use it, as the database API functions escape the field names when necessary.Why isn't the code simply using
drupal_write_record().I have never seen an implementation of
hook_insert()callingdrupal_goto().The code is showing nodes data without to verify if the user has access to the node. This is considered a security issue.
Avoid to escape the string delimiter inside of strings, especially the ones that are passed as argument of
t().Comment #17
omissis commentedHi, thanks for the notes, I did the following corrections:
1 - Fixed the two errors in .install file. All the others look fine.
2 - Fixed the menu entry that was using t() in title attribute.
3 - "`" char removed from all files.
4 - Code changed to introduce the use of drupal_write_record() instead of db_queries.
5 - Removed drupal_goto in hook_insert() and in hook_update(). I kept it in hook_delete() though.
6 - Added drupal_rewrite_sql() where missing. In that case the function (a menu callback) should be already protected from unauthorized access by the menu .system which already checks permissions right? Anyway one more check won't hurt. :)
7 - " \' " changed into " ' ", in these cases changed enclosing single quotes into double quotes.
8 - Added variable_del() to hook_uninstall().
Comment #18
avpadernoThe code is still using
st(); the placeholder for URLs is@.There is no need to use
db_rewrite_sql()inhook_uninstall(). The module should not then delete the nodes that use the content type it defines; that is not done from any Drupal core modules.Comment #19
omissis commented1 - Changed st() into t() and changed placeholders from "!" to "@".
2 - Removed delete queries and menu cache clearance.
3 - Removed version from .install file.
Comment #20
avpadernoI will review the code tomorrow morning, but I think it is good to go.
Comment #21
avpadernoRemember to remove any debug code.
Thank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the dedicated reviewers as well.
Comment #22
omissis commenteddone, thanks. Here it is the path of the project: http://drupal.org/project/epub
Comment #25
avpaderno