<?php
/**
 * サイト内検索
 * 
 */
require_once 'Platy/Widget.php';

class Platy_Widget_Search extends Platy_Widget
{
    public function install() { return true; }
    public function uninstall() { return true; }
    
    public function getSummary()
    {
        return 'サイト内検索';
    }
    
    public function view()
    {
        global $db, $manager;
        
        $a = array('title' => '', 'icons' => '', 'main' => '', 'footer' => '');
        
        $a['title'] = 'サイト内検索';
        
        ob_start();
        $q = '';
        if ($manager->module == 'Search' && isset($_POST['q'])) {
            $q = h($_POST['q']);
        }
        echo '<form method="post" action="' . BASE_FULL_URL . 'Search/">';
        echo '<input type="text" name="q" value="' . $q . '" size="20" />' . "<br />\n";
        echo '<input type="submit" value="検索" />' . "\n";
        echo '</form>' . "\n";
        $a['main'] = ob_get_contents();
        ob_end_clean();
    }
}
?>