source: branches/2.2/phpgwapi/templates/default/head.inc.php @ 3018

Revision 3018, 4.5 KB checked in by amuller, 14 years ago (diff)

Ticket #1135 - Aplicando alterações do branches 2.0 no branches 2.2

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2        /**************************************************************************\
3        * phpGroupWare                                                             *
4        * http://www.phpgroupware.org                                              *
5        * --------------------------------------------                             *
6        *  This program is free software; you can redistribute it and/or modify it *
7        *  under the terms of the GNU General Public License as published by the   *
8        *  Free Software Foundation; either version 2 of the License, or (at your  *
9        *  option) any later version.                                              *
10        \**************************************************************************/
11
12
13        if($GLOBALS['phpgw_info']['user']['preferences']['common']['show_generation_time'])
14        {
15                $mtime = microtime();
16                $mtime = explode(' ',$mtime);
17                $mtime = $mtime[1] + $mtime[0];
18                $GLOBALS['page_start_time'] = $mtime;
19        }
20
21        // get used language code
22        $lang_code = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
23
24        $bodyheader = ' bgcolor="' . $GLOBALS['phpgw_info']['theme']['bg_color'] . '" alink="'
25                . $GLOBALS['phpgw_info']['theme']['alink'] . '" link="' . $GLOBALS['phpgw_info']['theme']['link'] . '" vlink="'
26                . $GLOBALS['phpgw_info']['theme']['vlink'] . '"';
27
28        if(!$GLOBALS['phpgw_info']['server']['htmlcompliant'])
29        {
30                $bodyheader .= '';
31        }
32        $currentapp = $GLOBALS['phpgw_info']['flags']['currentapp'] ;
33
34        #_debug_array($GLOBALS['phpgw_info']['user']['preferences']['common']);
35
36        //pngfix defaults to yes
37        if(!$GLOBALS['phpgw_info']['user']['preferences']['common']['disable_pngfix'])
38        {
39                $pngfix_src = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/js/pngfix.js';
40                $pngfix ='<!-- This solves the Internet Explorer PNG-transparency bug, but only for IE 5.5 and higher -->
41                <!--[if lt IE 7]>
42                <script src="'.$pngfix_src.'" type="text/javascript">
43                </script>
44                <![endif]-->';
45        }
46
47        if(!$GLOBALS['phpgw_info']['user']['preferences']['common']['disable_slider_effects'])
48        {
49                $slider_effects_src = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/js/slidereffects.js';
50                $slider_effects = '<script src="'.$slider_effects_src.'" type="text/javascript">
51                </script>';
52        }
53        else
54        {
55                $simple_show_hide_src = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/js/simple_show_hide.js';
56                $simple_show_hide = '<script src="'.$simple_show_hide_src.'" type="text/javascript">
57                </script>';
58        }
59
60        $cookie_manager = '<script src="'.$GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/js/cookieManager.js" type="text/javascript"></script>';
61        $tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
62        $tpl->set_unknowns('remove');
63        $tpl->set_file(array('_head' => 'head.tpl'));
64        $tpl->set_block('_head','head');
65
66        $app = $GLOBALS['phpgw_info']['flags']['currentapp'];
67        $app = $app ? ' ['.(isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : lang($app)).']':'';
68
69        $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
70        $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/';
71       
72        if(strrpos($webserver_url,'/') === false || strrpos($webserver_url,'/') != (strlen($webserver_url)-1))
73                $webserver_url .= '/';
74       
75        if( is_null($_SESSION['phpgw_info'][$GLOBALS['phpgw_info']['flags']['currentapp']]['user']))
76                $tmpDefault = "default";
77        else
78                $tmpDefault = $_SESSION['phpgw_info'][$GLOBALS['phpgw_info']['flags']['currentapp']]['user']['preferences']['common']['template_set'];
79
80        $var = Array(
81                'img_icon'      => $webserver_url . $currentapp . '/templates/'.$tmpDefault.'/images/navbar.png',
82                'img_shortcut'  => $webserver_url . $currentapp . '/templates/'.$tmpDefault.'/images/navbar.png',
83                'pngfix'        => $pngfix,
84                'slider_effects'=> $slider_effects,
85                'simple_show_hide'=> $simple_show_hide,
86                'lang_code'=> $lang_code,
87                'charset'       => $GLOBALS['phpgw']->translation->charset(),
88                'font_family'   => $GLOBALS['phpgw_info']['theme']['font'],
89                'website_title' => $GLOBALS['phpgw_info']['server']['site_title'].$app,
90                'body_tags'     => $bodyheader .' '. $GLOBALS['phpgw']->common->get_body_attribs(),
91                'css'           => $GLOBALS['phpgw']->common->get_css(),
92                'java_script'   => $GLOBALS['phpgw']->common->get_java_script(),
93                'cookie_manager'=>      $cookie_manager
94        );
95        $tpl->set_var($var);
96        $tpl->pfp('out','head');
97        unset($tpl);
98?>
Note: See TracBrowser for help on using the repository browser.