Projet

Général

Profil

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

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

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_height = theme_get_setting('header_height');
92
  if (!empty($header_height)) $header_style .= 'height: ' . $header_height . ';';
93
  $header_bg_file = check_url(theme_get_setting('header_bg_file'));
94
  if ($header_bg_file) {
95
    $header_style .= 'filter:;background: url(' . $header_bg_file . ') repeat ';
96
    $header_style .= theme_get_setting('header_bg_alignment') . ';';
97
  }
98
  if ($layout_style == 2 || $header_bg_file) {
99
    // no header margin, so skip header borders to make it nicer
100
    $header_style .= 'border: none;';
101
  }
102
  else {
103
    $header_border_width = theme_get_setting('header_border_width');
104
    $header_style .= 'border-width: ' . $header_border_width . ';';
105
  }
106

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

    
113
  $logo_style = '';
114
  $logo_left_margin = theme_get_setting('logo_left_margin');
115
  if (empty($logo_left_margin)) $logo_left_margin = '0px';
116
  $logo_top_margin = theme_get_setting('logo_top_margin');
117
  if (empty($logo_top_margin)) $logo_top_margin = '0px';
118
  $logo_style = 'margin-left: ' . $logo_left_margin . '; margin-top: ' . $logo_top_margin . ';';
119

    
120
  $sitename_style = '';
121
  $sitename_left_margin = theme_get_setting('sitename_left_margin');
122
  if (empty($sitename_left_margin)) $sitename_left_margin = '0px';
123
  $sitename_top_margin = theme_get_setting('sitename_top_margin');
124
  if (empty($sitename_top_margin)) $sitename_top_margin = '0px';
125
  $sitename_style = 'margin-left: ' . $sitename_left_margin . '; margin-top: ' . $sitename_top_margin . ';';
126

    
127
  $searchbox_style = '';
128
  $searchbox_right_margin = theme_get_setting('searchbox_right_margin');
129
  if (empty($searchbox_right_margin)) $searchbox_right_margin = '0px';
130
  $searchbox_top_margin = theme_get_setting('searchbox_top_margin');
131
  if (empty($searchbox_top_margin)) $searchbox_top_margin = '0px';
132
  $searchbox_style = 'margin-right: ' . $searchbox_right_margin . '; margin-top: ' . $searchbox_top_margin . ';';
133

    
134
  $menubar_style = '';
135
  $menubar_bg_value = theme_get_setting('menubar_bg_value');
136
  if (theme_get_setting('menubar_background') == 1) $menubar_style = ' style=" background-color: ' . $menubar_bg_value . ';"';
137

    
138
  $fontsizer_top_margin = (intval($searchbox_top_margin) + 3) . 'px';
139
  $fontsizer_style = 'margin-top: ' . $fontsizer_top_margin . ';';
140

    
141
  if (theme_get_setting('header_fontsizer')) {
142
    drupal_add_js(drupal_get_path('theme', 'mayo') . '/js/mayo-fontsize.js');
143
  }
144
  if ($page['top_column_first'] ||
145
      $page['top_column_second'] ||
146
      $page['top_column_third'] ||
147
      $page['top_column_fourth'] ||
148
      $page['bottom_column_first'] ||
149
      $page['bottom_column_second'] ||
150
      $page['bottom_column_third'] ||
151
      $page['bottom_column_fourth']) {
152
    drupal_add_js(drupal_get_path('theme', 'mayo') . '/js/mayo-columns.js');
153
  }
154
?>
155

    
156
<div id="page-wrapper" style="<?php echo $page_wrapper_style; ?>">
157
  <div id="page" style="<?php echo $page_style; ?>">
158

    
159
    <div id="header" style="<?php echo $header_style; ?>">
160
    <div id="header-watermark" style="<?php echo $header_watermark_style; ?>">
161
    <div class="section clearfix">
162

    
163
      <?php if ($logo): ?>
164
        <div id="logo" style="<?php echo $logo_style; ?>">
165
        <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home">
