simplenews-block.tpl.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation to display the simplenews block.
  5. *
  6. * Copy this file in your theme directory to create a custom themed block.
  7. * Rename it to simplenews-block--<tid>.tpl.php to override it for a
  8. * newsletter using the newsletter term's id.
  9. *
  10. * Available variables:
  11. * - $subscribed: the current user is subscribed to the $tid newsletter
  12. * - $user: the current user is authenticated
  13. * - $tid: tid of the newsletter
  14. * - $message: announcement message (Default: 'Stay informed on our latest news!')
  15. * - $form: newsletter subscription form *1
  16. * - $subscription_link: link to subscription form at 'newsletter/subscriptions' *1
  17. * - $newsletter_link: link to taxonomy list of the newsletter issue *2
  18. * - $issue_list: list of newsletter issues (of the $tid newsletter series) *2
  19. * - $rssfeed: RSS feed of newsletter (series) *2
  20. * Note 1: requires 'subscribe to newsletters' permission
  21. * Note 2: requires 'view links in block' or 'administer newsletters' permission
  22. *
  23. * Simplenews module controls the display of the block content. The following
  24. * variables are available for this purpose:
  25. * - $use_form : TRUE = display the form; FALSE = display link to example.com/newsletter/subscriptions
  26. * - $use_issue_link : TRUE = display link to newsletter issue list
  27. * - $use_issue_list : TRUE = display list of the newsletter issue
  28. * - $use_rss : TRUE = display RSS feed
  29. *
  30. * @see template_preprocess_simplenews_block()
  31. */
  32. ?>
  33. <?php if ($message): ?>
  34. <p><?php print $message; ?></p>
  35. <?php endif; ?>
  36. <?php if ($use_form): ?>
  37. <?php print render($form); ?>
  38. <?php elseif ($subscription_link): ?>
  39. <p><?php print $subscription_link; ?></p>
  40. <?php endif; ?>
  41. <?php if ($use_issue_link && $newsletter_link): ?>
  42. <div class="issues-link"><?php print $newsletter_link; ?></div>
  43. <?php endif; ?>
  44. <?php if ($use_issue_list && $issue_list): ?>
  45. <div class="issues-list"><?php print $issue_list; ?></div>
  46. <?php endif; ?>
  47. <?php if ($use_rss): ?>
  48. <?php print $rssfeed; ?>
  49. <?php endif; ?>