root / drupal7 / sites / all / modules / flag / theme / flag.tpl.php @ 4cfd8be6
1 | 85ad3d82 | Assos Assos | <?php
|
---|---|---|---|
2 | |||
3 | /**
|
||
4 | * @file
|
||
5 | 76e2e7c3 | Assos Assos | * Default theme implementation to display a flag link, and a message after the
|
6 | * action is carried out.
|
||
7 | 85ad3d82 | Assos Assos | *
|
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 | 76e2e7c3 | Assos Assos | * - $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 | 85ad3d82 | Assos Assos | *
|
17 | 76e2e7c3 | Assos Assos | * - $action: The action the link is about to carry out, either "flag" or
|
18 | * "unflag".
|
||
19 | 85ad3d82 | Assos Assos | * - $status: The status of the item; either "flagged" or "unflagged".
|
20 | 4cfd8be6 | Assos Assos | * - $entity_id: The id of the entity item.
|
21 | 85ad3d82 | Assos Assos | *
|
22 | 4cfd8be6 | Assos Assos | * - $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 | 85ad3d82 | Assos Assos | * - $link_text: The text to show for the link.
|
26 | * - $link_title: The title attribute for the link.
|
||
27 | *
|
||
28 | 76e2e7c3 | Assos Assos | * - $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 | 85ad3d82 | Assos Assos | * the message.
|
33 | 76e2e7c3 | Assos Assos | * - $after_flagging: This template is called for the link both before and after
|
34 | * being
|
||
35 | 85ad3d82 | Assos Assos | * 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 | 4cfd8be6 | Assos Assos | * - $errors: An array of error messages.
|
41 | 85ad3d82 | Assos Assos | *
|
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 | 76e2e7c3 | Assos Assos | * 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 | 85ad3d82 | Assos Assos | */
|
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"> </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; ?> |