1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-25 15:31:41 +02:00

Improved detection of deprecated functions/methods and display in DEBUG mode: deprecated.

This commit is contained in:
Cameron
2020-12-21 10:00:28 -08:00
parent 63527c4f19
commit 630f3f415f
30 changed files with 224 additions and 82 deletions

View File

@@ -493,7 +493,8 @@ class admin_shortcodes
include_once(e_PLUGIN.$val.'/e_latest.php');
if(!class_exists($val."_latest"))
{
$mes->addDebug("<strong>".$val ."</strong> using deprecated e_latest method");
trigger_error("<strong>".$val ."</strong> is using a deprecated e_latest method. See plugin: _blank/e_dashboard.php ", E_USER_DEPRECATED);
$oldconfigs[$val] = admin_shortcodes::legacyToConfig($text);
}
}
@@ -1328,7 +1329,9 @@ class admin_shortcodes
include_once(e_PLUGIN.$val.'/e_status.php');
if(!class_exists($val."_status"))
{
$mes->addDebug("<strong>".$val ."</strong> using deprecated e_status method. See the chatbox plugin folder for a working example of the new one. ");
trigger_error("<strong>".$val ."</strong> is using a deprecated e_status method method. See plugin: _blank/e_dashboard.php ", E_USER_DEPRECATED);
// $mes->addDebug("<strong>".$val ."</strong> using deprecated e_status method. See the chatbox plugin folder for a working example of the new one. ");
}
$oldconfigs[$val] = admin_shortcodes::legacyToConfig($text);

View File

@@ -532,9 +532,18 @@ elseif (file_exists(e_BASE."favicon.ico"))
// Theme JS
/** const THEME_ONLOAD @deprecated */
if (defined('THEME_ONLOAD')) $js_body_onload[] = THEME_ONLOAD;
$body_onload='';
if (count($js_body_onload)) $body_onload = " onload=\"".implode(" ",$js_body_onload)."\"";
if (defined('THEME_ONLOAD'))
{
trigger_error('<b>THEME_ONLOAD is deprecated.</b> Use e107::js() instead.', E_USER_DEPRECATED); // NO LAN
$js_body_onload[] = THEME_ONLOAD;
}
$body_onload = '';
if (count($js_body_onload))
{
$body_onload = " onload=\"" . implode(" ", $js_body_onload) . "\"";
}
//
// J: Send end of <head> and start of <body>
@@ -662,11 +671,14 @@ if($noBody === true) // New in v2.2.2 - remove need for BODYTAG.
}
elseif(!defined('BODYTAG')) // @deprecated.
{
$body_onload .= " id='layout-".e107::getForm()->name2id(THEME_LAYOUT)."' ";
echo "<body".$body_onload.">\n";
}
else
{
trigger_error('<b>BODYTAG is deprecated.</b> Use a theme.html file instead.', E_USER_DEPRECATED); // NO LAN
if ($body_onload)
{
// Kludge to get the CHAP code included
@@ -674,6 +686,7 @@ else
}
else
{
echo BODYTAG."\n";
}
}