1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-29 19:00:26 +02:00

Fix for theme render test. Disabled debug routines when inactive. Bootstrap3 moved modal to footer. Code cleanup.

This commit is contained in:
Cameron
2020-05-04 12:10:22 -07:00
parent 951cefec27
commit ad7caf78e8
6 changed files with 39 additions and 17 deletions

View File

@@ -370,8 +370,7 @@ $dbg = e107::getDebug();
if(E107_DEBUG_LEVEL) if(E107_DEBUG_LEVEL)
{ {
// $e107_debug = true; // BC $dbg->active(true);
//$dbg = e107::getDebug();
/** @deprecated $db_debug */ /** @deprecated $db_debug */
$db_debug = $dbg; $db_debug = $dbg;
@@ -717,7 +716,7 @@ e107::getNotify()->registerEvents();
// //
// O: Start user session // O: Start user session
// //
$sql -> db_Mark_Time('User session'); $dbg->logTime('User session');
init_session(); // Set up a lot of the user-related constants init_session(); // Set up a lot of the user-related constants

View File

@@ -71,10 +71,11 @@ if (varset($e107_popup) != 1)
{ {
$psc = array( $psc = array(
'</body>' => '', '</body>' => '',
'{THEME}' => THEME_ABS, '{THEME}' => THEME_ABS,
'{---HEADER---}' => $tp->parseTemplate('{HEADER}',true), '{---MODAL---}' => $LAYOUT['_modal_'],
'{---FOOTER---}' => $tp->parseTemplate('{FOOTER}',true) '{---HEADER---}' => $tp->parseTemplate('{HEADER}',true),
'{---FOOTER---}' => $tp->parseTemplate('{FOOTER}',true)
); );
parseheader($FOOTER, $psc); parseheader($FOOTER, $psc);

View File

@@ -582,6 +582,8 @@ echo "</head>\n";
if($tmp = e_theme::loadLayout(THEME_LAYOUT)) if($tmp = e_theme::loadLayout(THEME_LAYOUT))
{ {
$LAYOUT = $tmp; $LAYOUT = $tmp;
$HEADER = array();
$FOOTER = array();
$noBody = true; $noBody = true;
unset($tmp); unset($tmp);

View File

@@ -25,7 +25,7 @@
class e107_db_debug class e107_db_debug
{ {
private $active = false; // true when debug is active.
var $aSQLdetails = array(); // DB query analysis (in pieces for further analysis) var $aSQLdetails = array(); // DB query analysis (in pieces for further analysis)
var $aDBbyTable = array(); var $aDBbyTable = array();
var $aOBMarks = array(0 => ''); // Track output buffer level at each time mark var $aOBMarks = array(0 => ''); // Track output buffer level at each time mark
@@ -48,6 +48,16 @@
} }
/**
* Set the active status of the debug logging.
* When set to false, called methods within the class will by bypassed for better performance.
* @param $var
*/
public function active($var)
{
$this->active = (bool) $var;
}
/** /**
* Return a list of all registered time markers. * Return a list of all registered time markers.
* @return array * @return array
@@ -127,7 +137,12 @@
} }
public function logTime($sMarker) public function logTime($sMarker)
{ // Should move to traffic_class? {
if(!$this->active)
{
return null;
}
$timeNow = microtime(); $timeNow = microtime();
$nMarks = ++$this->nTimeMarks; $nMarks = ++$this->nTimeMarks;
@@ -170,7 +185,10 @@
*/ */
function Mark_Query($query, $rli, $origQryRes, $aTrace, $mytime, $curtable) function Mark_Query($query, $rli, $origQryRes, $aTrace, $mytime, $curtable)
{ {
if(!$this->active)
{
return null;
}
// global $sql; // global $sql;
$sql = e107::getDb($rli); $sql = e107::getDb($rli);
@@ -691,7 +709,7 @@
function logCode($type, $code, $parm, $details) function logCode($type, $code, $parm, $details)
{ {
if(!E107_DBG_BBSC) if(!E107_DBG_BBSC || !$this->active)
{ {
return false; return false;
} }
@@ -910,6 +928,10 @@
*/ */
public function log($message, $TraceLev = 1) public function log($message, $TraceLev = 1)
{ {
if(!$this->active)
{
return null;
}
if(is_array($message) || is_object($message)) if(is_array($message) || is_object($message))
{ {

View File

@@ -27,7 +27,7 @@
$this->assertTrue(false, "Couldn't load e107table object"); $this->assertTrue(false, "Couldn't load e107table object");
} }
$this->ns->__construct(); $this->ns->init();
} }
/* /*

View File

@@ -1,7 +1,4 @@
<body id="page-top" class="{LAYOUT_ID}" {BODY_ONLOAD} > <body id="page-top" class="{LAYOUT_ID}" {BODY_ONLOAD} >
{---MODAL---}
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
@@ -86,6 +83,7 @@
</div> <!-- /container --> </div> <!-- /container -->
</footer> </footer>
{---MODAL---}
<!--- Optional custom footer template controlled by theme_shortcodes --> <!--- Optional custom footer template controlled by theme_shortcodes -->
{---FOOTER---} {---FOOTER---}