source: trunk/phpgwapi/templates/default/head.inc.php @ 2561

Revision 2561, 3.9 KB checked in by rodsouza, 14 years ago (diff)

Ticket #1009 - Corrigindo problemas com a execução de javascript no ExpressoMail?.

  • 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        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode',
48                ( ( ! $GLOBALS['phpgw_info']['user']['preferences']['common']['disable_slider_effects'] ) ? 'slidereffects' : 'simple_show_hide' ),
49                'phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'], true );
50
51        $tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
52        $tpl->set_unknowns('remove');
53        $tpl->set_file(array('_head' => 'head.tpl'));
54        $tpl->set_block('_head','head');
55
56        $app = $GLOBALS['phpgw_info']['flags']['currentapp'];
57        $app = $app ? ' ['.(isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : lang($app)).']':'';
58
59        $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
60        $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/';
61       
62        if(strrpos($webserver_url,'/') === false || strrpos($webserver_url,'/') != (strlen($webserver_url)-1))
63                $webserver_url .= '/';
64       
65        if( is_null($_SESSION['phpgw_info'][$GLOBALS['phpgw_info']['flags']['currentapp']]['user']))
66                $tmpDefault = "default";
67        else
68                $tmpDefault = $_SESSION['phpgw_info'][$GLOBALS['phpgw_info']['flags']['currentapp']]['user']['preferences']['common']['template_set'];
69
70        $var = Array(
71                'img_icon'      => $webserver_url . $currentapp . '/templates/'.$tmpDefault.'/images/navbar.png',
72                'img_shortcut'  => $webserver_url . $currentapp . '/templates/'.$tmpDefault.'/images/navbar.png',
73                'pngfix'        => $pngfix,
74                'slider_effects'=> $slider_effects,
75                'simple_show_hide'=> '',//$simple_show_hide,
76                'lang_code'=> $lang_code,
77                'charset'       => $GLOBALS['phpgw']->translation->charset(),
78                'font_family'   => $GLOBALS['phpgw_info']['theme']['font'],
79                'website_title' => $GLOBALS['phpgw_info']['server']['site_title'].$app,
80                'body_tags'     => $bodyheader .' '. $GLOBALS['phpgw']->common->get_body_attribs(),
81                'css'           => $GLOBALS['phpgw']->common->get_css(),
82                'java_script'   => $GLOBALS['phpgw']->common->get_java_script(),
83                'cookie_manager'=> ''
84        );
85        $tpl->set_var($var);
86        $tpl->pfp('out','head');
87        unset($tpl);
88?>
Note: See TracBrowser for help on using the repository browser.