mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
PNG Bugfix for IE 6 is working on IE 7 (browsercheck)
This commit is contained in:
parent
dfa524628c
commit
8727151c9a
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* eGW API - framework
|
||||
*
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de> rewrite in 12/2006
|
||||
* @author Pim Snel <pim@lingewoud.nl> author of the idots template set
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
/**
|
||||
* eGW API - framework: virtual base class for all template sets
|
||||
*
|
||||
*
|
||||
* This class creates / renders the eGW framework:
|
||||
* a) html header
|
||||
* b) navbar
|
||||
@ -22,12 +22,12 @@
|
||||
* d) main application area
|
||||
* e) footer
|
||||
* It replaces several methods in the common class and the diverse templates.
|
||||
*
|
||||
* Existing apps either set $GLOBALS['egw_info']['flags']['noheader'] and call $GLOBALS['egw']->common->egw_header() and
|
||||
*
|
||||
* Existing apps either set $GLOBALS['egw_info']['flags']['noheader'] and call $GLOBALS['egw']->common->egw_header() and
|
||||
* (if $GLOBALS['egw_info']['flags']['nonavbar'] is true) parse_navbar() or it's done by the header.inc.php include.
|
||||
* The app's hook_sidebox then calls the public function display_sidebox().
|
||||
* And the app calls $GLOBALS['egw']->common->egw_footer().
|
||||
*
|
||||
*
|
||||
* This are the authors (and their copyrights) of the original egw_header, egw_footer methods of the common class:
|
||||
* This file written by Dan Kuykendall <seek3r@phpgroupware.org>
|
||||
* and Joseph Engo <jengo@phpgroupware.org>
|
||||
@ -47,7 +47,7 @@ class egw_framework
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* The constructor instanciates the class in $GLOBALS['egw']->framework, from where it should be used
|
||||
*
|
||||
* @return egw_framework
|
||||
@ -61,24 +61,24 @@ class egw_framework
|
||||
$GLOBALS['egw']->framework = $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders an applicaton page with the complete eGW framework (header, navigation and menu)
|
||||
*
|
||||
*
|
||||
* This is the (new) prefered way to render a page in eGW!
|
||||
*
|
||||
* @param string $content html of the main application area
|
||||
* @param string $app_header=null application header, default what's set in $GLOBALS['egw_info']['flags']['app_header']
|
||||
* @param string $navbar=null show the navigation, default !$GLOBALS['egw_info']['flags']['nonavbar'], false gives a typical popu
|
||||
*
|
||||
*
|
||||
*/
|
||||
function render($content,$app_header=null,$navbar=null)
|
||||
{
|
||||
if (!is_null($app_header)) $GLOBALS['egw_info']['flags']['app_header'] = $app_header;
|
||||
if (!is_null($navbar)) $GLOBALS['egw_info']['flags']['nonavbar'] = !$navbar;
|
||||
|
||||
|
||||
echo $this->header();
|
||||
|
||||
|
||||
if (!isset($GLOBALS['egw_info']['flags']['nonavbar']) || !$GLOBALS['egw_info']['flags']['nonavbar'])
|
||||
{
|
||||
echo $this->navbar();
|
||||
@ -95,7 +95,7 @@ class egw_framework
|
||||
*/
|
||||
function header()
|
||||
{
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -105,9 +105,9 @@ class egw_framework
|
||||
*/
|
||||
function navbar()
|
||||
{
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the content of one sidebox
|
||||
*
|
||||
@ -119,7 +119,7 @@ class egw_framework
|
||||
{
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the html from the closing div of the main application area to the closing html-tag
|
||||
*
|
||||
@ -129,7 +129,7 @@ class egw_framework
|
||||
{
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* displays a login screen
|
||||
*
|
||||
@ -140,7 +140,7 @@ class egw_framework
|
||||
{
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* displays a login denied message
|
||||
*
|
||||
@ -150,7 +150,7 @@ class egw_framework
|
||||
{
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get footer as array to eg. set as vars for a template (from idots' head.inc.php)
|
||||
*
|
||||
@ -165,7 +165,7 @@ class egw_framework
|
||||
);
|
||||
if($GLOBALS['egw_info']['user']['preferences']['common']['show_generation_time'])
|
||||
{
|
||||
$totaltime = sprintf('%4.2lf',microtime(true) - $GLOBALS['egw_info']['flags']['page_start_time']);
|
||||
$totaltime = sprintf('%4.2lf',microtime(true) - $GLOBALS['egw_info']['flags']['page_start_time']);
|
||||
|
||||
$var['page_generation_time'] = '<div id="divGenTime"><br/><span>'.lang('Page was generated in %1 seconds',$totaltime);
|
||||
if ($GLOBALS['egw_info']['flags']['session_restore_time'])
|
||||
@ -177,7 +177,7 @@ class egw_framework
|
||||
}
|
||||
$var['powered_by'] = lang('Powered by').' <a href="'.$GLOBALS['egw_info']['server']['webserver_url'].'/about.php">eGroupWare</a> '.lang('version').' '.$GLOBALS['egw_info']['server']['versions']['phpgwapi'];
|
||||
$var['activate_tooltips'] = '<script src="'.$GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/wz_tooltip/wz_tooltip.js" type="text/javascript"></script>';
|
||||
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ class egw_framework
|
||||
{
|
||||
ob_start();
|
||||
// Include the apps footer files if it exists
|
||||
if (EGW_APP_INC != EGW_API_INC && // this prevents an endless inclusion on the homepage
|
||||
if (EGW_APP_INC != EGW_API_INC && // this prevents an endless inclusion on the homepage
|
||||
// (some apps set currentapp in hook_home => it's not releyable)
|
||||
(file_exists (EGW_APP_INC . '/footer.inc.php') || isset($_GET['menuaction'])) &&
|
||||
$GLOBALS['egw_info']['flags']['currentapp'] != 'home' &&
|
||||
@ -199,7 +199,7 @@ class egw_framework
|
||||
!@$GLOBALS['egw_info']['flags']['noappfooter'])
|
||||
{
|
||||
list($app,$class,$method) = explode('.',(string)$_GET['menuaction']);
|
||||
if ($class && is_object($GLOBALS[$class]) && is_array($GLOBALS[$class]->public_functions) &&
|
||||
if ($class && is_object($GLOBALS[$class]) && is_array($GLOBALS[$class]->public_functions) &&
|
||||
isset($GLOBALS[$class]->public_functions['footer']))
|
||||
{
|
||||
$GLOBALS[$class]->footer();
|
||||
@ -212,7 +212,7 @@ class egw_framework
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $content;
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -225,18 +225,18 @@ class egw_framework
|
||||
{
|
||||
// get used language code
|
||||
$lang_code = $GLOBALS['egw_info']['user']['preferences']['common']['lang'];
|
||||
|
||||
|
||||
//pngfix defaults to yes
|
||||
if(!$GLOBALS['egw_info']['user']['preferences']['common']['disable_pngfix'])
|
||||
{
|
||||
$pngfix_src = $GLOBALS['egw_info']['server']['webserver_url'] . '/phpgwapi/templates/idots/js/pngfix.js';
|
||||
$pngfix ='<!-- This solves the Internet Explorer PNG-transparency bug, but only for IE 5.5 and higher -->
|
||||
<!--[if gte IE 5.5000]>
|
||||
$pngfix ='<!-- This solves the Internet Explorer PNG-transparency bug, but only for IE 5.5 - 6.0 and higher -->
|
||||
<!--[if lt IE 7.0]>
|
||||
<script src="'.$pngfix_src.'" type="text/javascript">
|
||||
</script>
|
||||
<![endif]-->';
|
||||
}
|
||||
|
||||
|
||||
if(!$GLOBALS['egw_info']['user']['preferences']['common']['disable_slider_effects'])
|
||||
{
|
||||
$slider_effects_src = $GLOBALS['egw_info']['server']['webserver_url'] . '/phpgwapi/templates/idots/js/slidereffects.js';
|
||||
@ -249,7 +249,7 @@ class egw_framework
|
||||
$simple_show_hide = '<script src="'.$simple_show_hide_src.'" type="text/javascript">
|
||||
</script>';
|
||||
}
|
||||
|
||||
|
||||
if ($GLOBALS['egw_info']['flags']['app_header'])
|
||||
{
|
||||
$app = $GLOBALS['egw_info']['flags']['app_header'];
|
||||
@ -259,9 +259,9 @@ class egw_framework
|
||||
$app = $GLOBALS['egw_info']['flags']['currentapp'];
|
||||
$app = isset($GLOBALS['egw_info']['apps'][$app]) ? $GLOBALS['egw_info']['apps'][$app]['title'] : lang($app);
|
||||
}
|
||||
|
||||
|
||||
if($app!='wiki') $robots ='<meta name="robots" content="none" />';
|
||||
|
||||
|
||||
return $this->_get_css()+array(
|
||||
'img_icon' => EGW_IMAGES_DIR . '/favicon.ico',
|
||||
'img_shortcut' => EGW_IMAGES_DIR . '/favicon.ico',
|
||||
@ -300,12 +300,12 @@ class egw_framework
|
||||
|
||||
// current users for admins
|
||||
$var['current_users'] = $this->_current_users();
|
||||
|
||||
|
||||
// quick add selectbox
|
||||
$var['quick_add'] = $this->_get_quick_add();
|
||||
|
||||
$var['user_info'] = $this->_user_time_info();
|
||||
|
||||
|
||||
|
||||
if($GLOBALS['egw_info']['user']['lastpasswd_change'] == 0)
|
||||
{
|
||||
@ -332,19 +332,19 @@ class egw_framework
|
||||
$var['logo_file'] = $GLOBALS['egw']->common->image('phpgwapi',$GLOBALS['egw_info']['server']['login_logo_file']?$GLOBALS['egw_info']['server']['login_logo_file']:'logo');
|
||||
}
|
||||
$var['logo_url'] = $GLOBALS['egw_info']['server']['login_logo_url']?$GLOBALS['egw_info']['server']['login_logo_url']:'http://www.eGroupWare.org';
|
||||
|
||||
|
||||
if (substr($var['logo_url'],0,4) != 'http')
|
||||
{
|
||||
$var['logo_url'] = 'http://'.$var['logo_url'];
|
||||
}
|
||||
$var['logo_title'] = $GLOBALS['egw_info']['server']['login_logo_title']?$GLOBALS['egw_info']['server']['login_logo_title']:'www.eGroupWare.org';
|
||||
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns html with user and time
|
||||
*
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
@ -362,7 +362,7 @@ class egw_framework
|
||||
{
|
||||
if( $GLOBALS['egw_info']['user']['apps']['admin'] && $GLOBALS['egw_info']['user']['preferences']['common']['show_currentusers'])
|
||||
{
|
||||
$current_users = '<a href="' . $GLOBALS['egw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions') . '">' . lang('Current users') . ': ' . $GLOBALS['egw']->session->total() . '</a>';
|
||||
$current_users = '<a href="' . $GLOBALS['egw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions') . '">' . lang('Current users') . ': ' . $GLOBALS['egw']->session->total() . '</a>';
|
||||
return $current_users;
|
||||
}
|
||||
}
|
||||
@ -376,7 +376,7 @@ class egw_framework
|
||||
{
|
||||
$apps = egw_link::app_list('add');
|
||||
asort($apps); // sort them alphabetic
|
||||
|
||||
|
||||
$options = array(lang('Add').' ...');
|
||||
foreach($apps as $app => $label)
|
||||
{
|
||||
@ -393,10 +393,10 @@ class egw_framework
|
||||
}
|
||||
$options[$action] = $label;
|
||||
}
|
||||
return html::select('quick_add','',$options,true,$options=' onchange="eval(this.value); this.value=0; return false;"');
|
||||
return html::select('quick_add','',$options,true,$options=' onchange="eval(this.value); this.value=0; return false;"');
|
||||
}
|
||||
|
||||
function _get_notification_bell()
|
||||
|
||||
function _get_notification_bell()
|
||||
{
|
||||
return html::div(
|
||||
html::a_href(
|
||||
@ -406,17 +406,17 @@ class egw_framework
|
||||
'id="notificationbell"', // options
|
||||
'', // class
|
||||
'display: none' //style
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Prepare an array with apps used to render the navbar
|
||||
*
|
||||
*
|
||||
* This is similar to the former common::navbar() method - though it returns the vars and does not place them in global scope.
|
||||
*
|
||||
* @internal PHP5 protected
|
||||
* @static
|
||||
* @static
|
||||
* @return array
|
||||
*/
|
||||
function _get_navbar_apps()
|
||||
@ -438,7 +438,7 @@ class egw_framework
|
||||
unset($index);
|
||||
unset($value);
|
||||
unset($newarray);
|
||||
|
||||
|
||||
$apps = array();
|
||||
foreach($GLOBALS['egw_info']['user']['apps'] as $app => $data)
|
||||
{
|
||||
@ -509,10 +509,10 @@ class egw_framework
|
||||
$apps['logout']['url'] = $GLOBALS['egw']->link('/logout.php');
|
||||
$apps['logout']['icon'] = $GLOBALS['egw']->common->image('phpgwapi',Array('logout','nonav'));
|
||||
$apps['logout']['icon_hover'] = $GLOBALS['egw']->common->image_on('phpgwapi',Array('logout','nonav'),'-over');
|
||||
|
||||
|
||||
return $apps;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Used by template headers for including CSS in the header
|
||||
*
|
||||
@ -520,7 +520,7 @@ class egw_framework
|
||||
* 'file_css' - link tag of the app.css file of the current app
|
||||
* 'theme_css' - url of the theme css file
|
||||
* 'print_css' - url of the print css file
|
||||
*
|
||||
*
|
||||
* @internal PHP5 protected
|
||||
* @author Dave Hall (*based* on verdilak? css inclusion code)
|
||||
* @return array with keys 'app_css' from the css method of the menuaction-class and 'file_css' (app.css file of the application)
|
||||
@ -551,7 +551,7 @@ class egw_framework
|
||||
if (!file_exists(EGW_SERVER_ROOT.$css_file))
|
||||
{
|
||||
$css_file = '/'.$appname.'/templates/default/app.css';
|
||||
|
||||
|
||||
if (!file_exists(EGW_SERVER_ROOT.$css_file)) $css_file = '';
|
||||
}
|
||||
if($css_file)
|
||||
@ -574,7 +574,7 @@ class egw_framework
|
||||
$print_css = '/phpgwapi/templates/idots/print.css';
|
||||
}
|
||||
$print_css = $GLOBALS['egw_info']['server']['webserver_url'] . $print_css .'?'.filemtime(EGW_SERVER_ROOT.$print_css);
|
||||
|
||||
|
||||
return array(
|
||||
'app_css' => $app_css,
|
||||
'css_file' => $css_file,
|
||||
@ -597,7 +597,7 @@ class egw_framework
|
||||
function _get_js()
|
||||
{
|
||||
$java_script = '';
|
||||
|
||||
|
||||
// always include javascript helper functions
|
||||
$GLOBALS['egw']->js->validate_file('jsapi','jsapi');
|
||||
|
||||
@ -612,18 +612,18 @@ class egw_framework
|
||||
{
|
||||
$GLOBALS['egw']->js->validate_jsapi();
|
||||
}
|
||||
|
||||
|
||||
if(@is_object($GLOBALS['egw']->js))
|
||||
{
|
||||
$java_script .= $GLOBALS['egw']->js->get_javascript_globals();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($GLOBALS['egw']->acl->check('run',1,'notifications') && !$GLOBALS['egw_info']['user']['preferences']['notifications']['disable_ajaxpopup'])
|
||||
{
|
||||
$GLOBALS['egw_info']['flags']['include_xajax'] = true;
|
||||
}
|
||||
|
||||
|
||||
if ($GLOBALS['egw_info']['flags']['include_xajax'])
|
||||
{
|
||||
require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/xajax.inc.php');
|
||||
@ -635,13 +635,13 @@ class egw_framework
|
||||
$java_script .= $xajax->getJavascript($GLOBALS['egw_info']['server']['webserver_url'] . '/phpgwapi/js/');
|
||||
}
|
||||
|
||||
/* this flag is for all javascript code that has to be put before other jscode.
|
||||
/* this flag is for all javascript code that has to be put before other jscode.
|
||||
Think of conf vars etc... (pim@lingewoud.nl) */
|
||||
if (isset($GLOBALS['egw_info']['flags']['java_script_thirst']))
|
||||
{
|
||||
$java_script .= $GLOBALS['egw_info']['flags']['java_script_thirst'] . "\n";
|
||||
}
|
||||
|
||||
|
||||
if(@is_object($GLOBALS['egw']->js))
|
||||
{
|
||||
$java_script .= $GLOBALS['egw']->js->get_script_links();
|
||||
|
@ -903,7 +903,7 @@ class html
|
||||
}
|
||||
|
||||
// This block makes pngfix.js useless, adding a check on disable_pngfix to have pngfix.js do its thing
|
||||
if (self::$user_agent == 'msie' && self::$ua_version >= 5.5 && substr($url,-4) == '.png' && ($GLOBALS['egw_info']['user']['preferences']['common']['disable_pngfix'] || !isset($GLOBALS['egw_info']['user']['preferences']['common']['disable_pngfix'])))
|
||||
if (self::$user_agent == 'msie' && self::$ua_version < 7.0 && substr($url,-4) == '.png' && ($GLOBALS['egw_info']['user']['preferences']['common']['disable_pngfix'] || !isset($GLOBALS['egw_info']['user']['preferences']['common']['disable_pngfix'])))
|
||||
{
|
||||
$extra_styles = "display: inline-block; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$url',sizingMethod='image'); width: 1px; height: 1px;";
|
||||
if (false!==strpos($options,'style="'))
|
||||
|
Loading…
Reference in New Issue
Block a user