Projet

Général

Profil

Paste
Télécharger (4,29 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / adaptivetheme / at_core / templates / block.tpl.php @ 87dbc3bf

1
<?php
2
/**
3
 * @file
4
 * Adativetheme implementation to display a block.
5
 *
6
 * The block template in Adaptivetheme is a little different to most other themes.
7
 * Instead of hard coding its markup Adaptivetheme generates most of it in
8
 * adaptivetheme_process_block(), conditionally printing outer and inner wrappers.
9
 *
10
 * This allows the core theme to have just one template instead of five.
11
 *
12
 * You can override this in your sub-theme with a normal block suggestion and use
13
 * a standard block template if you prefer, or use your own themeName_process_block()
14
 * function to control the markup. For example a typical navigation tempate might look
15
 * like this:
16
 *
17
 * @code
18
 * <nav id="<?php print $block_html_id; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>>
19
 *   <div class="block-inner clearfix">
20
 *     <?php print render($title_prefix); ?>
21
 *     <?php if ($block->subject): ?>
22
 *       <h2<?php print $title_attributes; ?>><?php print $block->subject; ?></h2>
23
 *     <?php endif; ?>
24
 *     <?php print render($title_suffix); ?>
25
 *     <div<?php print $content_attributes; ?>>
26
 *       <?php print $content ?>
27
 *     </div>
28
 *   </div>
29
 * </nav>
30
 * @endcode
31
 *
32
 * Adativetheme supplied variables:
33
 * - $outer_prefix: Holds a conditional element such as nav, section or div and
34
 *                  includes the block id, classes and attributes.
35
 * - $outer_suffix: Closing element.
36
 * - $inner_prefix: Inner div with .block-inner and .clearfix classes.
37
 * - $inner_suffix: Closing div.
38
 * - $title: Holds the block->subject.
39
 * - $content_processed: Pre-wrapped in div and attributes, but for some
40
 *   blocks these are stripped away, e.g. menu bar and main content.
41
 * - $is_mobile: Mixed, requires the Mobile Detect or Browscap module to return
42
 *   TRUE for mobile.  Note that tablets are also considered mobile devices.  
43
 *   Returns NULL if the feature could not be detected.
44
 * - $is_tablet: Mixed, requires the Mobile Detect to return TRUE for tablets.
45
 *   Returns NULL if the feature could not be detected.
46
 *
47
 * Available variables:
48
 * - $block->subject: Block title.
49
 * - $content: Block content.
50
 * - $block->module: Module that generated the block.
51
 * - $block->delta: An ID for the block, unique within each module.
52
 * - $block->region: The block region embedding the current block.
53
 * - $classes: String of classes that can be used to style contextually through
54
 *   CSS. It can be manipulated through the variable $classes_array from
55
 *   preprocess functions. The default values can be one or more of the
56
 *   following:
57
 *   - block: The current template type, i.e., "theming hook".
58
 *   - block-[module]: The module generating the block. For example, the user
59
 *     module is responsible for handling the default user navigation block. In
60
 *     that case the class would be 'block-user'.
61
 * - $title_prefix (array): An array containing additional output populated by
62
 *   modules, intended to be displayed in front of the main title tag that
63
 *   appears in the template.
64
 * - $title_suffix (array): An array containing additional output populated by
65
 *   modules, intended to be displayed after the main title tag that appears in
66
 *   the template.
67
 *
68
 * Helper variables:
69
 * - $classes_array: Array of html class attribute values. It is flattened
70
 *   into a string within the variable $classes.
71
 * - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
72
 * - $zebra: Same output as $block_zebra but independent of any block region.
73
 * - $block_id: Counter dependent on each block region.
74
 * - $id: Same output as $block_id but independent of any block region.
75
 * - $is_front: Flags true when presented in the front page.
76
 * - $logged_in: Flags true when the current user is a logged-in member.
77
 * - $is_admin: Flags true when the current user is an administrator.
78
 * - $block_html_id: A valid HTML ID and guaranteed unique.
79
 *
80
 * @see template_preprocess()
81
 * @see template_preprocess_block()
82
 * @see template_process()
83
 * @see adaptivetheme_preprocess_block()
84
 * @see adaptivetheme_process_block()
85
 */
86
?>
87
<?php print $outer_prefix . $inner_prefix; ?>
88
  <?php print render($title_prefix); ?>
89

    
90
  <?php if ($title): ?>
91
    <h2<?php print $title_attributes; ?>><?php print $title; ?></h2>
92
  <?php endif; ?>
93

    
94
  <?php print $content_processed; ?>
95

    
96
  <?php print render($title_suffix); ?>
97
<?php print $inner_suffix . $outer_suffix; ?>