<?php echo $this->render('admin/messagebox.phtml'); ?>
<div class="postbox">
    <h3 class="hndle">Install or use existing binaries</h3>
    <div class="inside">

    <form  action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="post" id="wizard_form">
        <input type="hidden" name="detection_process" value="1" />
        <input type="hidden" name="action" value="detection" />
        <table class="form-table">
        
            <tr>
                <th><label>detected system searchd</label></th>
                <td>
                    <input type="text" name="detected_system_searchd"
                           value="<?php echo $this->view->detect_system_searchd?>" />
                </td>
            </tr>
            <tr>
                <th><label>detected system indexer</label></th>
                <td>
                    <input type="text" name="detected_system_indexer"
                           value="<?php echo $this->view->detect_system_indexer?>" />
                </td>
            </tr>
        <?php if($this->view->detect_system_searchd):?>
            <tr>
                <th><label>use system binaries</label></th>
                <td><input type="radio" name="detected_install"
                           value="detect_system" checked="checked"/></td>
            </tr>            
        <?php else : ?>
            <tr>
                <th><label>use system binaries</label></th>
                <td>
                    <input type="radio" name="detected_install" value="detect_system" />
                    <i><small>Wizard was unable to find sphinx binaries but you can specify them manually</small></i>
                </td>
            </tr>            
            
        <?php endif; ?>

        <?php if($this->view->detect_installed_searchd &&
                $this->view->detect_installed_searchd != $this->view->detect_system_searchd):?>
            <tr>
                <th><label>detected installed searchd</label></th>
                <td>
                    <input type="text" name="detected_installed_searchd"
                           value="<?php echo $this->view->detect_installed_searchd?>" />
                </td>
            </tr>
            <tr>
                <th><label>detected installed indexer</label></th>
                <td>
                    <input type="text" name="detected_installed_indexer"
                           value="<?php echo $this->view->detect_installed_indexer?>" />
                </td>
            </tr>
            <tr>
                <th><label>use installed binaries</label></th>
                <td><input type="radio" name="detected_install"
                           value="detect_installed" checked="checked" /></td>
            </tr>
        <?php endif; ?>

        <?php if (empty($this->view->detect_system_searchd) &&
                empty($this->view->detect_installed_searchd)):?>
            <tr>
                <th><label>install sphinx</label></th>
                <td>
                    <input type="radio" name="detected_install" value="install" checked="checked" />
                    <i><small>Notice that sphinx will be installed at <?php echo $this->view->install_path?></small></i>
                </td>
            </tr>
       <?php else:?>
            <tr>
                <th><label>install sphinx</label></th>
                <td>
                    <input type="radio" name="detected_install"value="install" />
                    <i><small>Notice that sphinx will be installed at <?php echo $this->view->install_path?></small></i>
                </td>
            </tr>
        <?php endif; ?>
            
            </table>
        
        <p class="submit">
            <input class="button-secondary cancel" type="button"
                onClick="return wizard_skip('detection');" value="Skip step" />
             <input class="button-primary" type="button" onClick="return wizard_next();"
                       name="use_detected_sphinx" value="Save &amp; Continue" />
              <input class="button-secondary cancel alignright" type="button"
                       onClick="return wizard_cancel();" value="Cancel Wizard" />
            </p>

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