<div class="install-wizard">
  <div class="checkStep">
    {ox_wizard_steps steps=$oWizard->getSteps() current=$oWizard->getCurrentStep()}
  
    <div class="content">
    <h2>{t str=SystemCheck}</h2>
    <p>{t str=SystemCheckIntro}</p>
    
    <div class="messagePlaceholder messagePlaceholderStatic" {if !$needsRetry}style="display:none"{/if}>
      <div class="message localMessage">
        <div class="panel error">
          <div class="icon"></div><p>{t str=FixErrorsBeforeContinuing}</p>
          <div class="topleft"></div>
          <div class="topright"></div>
          <div class="bottomleft"></div>
          <div class="bottomright"></div>
        </div>
      </div>
    </div>    
    
    <ul class="syscheck">
      {foreach from=$aChecks item=section}
      <li class="checkSection {if $section.hasError}hasError{elseif $section.hasWarning}hasWarning{/if}">
        <h4 class="header {if $section.hasError}error{/if}"><span class="detail-control"><a href="#" class="detailed hide">{t str=SyscheckSeeFullReport}</a> <a href="#" class="compact hide">{t str=SyscheckSeeShortReport}</a></span><span class="inlineIcon {if $section.hasError}iconCheckErr{else}iconCheckOK{/if}">{$section.header}</span></h4>
        
        {* display any general section errors/warnings not directly associated with particular check *}
        <ul class="check-list">
        {if $section.errors} 
          <li class="section-error hasError">
            <div class="messageContainer">
              <div class="body error">
                  {if $section.errors|@count > 1}
                    <ol>
                    {foreach from=$section.errors item=error}
                        <li>- {$error}</li>
                    {/foreach}
                    </ol>
                  {else}
                    {foreach from=$section.errors item=error} {*it's one anyway*}
                      {$error}
                    {/foreach}
                  {/if}
              </div>
            </div>
          </li>
        {/if}
        {if $section.warnings}
          <li class="section-warning hasWarning">
            <div class="messageContainer">
              <div class="body warning">
                  {if $section.warnings|@count > 1}
                    <ol>
                    {foreach from=$section.warnings item=warning}
                        <li>- {$warning}</li>
                    {/foreach}
                    </ol>
                  {else}
                    {foreach from=$section.warnings item=warning} {*it's one anyway*}
                      {$warning}
                    {/foreach}
                  {/if}
              </div>
            </div>
          </li>
        {/if}
        {if $section.infos}
          <li class="section-info">
            <div class="messageContainer">
              <div class="body info">
                  {if $section.infos|@count > 1}
                    <ol>
                    {foreach from=$section.infos item=info}
                        <li>- {$info}</li>
                    {/foreach}
                    </ol>
                  {else}
                    {foreach from=$section.infos item=info} {*it's one anyway*}
                      {$info}
                    {/foreach}
                  {/if}
              </div>
            </div>
          </li>
        {/if}
        </ul>
        
        
        <div class="tableContainer">
          <table>
              <thead>
                  <tr>
                      <th class="first name">{t str=SyscheckName}</th>
                      <th class="value">{t str=SyscheckValue}</th>
                      <th class="status">{t str=SyscheckStatus}</th>
                  </tr>
              </thead>
              
              <tbody>
                {* display particular checks *}       
                {foreach from=$section.checks item=check}
                <tr class="checkItem {if $check.hasError}check-error hasError{elseif $check.hasWarning}check-warning hasWarning{/if}">
                  <td class="first">
                    <span class="name">{$check.name}</span>
                    {if $check.hasError && $check.errors}
                        {assign var='messages' value=$check.errors}
                    {elseif $check.hasWarning && $check.warnings}
                        {assign var='messages' value=$check.warnings} 
                    {elseif $check.hasInfo && $check.infos}
                        {assign var='messages' value=$check.infos}
                    {else}    
                        {assign var='messages' value=null}
                    {/if}                    
                      
                    {if $messages}
                      <div class="message">
                        {if $messages|@count > 1}
                          <ol>
                          {foreach from=$messages item=message}
                              <li>- {$message}</li>
                          {/foreach}
                          </ol>
                        {else}
                          {foreach from=$messages item=message} {*it's one anyway*}
                            {$message}
                          {/foreach}
                        {/if}
                      </div>
                    {/if}
                  </td>
  
                  <td class="value">{$check.value}</td>  
                  
                  <td class="status" title="{if $check.hasError}{t str=Error}{elseif $check.hasWarning}{t str=Warning}{else}{t str=OK}{/if}">
                      <span class="inlineIcon {if $check.hasError}iconCheckErr{elseif $check.hasWarning}iconCheckWarn{else}iconCheckOK{/if}">&nbsp;</span>
                  </td>  
                </tr>
                {/foreach}
              </tbody>
          </table>
        </div>
      </li>
      {/foreach}      
    </ul>
    
    <form action="" method="post" id="checkForm">
        <input type="hidden" name="action" value="check" >
        <div class="controls">
          <input type="submit" {if $needsRetry}name="retry" id="retry"{else}name="continue" id="continue"{/if} value="{if $needsRetry}{t str=BtnRetry}{else}{t str=BtnContinue}{/if}"/>
        </div>    
    </form>

    </div>
  </div>
</div>


<script type="text/javascript">
<!--
{literal}
  $(document).ready(function() {
    $(".checkStep").checkStep({
        {/literal}
        'message' : '{$loaderMessage}'
        {literal} 
    });
  });  
{/literal}
-->
</script>
