Projet

Général

Profil

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

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

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
      $page['footer_column_first'] ||
153
      $page['footer_column_second'] ||
154
      $page['footer_column_third'] ||
155
      $page['footer_column_fourth']) {
156
    drupal_add_js(drupal_get_path('theme', 'mayo') . '/js/mayo-columns.js');
157
  }
158
?>
159

    
160
<div id="page-wrapper" style="<?php echo $page_wrapper_style; ?>">
161
  <div id="page" style="<?php echo $page_style; ?>">
162

    
163
    <div id="header" style="<?php echo $header_style; ?>">
164
    <div id="header-watermark" style="<?php echo $header_watermark_style; ?>">
165
    <div class="section clearfix">
166

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

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

    
189
          <?php if ($site_slogan): ?>
190
            <div id="site-slogan"><?php print $site_slogan; ?></div>
191
          <?php endif; ?>
192
        </div> <!-- /#name-and-slogan -->
193
      <?php endif; ?>
194

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

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

    
209
      <div class="clearfix cfie"></div>
210

    
211
      <?php print render($page['header']); ?>
212

    
213
    </div> <!-- /.section -->
214
    </div> <!-- /#header-watermark -->
215
    </div> <!-- /#header -->
216

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

    
224
    <div class="clearfix cfie"></div>
225

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

    
238
    <!-- space between menus and contents -->
239
    <div class="spacer clearfix cfie"></div>
240

    
241

    
242
    <div id="main-wrapper">
243
    <div id="main" class="clearfix" style="<?php echo $main_style; ?>">
244

    
245
      <?php print $messages; ?>
246

    
247
      <?php if ($page['banner_top']) { ?>
248
      <div id="banner-top" class="banner clearfix"><?php print render($page['banner_top']); ?></div>
249
      <div class="spacer clearfix cfie"></div>
250
      <?php } ?>
251

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

    
267
      <div class="clearfix cfie"></div>
268

    
269

    
270
      <!-- main content -->
271
      <div id="content" class="column"><div class="section">
272

    
273
        <?php if ($page['highlighted']) { ?>
274
          <div id="highlighted"><?php print render($page['highlighted']); ?></div>
275
        <?php } ?>
276

    
277
        <?php if ($breadcrumb && theme_get_setting('display_breadcrumb')) { ?>
278
          <div id="breadcrumb"><?php print $breadcrumb; ?></div>
279
        <?php } ?>
280

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

    
291
      </div></div> <!-- /.section, /#content -->
292

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

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

    
307

    
308
      <div class="clearfix cfie"></div>
309

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

    
325
      <div class="clearfix cfie"></div>
326

    
327

    
328
      <?php if ($page['banner_bottom']) { ?>
329
      <div id="spacer" class="clearfix cfie"></div>
330
      <div id="banner-bottom" class="banner clearfix"><?php print render($page['banner_bottom']); ?></div>
331
      <?php } ?>
332

    
333
    </div> <!-- /#main -->
334
    </div> <!-- /#main-wrapper -->
335

    
336
    <!-- space between contents and footer -->
337
    <div id="spacer" class="clearfix cfie"></div>
338

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

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

    
359
    </div> <!-- /#footer-wrapper -->
360
  </div> <!-- /#page -->
361
</div> <!-- /#page-wrapper -->