why use block to show js code?

js code must inserting before tag, so it was better if you remove block and added hook_footer.

also is better to use permission access

thanks.

/**
 * Implementation of hook_perm().
 */
function user_voice_perm() {
  return array('access user voice');
}

/**
 * Implementation of hook_footer().
 */
function user_voice_footer($main = 0) {
  if (user_access('access user voice')) {
    return theme('user_voice');
  }
}

Comments

bohart’s picture

* js code must inserting before < / body > tag

mikemccaffrey’s picture

I'd like to second the request to move the code into the hook_footer function. That is the standard way that other similar modules such as admin_menu handle things.

picxelplay’s picture

performance is also way better this way.