1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 17:01:43 +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,9 +370,8 @@ $dbg = e107::getDebug();
if(E107_DEBUG_LEVEL)
{
// $e107_debug = true; // BC
//$dbg = e107::getDebug();
$dbg->active(true);
/** @deprecated $db_debug */
$db_debug = $dbg;
$dbg->logTime('Init ErrHandler');
@@ -717,7 +716,7 @@ e107::getNotify()->registerEvents();
//
// 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

View File

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

View File

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

View File

@@ -25,7 +25,7 @@
class e107_db_debug
{
private $active = false; // true when debug is active.
var $aSQLdetails = array(); // DB query analysis (in pieces for further analysis)
var $aDBbyTable = array();
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 array
@@ -127,7 +137,12 @@
}
public function logTime($sMarker)
{ // Should move to traffic_class?
{
if(!$this->active)
{
return null;
}
$timeNow = microtime();
$nMarks = ++$this->nTimeMarks;
@@ -170,7 +185,10 @@
*/
function Mark_Query($query, $rli, $origQryRes, $aTrace, $mytime, $curtable)
{
if(!$this->active)
{
return null;
}
// global $sql;
$sql = e107::getDb($rli);
@@ -691,7 +709,7 @@
function logCode($type, $code, $parm, $details)
{
if(!E107_DBG_BBSC)
if(!E107_DBG_BBSC || !$this->active)
{
return false;
}
@@ -910,6 +928,10 @@
*/
public function log($message, $TraceLev = 1)
{
if(!$this->active)
{
return null;
}
if(is_array($message) || is_object($message))
{

View File

@@ -27,7 +27,7 @@
$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} >
{---MODAL---}
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
@@ -84,8 +81,9 @@
</div> <!-- /row -->
</div> <!-- /container -->
</footer>
</footer>
{---MODAL---}
<!--- Optional custom footer template controlled by theme_shortcodes -->
{---FOOTER---}