
        
        <div class="meta-box-sortabless">
            <div class="postbox">
                <h3 class="hndle">Sphinx service management</h3>
                <div class="inside">
                    <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
                    <fieldset class="options">
                         <?php if ($this->view->devOptions['sphinx_running'] == 'true'): ?>
                            <span style="color:green">OK - Sphinx Search Server is running.</span><br/>
                         <?php else: ?>
                            <span style="color:red">Warning: Sphinx Search Server is NOT running.</span><br/>
                         <?php endif; ?>
                    </fieldset>
                    <p class="submit">
                        <?php if ($this->view->devOptions['sphinx_running'] == 'true'): ?>                            
                            <input type="submit" style="width:300px;" name="stop_sphinx" class="button-primary"
                                   value="Stop Sphinx daemon" 
                                   onClick="if(!confirm('Do you really want to stop Sphinx server now?'))return false;"
                                   />
                        <?php else: ?>                            
                            <input type="submit" style="width:300px;" name="start_sphinx" class="button-primary"
                                   value="Start Sphinx daemon" />
                        <?php endif; ?>
                    </p>
                    </form>
                </div>

                <div style="border-top:1px solid #CCC;"></div>

                <div class="inside">
                    <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
                    <p class="submit">
                        <input type="submit" style="width:300px;" name="reindex_sphinx" class="button-primary"
                               value="Index all posts now" />
                    </p>
                    </form>
                </div>
                
                <div style="border-top:1px solid #CCC;"></div>

                <div class="inside">

                    <fieldset class="options">
                    <h4>How to setup automatic search index updates via cron?</h4>
                    <p>
                        Use “crontab -e” command in the Linux terminal and add the following lines to your crontab:<br/>
                        */5 * * * * /usr/bin/php <?php echo $this->view->devOptions['sphinx_path']?>/cron/cron_reindex_delta.php<br/>
                        5 0 * * * /usr/bin/php <?php echo $this->view->devOptions['sphinx_path']?>/cron/cron_reindex_main.php<br/>
                        */5 * * * * /usr/bin/php <?php echo $this->view->devOptions['sphinx_path']?>/cron/cron_reindex_stats.php<br/>
                        </p>
                     </fieldset>
                </div>
            </div>

            <?php /*
            <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">                          
           <div class="postbox">
                <h3 class="hndle">Sphinx сonfiguration</h3>
                <div class="inside">
                    <fieldset class="options">
                    <table class="form-table" border="0" >
                    <tbody>
                    <tr valign="top" >
                        <th scope="row">Sphinx configuration file path</th>
                        <td ><input type="text" id="sphinx_conf" name="sphinx_conf" size="30"
                        value="<?php echo $this->view->devOptions['sphinx_conf'];?>" /> (<?php echo !file_exists($this->view->devOptions['sphinx_conf'])?'<font color="red">Doesn\'t exist</font>':'<font color="green">Exists</font>';?>)</td>
                    </tr>
                    <tr valign="top" >
                        <th scope="row">Sphinx searchd file path</th>
                        <td ><input type="text" id="sphinx_searchd" name="sphinx_searchd" size="30"
                            value="<?php echo $this->view->devOptions['sphinx_searchd'];?>" /> (<?php echo !file_exists($this->view->devOptions['sphinx_searchd'])?'<font color="red">Doesn\'t exist</font>':'<font color="green">Exists</font>';?>)</td>
                    </tr>
                    <tr valign="top" >
                        <th scope="row">Sphinx indexer file path</th>
                        <td ><input type="text" id="sphinx_indexer" name="sphinx_indexer" size="30"
                            value="<?php echo $this->view->devOptions['sphinx_indexer'];?>" /> (<?php echo !file_exists($this->view->devOptions['sphinx_indexer'])?'<font color="red">Doesn\'t exist</font>':'<font color="green">Exists</font>';?>)</td>
                    </tr>
                    </tbody>
                    </table>
                    </fieldset>
                    <p class="submit">
                        <input type="submit" name="update_SphinxSearchSettings" class="button-primary"
                        value="<?php _e('Update settings', 'SphinxSearch') ?>" />
                    </p>
                </div>
           </div>
            </form>
            */ ?>
            <div class="postbox">
                <h3 class="hndle">Sphinx Configuration Wizard</h3>
                    <div class="inside">
                    
                    <?php if (!$this->view->is_sphinx_path_secure): ?>
                        <p>
                            <span style="color:red">Warning: Sphinx Search Plugin files are not secure!</span><br/>
                            <br/>
                            Please make sure the following files are inaccessible from web:<br/>
                            <?php foreach ($this->view->insecure_files as $file) { ?>
                            <a href="<?php echo $file; ?>"><?php echo $file; ?></a><br/>
                            <?php } ?>
                            <br/>
                            In case you can't fix this issue by yourself please contact your system administrator to help you protect those.
                        </p>
                    <?php endif; ?>
                        
                        <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>&menu=wizard">
                            <p class="submit">
                                <input type="hidden" name="start_wizard" value="start" />
                                <input type="submit" style="width:300px;"
                                       class="button-primary"
                                       value="Run Sphinx configuration Wizard" />
                            </p>
                        </form>
                    </div>
            </div>
        </div>
    </div>
</div>