166
          <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
167
        </a>
168
        </div> <!-- /#logo -->
169
      <?php endif; ?>
170

    
171
      <?php if ($site_name || $site_slogan): ?>
172
        <div id="name-and-slogan" style="<?php echo $sitename_style; ?>">
173
          <?php if ($site_name): ?>
174
            <?php if ($title): ?>
175
              <div id="site-name"><strong>
176
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
177
              </strong></div>
178
            <?php else: /* Use h1 when the content title is empty */ ?>
179
              <h1 id="site-name">
180
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
181
              </h1>
182
            <?php endif; ?>
183
          <?php endif; ?>
184

    
185
          <?php if ($site_slogan): ?>
186
            <div id="site-slogan"><?php print $site_slogan; ?></div>
187
          <?php endif; ?>
188
        </div> <!-- /#name-and-slogan -->
189
      <?php endif; ?>
190

    
191
      <?php if ((theme_get_setting('header_searchbox')) && function_exists('search_box')) { ?>
192
        <div id="header-searchbox" style="<?php echo $searchbox_style; ?>">
193
      <?php  $output_form = drupal_get_form('search_block_form'); print render($output_form); ?>
194
        </div>
195
      <?php } ?>
196

    
197
      <?php if (theme_get_setting('header_fontsizer')) { ?>
198
        <div id="header-fontsizer" style="<?php echo $fontsizer_style; ?>">
199
        <a href="#" class="decreaseFont" title="Decrease text size"></a>
200
        <a href="#" class="resetFont"    title="Restore default text size"></a>
201
        <a href="#" class="increaseFont" title="Increase text size"></a>
202
        </div>
203
      <?php } ?>
204

    
205
      <div class="clearfix cfie"></div>
206

    
207
      <?php print render($page['header']); ?>
208

    
209
    </div> <!-- /.section -->
210
    </div> <!-- /#header-watermark -->
211
    </div> <!-- /#header -->
212

    
213
    <?php if ($main_menu || $secondary_menu) { ?>
214
      <div id="navigation"><div class="section">
215
        <?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')))); ?>
216
        <?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix')))); ?>
217
      </div></div> <!-- /.section, /#navigation -->
218
    <?php } ?>
219

    
220
    <div class="clearfix cfie"></div>
221

    
222
    <!-- for nice_menus, superfish -->
223
    <?php if ($page['menubar']) { ?>
224
    <div id="menubar" class="menubar clearfix"<?php if(!empty($menubar_style)) echo $menubar_style; ?>>
225
      <?php print render($page['menubar']); ?>
226
    </div>
227
    <?php } ?>
228
    <?php if ($page['submenubar']) { ?>
229
    <div id="submenubar" class="menubar clearfix">
230
      <?php print render($page['submenubar']); ?>
231
    </div>
232
    <?php } ?>
233

    
234
    <!-- space between menus and contents -->
235
    <div class="spacer clearfix cfie"></div>
236

    
237

    
238
    <div id="main-wrapper">
239
    <div id="main" class="clearfix" style="<?php echo $main_style; ?>">
240

    
241
      <?php print $messages; ?>
242

    
243
      <?php if ($page['banner_top']) { ?>
244
      <div id="banner-top" class="banner clearfix"><?php print render($page['banner_top']); ?></div>
245
      <div class="spacer clearfix cfie"></div>
246
      <?php } ?>
247

    
248
      <?php if ($page['top_column_first'] | $page['top_column_second'] |
249
              $page['top_column_third'] | $page['top_column_fourth']) { ?>
250
      <div id="top-wrapper">
251
        <div id="top-columns" class="clearfix">
252
        <?php print mayo_build_columns( array(
253
            $page['top_column_first'],
254
            $page['top_column_second'],
255
            $page['top_column_third'],
256
            $page['top_column_fourth'],
257
          ));
258
        ?>
259
        </div> <!--/#top-columns -->
260
      </div> <!-- /#top-wrapper -->
261
      <?php } ?>
