feedback_simple.module 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * @file
  4. * Module file.
  5. */
  6. /**
  7. * Implements hook_theme().
  8. */
  9. function feedback_simple_theme($existing, $type, $theme, $path) {
  10. return array(
  11. 'feedback_simple' => array(
  12. 'variables' => array(
  13. 'link' => 'contact',
  14. 'align' => 'right',
  15. 'class' => array('feedback_simple'),
  16. 'top' => '75%',
  17. 'alt' => t('feedback'),
  18. 'image' => base_path() . drupal_get_path('module', 'feedback_simple') . '/feedback_simple.gif',
  19. 'height' => '100',
  20. 'width' => '35',
  21. 'enabled' => true,
  22. ),
  23. 'template' => 'feedback_simple',
  24. ),
  25. );
  26. }
  27. /**
  28. * Implements hook_preprocess_feedback_simple().
  29. */
  30. function feedback_simple_preprocess_feedback_simple(&$variables) {
  31. // Hide the tab when on the $link page.
  32. if (current_path() == $variables['link']) {
  33. $variables['enabled'] = false;
  34. }
  35. // Allow Drupal to apply base_path and locale prefix outside of the
  36. // theme registry cache.
  37. $variables['link'] = url($variables['link']);
  38. }
  39. /**
  40. * Implements hook_page_build().
  41. */
  42. function feedback_simple_page_build(&$page) {
  43. $page['page_bottom']['feedback_simple'] = array(
  44. '#type' => 'markup',
  45. '#markup' => theme('feedback_simple'),
  46. '#attached' => array(
  47. 'css' => array(drupal_get_path('module', 'feedback_simple') . '/feedback_simple.css'),
  48. ),
  49. );
  50. }