source: trunk/include/page_header.php @ 13170

Last change on this file since 13170 was 13074, checked in by rvelices, 12 years ago
  • remove square/thumb from choices on picture
  • fix content margin on password register
  • purge derivative cache by type of derivative
  • session saved infos/messages are not given to the page on html redirections
  • shorter/faster code in functions_xxx
  • Property svn:eol-style set to LF
File size: 3.7 KB
RevLine 
[345]1<?php
[362]2// +-----------------------------------------------------------------------+
[8728]3// | Piwigo - a PHP based photo gallery                                    |
[2297]4// +-----------------------------------------------------------------------+
[12922]5// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
[2297]6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
8// +-----------------------------------------------------------------------+
9// | This program is free software; you can redistribute it and/or modify  |
10// | it under the terms of the GNU General Public License as published by  |
11// | the Free Software Foundation                                          |
12// |                                                                       |
13// | This program is distributed in the hope that it will be useful, but   |
14// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
15// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
16// | General Public License for more details.                              |
17// |                                                                       |
18// | You should have received a copy of the GNU General Public License     |
19// | along with this program; if not, write to the Free Software           |
20// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
21// | USA.                                                                  |
22// +-----------------------------------------------------------------------+
[1071]23
[345]24//
25// Start output of page
26//
[1376]27$template->set_filenames(array('header'=>'header.tpl'));
[345]28
[1590]29trigger_action('loc_begin_page_header');
30
[2240]31$template->assign(
[405]32  array(
[850]33    'GALLERY_TITLE' =>
34      isset($page['gallery_title']) ?
35        $page['gallery_title'] : $conf['gallery_title'],
[1071]36
37    'PAGE_BANNER' =>
[12008]38      trigger_event(
39        'render_page_banner',
40        str_replace(
41          '%gallery_title%',
42          $conf['gallery_title'],
43          isset($page['page_banner']) ? $page['page_banner'] : $conf['page_banner']
44          )
45        ),
[1071]46
[850]47    'BODY_ID' =>
48      isset($page['body_id']) ?
49        $page['body_id'] : '',
[1071]50
[3095]51    'REVERSE' =>
52      (isset($conf['reverse_home_title']) and $conf['reverse_home_title']) ?
53        true : false,
54
[2126]55    'CONTENT_ENCODING' => get_pwg_charset(),
[1120]56    'PAGE_TITLE' => strip_tags($title),
[1071]57
[11368]58    'U_HOME' => get_gallery_home_url(),
[405]59    ));
60
[1677]61
62// Header notes
[2240]63if ( !empty($header_notes) )
[1677]64{
[2240]65  $template->assign('header_notes',$header_notes);
[1677]66}
67
[3041]68// No referencing is required
[13074]69if ( !$conf['meta_ref'] )
[3041]70{
71  $page['meta_robots']['noindex'] = 1;
72  $page['meta_robots']['nofollow'] = 1;
73}
74
[1703]75if ( !empty($page['meta_robots']) )
76{
[2240]77  $template->append('head_elements',
78        '<meta name="robots" content="'
79        .implode(',', array_keys($page['meta_robots']))
80        .'">'
[1703]81    );
82}
[3041]83if ( !isset($page['meta_robots']['noindex']) )
[13074]84{
85  $template->assign('meta_ref',1);
[3041]86}
[1703]87
[1578]88// refresh
89if ( isset( $refresh ) and intval($refresh) >= 0
[2521]90    and isset( $url_link ) )
[1578]91{
[2240]92  $template->assign(
[1578]93    array(
[2240]94      'page_refresh' => array(
95            'TIME' => $refresh,
96            'U_REFRESH' => $url_link
97          )
[1578]98      ));
99}
[13074]100else
101{// messages only if no redirection
102  foreach (array('errors','infos') as $mode)
103  {
104    if (isset($_SESSION['page_'.$mode]))
105    {
106      $page[$mode] = array_merge($page[$mode], $_SESSION['page_'.$mode]);
107      unset($_SESSION['page_'.$mode]);
108    }
[1512]109
[13074]110    if (count($page[$mode]) != 0)
111    {
112      $template->assign($mode, $page[$mode]);
113    }
[12764]114  }
115}
[1590]116trigger_action('loc_end_page_header');
117
[2126]118header('Content-Type: text/html; charset='.get_pwg_charset());
[688]119$template->parse('header');
[1778]120
121trigger_action('loc_after_page_header');
[2159]122?>
Note: See TracBrowser for help on using the repository browser.