Projet

Général

Profil

Paste
Télécharger (13 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / mayo / templates / page.tpl.php @ fc457866

1
<?php
2

    
3
/**
4
 * @file
5
 * Default theme implementation to display a single Drupal page.
6
 *
7
 * Available variables:
8
 *
9
 * General utility variables:
10
 * - $base_path: The base URL path of the Drupal installation. At the very
11
 *   least, this will always default to /.
12
 * - $directory: The directory the template is located in, e.g. modules/system
13
 *   or themes/bartik.
14
 * - $is_front: TRUE if the current page is the front page.
15
 * - $logged_in: TRUE if the user is registered and signed in.
16
 * - $is_admin: TRUE if the user has permission to access administration pages.
17
 *
18
 * Site identity:
19
 * - $front_page: The URL of the front page. Use this instead of $base_path,
20
 *   when linking to the front page. This includes the language domain or
21
 *   prefix.
22
 * - $logo: The path to the logo image, as defined in theme configuration.
23
 * - $site_name: The name of the site, empty when display has been disabled
24
 *   in theme settings.
25
 * - $site_slogan: The slogan of the site, empty when display has been disabled
26
 *   in theme settings.
27
 *
28
 * Navigation:
29
 * - $main_menu (array): An array containing the Main menu links for the
30
 *   site, if they have been configured.
31
 * - $secondary_menu (array): An array containing the Secondary menu links for
32
 *   the site, if they have been configured.
33
 * - $breadcrumb: The breadcrumb trail for the current page.
34
 *
35
 * Page content (in order of occurrence in the default page.tpl.php):
36
 * - $title_prefix (array): An array containing additional output populated by
37
 *   modules, intended to be displayed in front of the main title tag that
38
 *   appears in the template.
39
 * - $title: The page title, for use in the actual HTML content.
40
 * - $title_suffix (array): An array containing additional output populated by
41
 *   modules, intended to be displayed after the main title tag that appears in
42
 *   the template.
43
 * - $messages: HTML for status and error messages. Should be displayed
44
 *   prominently.
45
 * - $tabs (array): Tabs linking to any sub-pages beneath the current page
46
 *   (e.g., the view and edit tabs when displaying a node).
47
 * - $action_links (array): Actions local to the page, such as 'Add menu' on the
48
 *   menu administration interface.
49
 * - $feed_icons: A string of all feed icons for the current page.
50
 * - $node: The node object, if there is an automatically-loaded node
51
 *   associated with the page, and the node ID is the second argument
52
 *   in the page's path (e.g. node/12345 and node/12345/revisions, but not
53
 *   comment/reply/12345).
54
 *
55
 * Regions:
56
 * - $page['help']: Dynamic help text, mostly for admin pages.
57
 * - $page['highlighted']: Items for the highlighted content region.
58
 * - $page['content']: The main content of the current page.
59
 * - $page['sidebar_first']: Items for the first sidebar.
60
 * - $page['sidebar_second']: Items for the second sidebar.
61
 * - $page['header']: Items for the header region.
62
 * - $page['footer']: Items for the footer region.
63
 *
64
 * @see template_preprocess()
65
 * @see template_preprocess_page()
66
 * @see template_process()
67
 */
68
?>
69

    
70
<?php
71
  $page_wrapper_style = '';
72
  $base_vmargin = theme_get_setting('base_vmargin');
73
  if (arg(0) == "admin") $base_vmargin = '0px'; // admin page
74
  if (empty($base_vmargin)) $base_vmargin = '0px';
75
  $page_wrapper_style .= ' margin-top: ' . $base_vmargin . '; margin-bottom: ' . $base_vmargin . ';';
76

    
77
  $page_style = '';
78
  $main_style = '';
79
  $layout_style = theme_get_setting('layout_style');
80
  $page_margin = theme_get_setting('page_margin');
81
  if (empty($page_margin)) $page_margin = '0px';
82
  if (arg(0) == "admin") $page_margin = '20px'; // admin page
83
  if ($layout_style == 1) {
84
    $page_style = 'padding: ' . $page_margin . ';';
85
  }
86
  else {
87
    $main_style = 'padding: 0px ' . $page_margin . '; box-sizing: border-box;';
88
  }
89

    
90
  $header_style = '';
91
  $header_bg_file = check_url(theme_get_setting('header_bg_file'));
92
  if ($header_bg_file) {
93
    $header_style .= 'filter:;background: url(' . $header_bg_file . ') repeat ';
94
    $header_style .= theme_get_setting('header_bg_alignment') . ';';
95
  }
96
  if ($layout_style == 2 || $header_bg_file) {
97
    // no header margin, so skip header borders to make it nicer
98
    $header_style .= 'border: none;';
99
  }
100
  else {
101
    $header_border_width = theme_get_setting('header_border_width');
102
    $header_style .= 'border-width: ' . $header_border_width . ';';
103
  }
104

    
105
  $header_watermark_style = '';
106
  $header_watermark = theme_get_setting('header_watermark');
107
  if($header_watermark) {
108
    $header_watermark_style = 'background-image: url(' . file_create_url(drupal_get_path('theme', 'mayo') . '/images/pat-' . $header_watermark . '.png') . ');';
109
  }
110

    
111
  $menubar_style = '';
112
  $menubar_bg_value = theme_get_setting('menubar_bg_value');
113
  if (theme_get_setting('menubar_background') == 1) $menubar_style = ' style=" background-color: ' . $menubar_bg_value . ';"';
114

    
115
  if (theme_get_setting('header_fontsizer')) {
116
    drupal_add_js(drupal_get_path('theme', 'mayo') . '/js/mayo-fontsize.js');
117
  }
118
  if ($page['top_column_first'] ||
119
      $page['top_column_second'] ||
120
      $page['top_column_third'] ||
121
      $page['top_column_fourth'] ||
122
      $page['bottom_column_first'] ||
123
      $page['bottom_column_second'] ||
124
      $page['bottom_column_third'] ||
125
      $page['bottom_column_fourth'] ||
126
      $page['footer_column_first'] ||
127
      $page['footer_column_second'] ||
128
      $page['footer_column_third'] ||
129
      $page['footer_column_fourth']) {
130
    drupal_add_js(drupal_get_path('theme', 'mayo') . '/js/mayo-columns.js',
131
      array('type'=>'file',
132
        'scope'=>'footer',
133
      ));
134
  }
135
?>
136

    
137
<div id="page-wrapper" style="<?php echo $page_wrapper_style; ?>">
138
  <div id="page" style="<?php echo $page_style; ?>">
139

    
140
    <div id="header" style="<?php echo $header_style; ?>">
141
    <div id="header-watermark" style="<?php echo $header_watermark_style; ?>">
142
    <div class="section clearfix">
143

    
144
      <?php if ($logo): ?>
145
        <div id="logo">
146
        <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home">
147
          <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
148
        </a>
149
        </div> <!-- /#logo -->
150
      <?php endif; ?>
151

    
152
      <?php if ($site_name || $site_slogan): ?>
153
        <div id="name-and-slogan">
154
          <?php if ($site_name): ?>
155
            <?php if ($title): ?>
156
              <div id="site-name"><strong>
157
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
158
              </strong></div>
159
            <?php else: /* Use h1 when the content title is empty */ ?>
160
              <h1 id="site-name">
161
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
162
              </h1>
163
            <?php endif; ?>
164
          <?php endif; ?>
165

    
166
          <?php if ($site_slogan): ?>
167
            <div id="site-slogan"><?php print $site_slogan; ?></div>
168
          <?php endif; ?>
169
        </div> <!-- /#name-and-slogan -->
170
      <?php endif; ?>
171

    
172
      <?php if ((theme_get_setting('header_searchbox')) && function_exists('search_box')) { ?>
173
        <div id="header-searchbox">
174
      <?php  $output_form = drupal_get_form('search_block_form'); print render($output_form); ?>
175
        </div>
176
      <?php } ?>
177

    
178
      <?php if (theme_get_setting('header_fontsizer')) { ?>
179
        <div id="header-fontsizer">
180
        <a href="#" class="decreaseFont" title="Decrease text size"></a>
181
        <a href="#" class="resetFont"    title="Restore default text size"></a>
182
        <a href="#" class="increaseFont" title="Increase text size"></a>
183
        </div>
184
      <?php } ?>
185

    
186
      <div class="clearfix cfie"></div>
187

    
188
      <?php print render($page['header']); ?>
189

    
190
    </div> <!-- /.section -->
191
    </div> <!-- /#header-watermark -->
192
    </div> <!-- /#header -->
193

    
194
    <?php if ($main_menu || $secondary_menu) { ?>
195
      <div id="navigation"><div class="section">
196
        <?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')))); ?>
197
        <?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix')))); ?>
198
      </div></div> <!-- /.section, /#navigation -->
199
    <?php } ?>
200

    
201
    <div class="clearfix cfie"></div>
202

    
203
    <!-- for nice_menus, superfish -->
204
    <?php if ($page['menubar']) { ?>
205
    <div id="menubar" class="menubar clearfix"<?php if(!empty($menubar_style)) echo $menubar_style; ?>>
206
      <?php print render($page['menubar']); ?>
207
    </div>
208
    <?php } ?>
209
    <?php if ($page['submenubar']) { ?>
210
    <div id="submenubar" class="menubar clearfix">
211
      <?php print render($page['submenubar']); ?>
212
    </div>
213
    <?php } ?>
214

    
215
    <!-- space between menus and contents -->
216
    <div class="spacer clearfix cfie"></div>
217

    
218

    
219
    <div id="main-wrapper">
220
    <div id="main" class="clearfix" style="<?php echo $main_style; ?>">
221

    
222
      <?php print $messages; ?>
223

    
224
      <?php if ($page['banner_top']) { ?>
225
      <div id="banner-top" class="banner clearfix"><?php print render($page['banner_top']); ?></div>
226
      <div class="spacer clearfix cfie"></div>
227
      <?php } ?>
228

    
229
      <?php if ($page['top_column_first'] | $page['top_column_second'] |
230
              $page['top_column_third'] | $page['top_column_fourth']) { ?>
231
      <div id="top-wrapper">
232
        <div id="top-columns" class="clearfix">
233
        <?php print mayo_build_columns( array(
234
            $page['top_column_first'],
235
            $page['top_column_second'],
236
            $page['top_column_third'],
237
            $page['top_column_fourth'],
238
          ));
239
        ?>
240
        </div> <!--/#top-columns -->
241
      </div> <!-- /#top-wrapper -->
242
      <?php } ?>
243

    
244
      <div class="clearfix cfie"></div>
245

    
246

    
247
      <!-- main content -->
248
      <div id="content" class="column"><div class="section">
249

    
250
        <?php if ($page['highlighted']) { ?>
251
          <div id="highlighted"><?php print render($page['highlighted']); ?></div>
252
        <?php } ?>
253

    
254
        <?php if ($breadcrumb && theme_get_setting('display_breadcrumb')) { ?>
255
          <div id="breadcrumb"><?php print $breadcrumb; ?></div>
256
        <?php } ?>
257

    
258
        <a id="main-content"></a>
259
        <?php print render($title_prefix); ?>
260
        <?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
261
        <?php print render($title_suffix); ?>
262
        <?php if ($tabs): ?><div class="tabs clearfix"><?php print render($tabs); ?></div><?php endif; ?>
263
        <?php print render($page['help']); ?>
264
        <?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
265
        <?php print render($page['content']); ?>
266
        <?php print $feed_icons; ?>
267

    
268
      </div></div> <!-- /.section, /#content -->
269

    
270
      <!-- sidebar (first) -->
271
      <?php if ($page['sidebar_first']){ ?>
272
        <div id="sidebar-first" class="column sidebar"><div class="section">
273
          <?php print render($page['sidebar_first']); ?>
274
        </div></div> <!-- /.section, /#sidebar-first -->
275
      <?php } ?>
276

    
277
      <!-- sidebar (second) -->
278
            <?php if ($page['sidebar_second']) { ?>
279
        <div id="sidebar-second" class="column sidebar"><div class="section">
280
          <?php print render($page['sidebar_second']); ?>
281
        </div></div> <!-- /.section, /#sidebar-second -->
282
      <?php } ?>
283

    
284

    
285
      <div class="clearfix cfie"></div>
286

    
287
      <?php if ($page['bottom_column_first'] | $page['bottom_column_second'] |
288
              $page['bottom_column_third'] | $page['bottom_column_fourth']) { ?>
289
      <div id="bottom-wrapper">
290
        <div id="bottom-columns" class="clearfix">
291
        <?php print mayo_build_columns( array(
292
            $page['bottom_column_first'],
293
            $page['bottom_column_second'],
294
            $page['bottom_column_third'],
295
            $page['bottom_column_fourth'],
296
          ));
297
        ?>
298
        </div> <!--/#bottom-columns -->
299
      </div> <!-- /#bottom-wrapper -->
300
      <?php } ?>
301

    
302
      <div class="clearfix cfie"></div>
303

    
304

    
305
      <?php if ($page['banner_bottom']) { ?>
306
      <div id="spacer" class="clearfix cfie"></div>
307
      <div id="banner-bottom" class="banner clearfix"><?php print render($page['banner_bottom']); ?></div>
308
      <?php } ?>
309

    
310
    </div> <!-- /#main -->
311
    </div> <!-- /#main-wrapper -->
312

    
313
    <!-- space between contents and footer -->
314
    <div id="spacer" class="clearfix cfie"></div>
315

    
316
    <div id="footer-wrapper">
317
      <?php if ($page['footer_column_first'] | $page['footer_column_second'] |
318
              $page['footer_column_third'] | $page['footer_column_fourth']) { ?>
319
      <div id="footer-columns" class="clearfix">
320
      <?php print mayo_build_columns( array(
321
          $page['footer_column_first'],
322
          $page['footer_column_second'],
323
          $page['footer_column_third'],
324
          $page['footer_column_fourth'],
325
        ));
326
      ?>
327
      </div> <!--/#footer-columns -->
328
      <?php } ?>
329

    
330
      <?php if ($page['footer']) { ?>
331
      <div id="footer"><div class="section">
332
        <?php print render($page['footer']); ?>
333
      </div></div> <!-- /.section, /#footer -->
334
      <?php } ?>
335

    
336
    </div> <!-- /#footer-wrapper -->
337
  </div> <!-- /#page -->
338
</div> <!-- /#page-wrapper -->