source: trunk/include/page_header.php @ 2240

Last change on this file since 2240 was 2240, checked in by rvelices, 16 years ago

header.tpl goes smart

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
5// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
6// +-----------------------------------------------------------------------+
7// | file          : $Id: page_header.php 2240 2008-03-02 00:29:27Z rvelices $
8// | last update   : $Date: 2008-03-02 00:29:27 +0000 (Sun, 02 Mar 2008) $
9// | last modifier : $Author: rvelices $
10// | revision      : $Revision: 2240 $
11// +-----------------------------------------------------------------------+
12// | This program is free software; you can redistribute it and/or modify  |
13// | it under the terms of the GNU General Public License as published by  |
14// | the Free Software Foundation                                          |
15// |                                                                       |
16// | This program is distributed in the hope that it will be useful, but   |
17// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
18// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
19// | General Public License for more details.                              |
20// |                                                                       |
21// | You should have received a copy of the GNU General Public License     |
22// | along with this program; if not, write to the Free Software           |
23// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
24// | USA.                                                                  |
25// +-----------------------------------------------------------------------+
26
27//
28// Start output of page
29//
30$template->set_filenames(array('header'=>'header.tpl'));
31
32trigger_action('loc_begin_page_header');
33
34$template->assign(
35  array(
36    'GALLERY_TITLE' =>
37      isset($page['gallery_title']) ?
38        $page['gallery_title'] : $conf['gallery_title'],
39
40    'PAGE_BANNER' =>
41      trigger_event('render_page_banner',
42        isset($page['page_banner']) ?
43          $page['page_banner'] : $conf['page_banner']),
44
45    'BODY_ID' =>
46      isset($page['body_id']) ?
47        $page['body_id'] : '',
48
49    'CONTENT_ENCODING' => get_pwg_charset(),
50    'PAGE_TITLE' => strip_tags($title),
51    'LANG'=>$lang_info['code'],
52    'DIR'=>$lang_info['direction'],
53
54    'U_HOME' => make_index_url(),
55    ));
56
57
58// Header notes
59if ( !empty($header_notes) )
60{
61  $template->assign('header_notes',$header_notes);
62}
63
64if ( !empty($page['meta_robots']) )
65{
66  $template->append('head_elements',
67        '<meta name="robots" content="'
68        .implode(',', array_keys($page['meta_robots']))
69        .'">'
70    );
71}
72
73// refresh
74if ( isset( $refresh ) and intval($refresh) >= 0
75    and isset( $url_link ) and isset( $redirect_msg ) )
76{
77  $template->assign(
78    array(
79      'REDIRECT_MSG' => $redirect_msg,
80      'page_refresh' => array(
81            'TIME' => $refresh,
82            'U_REFRESH' => $url_link
83          )
84      ));
85}
86
87trigger_action('loc_end_page_header');
88
89header('Content-Type: text/html; charset='.get_pwg_charset());
90$template->parse('header');
91
92trigger_action('loc_after_page_header');
93?>
Note: See TracBrowser for help on using the repository browser.