Projet

Général

Profil

Paste
Télécharger (2,42 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / flag / theme / flag.tpl.php @ 76e2e7c3

1
<?php
2

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