This module could use small fixes to bring it inline with the Drupal coding standards, particularly:

  • Replace all tabs with two spaces,
  • Placing a space between control words and the proceeding parenthesis, e.g. instead of "if()" it should be "if ()",
  • The opening brace on control structures should be at the end of the first line, not on a separate line of its own,
  • Add a space on both sides of both the assignment operator ("=") and the comparison operators ("=="), e.g. instead of "$foo='bar';" it should be "$foo = 'bar';",
  • Variable names need to use underlines to separate word portions, rather than camelCase, e.g. "$foo_bar" instead of "$fooBar".

A few other recommendations:

  • All output should be wrapped in theme functions,
  • You don't have to wrap drupal_get_path() with url(), i.e. it's sufficient to do this: $imagePath = drupal_get_path('module', 'freetobook_widget');
  • In the .info file you spelled "Drupal" incorrectly ;-)

Good work!

Comments

freetobook’s picture

Assigned: Unassigned » freetobook
Status: Active » Needs review

Thanks for the feedback,

I have reformatted the code, and checked it with the coder module so it should
meet the coding standards now.

I have refactored the output code to use more of the theme_ hooks so
hopefully it is now more consistent with best practices.

I have fixed the 'mis-spelling' in the info file.

damienmckenna’s picture

There are still improvements necessary in the .module file - lots of issues with spacing, many missing comments (every function should have a leading comment), and the new JS file also needs to be formatted correctly. You're almost there :)

freetobook’s picture

Have added additional comments and edited the spacing.

freetobook’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.