flag.tpl.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation to display a flag link, and a message after the action
  5. * is carried out.
  6. *
  7. * Available variables:
  8. *
  9. * - $flag: The flag object itself. You will only need to use it when the
  10. * following variables don't suffice.
  11. * - $flag_name_css: The flag name, with all "_" replaced with "-". For use in 'class'
  12. * attributes.
  13. * - $flag_classes: A space-separated list of CSS classes that should be applied to the link.
  14. *
  15. * - $action: The action the link is about to carry out, either "flag" or "unflag".
  16. * - $status: The status of the item; either "flagged" or "unflagged".
  17. *
  18. * - $link_href: The URL for the flag link.
  19. * - $link_text: The text to show for the link.
  20. * - $link_title: The title attribute for the link.
  21. *
  22. * - $message_text: The long message to show after a flag action has been carried out.
  23. * - $after_flagging: This template is called for the link both before and after being
  24. * flagged. If displaying to the user immediately after flagging, this value
  25. * will be boolean TRUE. This is usually used in conjunction with immedate
  26. * JavaScript-based toggling of flags.
  27. *
  28. * NOTE: This template spaces out the <span> tags for clarity only. When doing some
  29. * advanced theming you may have to remove all the whitespace.
  30. */
  31. ?>
  32. <span class="<?php print $flag_wrapper_classes; ?>">
  33. <?php if ($link_href): ?>
  34. <a href="<?php print $link_href; ?>" title="<?php print $link_title; ?>" class="<?php print $flag_classes ?>" rel="nofollow">
  35. <span class="op">
  36. <?php if($action == "flag"): ?>
  37. +
  38. <?php elseif ($action == 'unflag'): ?>
  39. x
  40. <?php endif; ?>
  41. </span>
  42. <span><?php print $link_text; ?></span>
  43. </a>
  44. <?php //<span class="flag-throbber">&nbsp;</span> ?>
  45. <?php else: ?>
  46. <span class="<?php print $flag_classes ?>"><?php print $link_text; ?></span>
  47. <?php endif; ?>
  48. <?php if ($after_flagging && false): ?>
  49. <span class="flag-message flag-<?php print $status; ?>-message">
  50. <?php print $message_text; ?>
  51. </span>
  52. <?php endif; ?>
  53. </span>