Projet

Général

Profil

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

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

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
 * - $entity_id: The id of the entity item.
21
 *
22
 * - $link['href']: The path for the flag link.
23
 * - $link['query']: Array of query string parameters, such as "destination".
24
 * - $link_href: The URL for the flag link, query string included.
25
 * - $link_text: The text to show for the link.
26
 * - $link_title: The title attribute for the link.
27
 *
28
 * - $message_text: The long message to show after a flag action has been
29
 *   carried out.
30
 * - $message_classes: A space-separated list of CSS classes that should be
31
 *   applied to
32
 *   the message.
33
 * - $after_flagging: This template is called for the link both before and after
34
 *   being
35
 *   flagged. If displaying to the user immediately after flagging, this value
36
 *   will be boolean TRUE. This is usually used in conjunction with immedate
37
 *   JavaScript-based toggling of flags.
38
 * - $needs_wrapping_element: Determines whether the flag displays a wrapping
39
 *   HTML DIV element.
40
 * - $errors: An array of error messages.
41
 *
42
 * Template suggestions available, listed from the most specific template to
43
 * the least. Drupal will use the most specific template it finds:
44
 * - flag--name.tpl.php
45
 * - flag--link-type.tpl.php
46
 *
47
 * NOTE: This template spaces out the <span> tags for clarity only. When doing
48
 * some advanced theming you may have to remove all the whitespace.
49
 */
50
?>
51
<?php if ($needs_wrapping_element): ?>
52
  <div class="flag-outer flag-outer-<?php print $flag_name_css; ?>">
53
<?php endif; ?>
54
<span class="<?php print $flag_wrapper_classes; ?>">
55
  <?php if ($link_href): ?>
56
    <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>
57
  <?php else: ?>
58
    <span class="<?php print $flag_classes ?>"><?php print $link_text; ?></span>
59
  <?php endif; ?>
60
  <?php if ($after_flagging): ?>
61
    <span class="<?php print $message_classes; ?>">
62
      <?php print $message_text; ?>
63
    </span>
64
  <?php endif; ?>
65
</span>
66
<?php if ($needs_wrapping_element): ?>
67
  </div>
68
<?php endif; ?>