262

    
263
      <div class="clearfix cfie"></div>
264

    
265

    
266
      <!-- main content -->
267
      <div id="content" class="column"><div class="section">
268

    
269
        <?php if ($page['highlighted']) { ?>
270
          <div id="highlighted"><?php print render($page['highlighted']); ?></div>
271
        <?php } ?>
272

    
273
        <?php if ($breadcrumb && theme_get_setting('display_breadcrumb')) { ?>
274
          <div id="breadcrumb"><?php print $breadcrumb; ?></div>
275
        <?php } ?>
276

    
277
        <a id="main-content"></a>
278
        <?php print render($title_prefix); ?>
279
        <?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
280
        <?php print render($title_suffix); ?>
281
        <?php if ($tabs): ?><div class="tabs clearfix"><?php print render($tabs); ?></div><?php endif; ?>
282
        <?php print render($page['help']); ?>
283
        <?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
284
        <?php print render($page['content']); ?>
285
        <?php print $feed_icons; ?>
286

    
287
      </div></div> <!-- /.section, /#content -->
288

    
289
      <!-- sidebar (first) -->
290
      <?php if ($page['sidebar_first']){ ?>
291
        <div id="sidebar-first" class="column sidebar"><div class="section">
292
          <?php print render($page['sidebar_first']); ?>
293
        </div></div> <!-- /.section, /#sidebar-first -->
294
      <?php } ?>
295

    
296
      <!-- sidebar (second) -->
297
            <?php if ($page['sidebar_second']) { ?>
298
        <div id="sidebar-second" class="column sidebar"><div class="section">
299
          <?php print render($page['sidebar_second']); ?>
300
        </div></div> <!-- /.section, /#sidebar-second -->
301
      <?php } ?>
302

    
303

    
304
      <div class="clearfix cfie"></div>
305

    
306
      <?php if ($page['bottom_column_first'] | $page['bottom_column_second'] |
307
              $page['bottom_column_third'] | $page['bottom_column_fourth']) { ?>
308
      <div id="bottom-wrapper">
309
        <div id="bottom-columns" class="clearfix">
310
        <?php print mayo_build_columns( array(
311
            $page['bottom_column_first'],
312
            $page['bottom_column_second'],
313
            $page['bottom_column_third'],
314
            $page['bottom_column_fourth'],
315
          ));
316
        ?>
317
        </div> <!--/#bottom-columns -->
318
      </div> <!-- /#bottom-wrapper -->
319
      <?php } ?>
320

    
321
      <div class="clearfix cfie"></div>
322

    
323

    
324
      <?php if ($page['banner_bottom']) { ?>
325
      <div id="spacer" class="clearfix cfie"></div>
326
      <div id="banner-bottom" class="banner clearfix"><?php print render($page['banner_bottom']); ?></div>
327
      <?php } ?>
328

    
329
    </div> <!-- /#main -->
330
    </div> <!-- /#main-wrapper -->
331

    
332
    <!-- space between contents and footer -->
333
    <div id="spacer" class="clearfix cfie"></div>
334

    
335
    <div id="footer-wrapper">
336
      <?php if ($page['footer_column_first'] | $page['footer_column_second'] |
337
              $page['footer_column_third'] | $page['footer_column_fourth']) { ?>
338
      <div id="footer-columns" class="clearfix">
339
      <?php print mayo_build_columns( array(
340
          $page['footer_column_first'],
341
          $page['footer_column_second'],
342
          $page['footer_column_third'],
343
          $page['footer_column_fourth'],
344
        ));
345
      ?>
346
      </div> <!--/#footer-columns -->
347
      <?php } ?>
348

    
349
      <?php if ($page['footer']) { ?>
350
      <div id="footer"><div class="section">
351
        <?php print render($page['footer']); ?>
352
      </div></div> <!-- /.section, /#footer -->
353
      <?php } ?>
354

    
355
    </div> <!-- /#footer-wrapper -->
356
  </div> <!-- /#page -->
357
</div> <!-- /#page-wrapper -->