<!-- storage/status-id.phtml -->

<h1><?php echo $this->escape($this->title); ?></h1>

<?php if ( $this->result_error ): ?>
    <div class="ui-widget" style="float: left;">
        <div class="ui-state-error ui-corner-all" style="padding: 0pt 0.7em;">
            <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: 0.3em;"></span>
            <strong>
    <?php
        switch ( $this->result_error )
        {
            case 'ERROR_BCONSOLE': // ошибка при запуске bconsole
                $msg = $this->translate->_('ERROR: There was a problem executing bconsole.');
                break;
            case 'NOFOUND_BCONSOLE': // bconsole не найден
                $msg = $this->translate->_('ERROR: bconsole not found.');
                break;
            case 'BACULA_ACCESS_DENIED':
                $msg = $this->translate->_('Bacula ACLs : Access denied.');
                break;
            default: $msg = '';
        }
        echo $msg;
        if ( $this->command_output )
        {
            foreach ($this->command_output as $line) {
             echo '<br>', $line, '<br>';
          }
        }
    ?>
            </strong></p>
        </div>
    </div>
    <div style="clear: both;"><!--  --></div>
<?php else: ?>

<!-- director output -->
<table id="table-dir-output" >
<tr><td>
    <b><?php print $this->translate->_("Director output:"); ?></b>
	<?php
    if ( $this->command_output )
    {
        echo '<pre>';
        foreach ($this->command_output as $line) {
            if ( strpos($line, 'ERR') || strpos($line, 'not found') )   {
                echo '<div style="color: white; background-color: red;">' . $line . '</div><br>';
            } else {
                echo $line . '<br>';
            }
		}
		echo '</pre>';
    } else {
        echo '<p><b>', $this->translate->_("No Storage status found."), '</b></p>';
    }
    ?>
</td></tr>
</table>
<?php endif; ?>