Author: ralfbecker
New Revision: 55758
URL: http://svn.stylite.de/viewvc/egroupware?rev=55758&view=rev
Log:
cant completly remove egw_framework::set_on* methods, as they are still in use
Modified:
trunk/egroupware/api/src/Framework.php
trunk/phpgwapi/inc/class.egw_framework.inc.php
— trunk/egroupware/api/src/Framework.php (original)
+++ trunk/egroupware/api/src/Framework.php Fri Apr 15 17:12:27 2016
@@ -360,6 +360,40 @@
}
/**
-
- Body tags for onLoad, onUnload and onResize
-
-
-
@deprecated since 14.1 use app.js et2_ready method instead to execute code or bind a handler (CSP will stop onXXX attributes!)
-
- */
- protected static $body_tags = array();
-
- /**
-
- Adds on(Un)Load= attributes to the body tag of a page
-
-
- Can only be set via egw_framework::set_on* methods.
-
-
-
@deprecated since 14.1 use app.js et2_ready method instead to execute code or bind a handler (CSP will stop onXXX attributes!)
-
-
@returns string the attributes to be used
- */
- static public function _get_body_attribs()
- {
-
$js = '';
-
foreach(self::$body_tags as $what => $data)
-
{
-
if (!empty($data))
-
{
-
if($what == 'onLoad')
-
{
-
$js .= 'onLoad="egw_LAB.wait(function() {'. htmlspecialchars($data).'})"';
-
continue;
-
}
-
$js .= ' '.$what.'="' . htmlspecialchars($data) . '"';
-
}
-
}
-
return $js;
- }
-
- /**
- Get header as array to eg. set as vars for a template (from idots’ head.inc.php)
-
-
@param array $extra =array() extra attributes passed as data-attribute to egw.js
@@ -419,6 +453,7 @@
‘lang_code’ => $lang_code,
‘charset’ => Translation::charset(),
‘website_title’ => $site_title,
-
'body_tags' => self::_get_body_attribs(),
'java_script' => self::_get_js($extra),
'meta_robots' => $robots,
'dir_code' => lang('language_direction_rtl') != 'rtl' ? '' : ' dir="rtl"',
— trunk/phpgwapi/inc/class.egw_framework.inc.php (original)
+++ trunk/phpgwapi/inc/class.egw_framework.inc.php Fri Apr 15 17:12:27 2016
@@ -120,7 +120,15 @@
*/
static function set_onload($code=’’,$replace=false)
{
-
if ($replace || empty(self::$body_tags['onLoad']))
-
{
-
self::$body_tags['onLoad'] = $code;
-
}
-
else
-
{
-
self::$body_tags['onLoad'] .= $code;
-
}
-
return self::$body_tags['onLoad'];
}
/**
@@ -133,7 +141,15 @@
*/
static function set_onunload($code=’’,$replace=false)
{
-
if ($replace || empty(self::$body_tags['onUnload']))
-
{
-
self::$body_tags['onUnload'] = $code;
-
}
-
else
-
{
-
self::$body_tags['onUnload'] .= $code;
-
}
-
return self::$body_tags['onUnload'];
}
/**
@@ -146,7 +162,15 @@
*/
static function set_onbeforeunload($code=’’,$replace=false)
{
-
if ($replace || empty(self::$body_tags['onBeforeUnload']))
-
{
-
self::$body_tags['onBeforeUnload'] = $code;
-
}
-
else
-
{
-
self::$body_tags['onBeforeUnload'] .= $code;
-
}
-
return self::$body_tags['onBeforeUnload'];
}
/**
@@ -159,7 +183,15 @@
*/
static function set_onresize($code=’’,$replace=false)
{
-
if ($replace || empty(self::$body_tags['onResize']))
-
{
-
self::$body_tags['onResize'] = $code;
-
}
-
else
-
{
-
self::$body_tags['onResize'] .= $code;
-
}
-
return self::$body_tags['onResize'];
}
/**
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs