News:

Support the VirtueMart project and become a member

Main Menu

Empty div on index store page

Started by _Sash@, March 26, 2008, 15:10:16 PM

Previous topic - Next topic

_Sash@

May be I'm too punctilious =)

Just, think better to dont output empty tags )

administrator\components\com_virtuemart\classes\Log\display.php

<?php
function 
printLog$priority null ) {
$output '<div ';
if( $this->_count 10 && DEBUG) {
// Wrap the messages into a scrollable div field
$output .= 'style="width:90%; overflow:auto; height:150px;"';
}
$output .= '>';
$i 0;
$message_tmp '';
foreach( $this->_messages as $message ) {
if( ( $priority === null || $priority <= $message['priority'] )
&& $message['priority'] !== PEAR_LOG_DEBUG
|| ( $message['priority'] === PEAR_LOG_DEBUG && DEBUG == '1')) {

$message_tmp .= '<b>' ucfirst($this->priorityToString($message['priority'])) . '</b>: '
nl2br(htmlspecialchars($message['message'])) 
              $this->_linebreak;
    if( @$this->_messages[$i+1]['priority'] != $message['priority'] ) {
$output .= $this->formatOutput$message_tmp$message['priority'] );
$message_tmp '';
    }
}
$i++;
}

$output .= '</div>';
$this->_count 0;
$this->_messages = array();
if( $output ) {
echo $output;// .  $this->_linebreak;
}
}


Change to ... or somethign similar to dont output empty div tag ...


<?php
function 
printLog$priority null ) {
$output '';
$i 0;
$message_tmp '';
foreach( $this->_messages as $message ) {
if( ( $priority === null || $priority <= $message['priority'] )
&& $message['priority'] !== PEAR_LOG_DEBUG
|| ( $message['priority'] === PEAR_LOG_DEBUG && DEBUG == '1')) {

$message_tmp .= '<b>' ucfirst($this->priorityToString($message['priority'])) . '</b>: '
nl2br(htmlspecialchars($message['message']))
              $this->_linebreak;
    if( @$this->_messages[$i+1]['priority'] != $message['priority'] ) {
$output .= $this->formatOutput$message_tmp$message['priority'] );
$message_tmp '';
    }
}
$i++;
}
if( $output ) {
$preoutput '<div ';
if( $this->_count 10 && DEBUG) {
// Wrap the messages into a scrollable div field
$preoutput .= 'style="width:90%; overflow:auto; height:150px;"';
}
$preoutput .= '>';
echo $preoutput.$output.'</div>';// .  $this->_linebreak;
}
$this->_count 0;
$this->_messages = array();
}