Location: PHPKode > projects > Astrocytes > htdocs/include/searchform.php
<?php

//  ------------------------------------------------------------------------ //
//                                                                           //
//            Astrocytes - Medical Managment Systems                         //
//              Copyright (c) 2005 astrocytes.org                            //
//              <http://www.astrocytes.org/>                                 //
//              <http://sourceforge.net/projects/astroarm/>                  //
//              BY YAZID JIBREL                                              //
//              hide@address.com                                       //
//              Based on XOOPS CMS <xoops.org>                               //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software <gnu.org>    //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
//  ------------------------------------------------------------------------ //
// Authors: author name (hide@address.com),                      //
// URL: http://www.astrocytes.org                                            //
// Package: Package name                                                     //
// Project: Astrocytes                                                       //
// version: 1.1                                                              //
// ------------------------------------------------------------------------- //
if (!defined("ASTRO_ROOT_PATH")) {
    die("ASTRO root path not defined");
}
include_once ASTRO_ROOT_PATH."/class/astroformloader.php";

// create form
$search_form = new AstroThemeForm(_SR_SEARCH, "search", "search.php", 'get');

// create form elements
$search_form->addElement(new AstroFormText(_SR_KEYWORDS, "query", 30, 255, htmlspecialchars(stripslashes(implode(" ", $queries)), ENT_QUOTES)), true);
$type_select = new AstroFormSelect(_SR_TYPE, "andor", $andor);
$type_select->addOptionArray(array("AND"=>_SR_ALL, "OR"=>_SR_ANY, "exact"=>_SR_EXACT));
$search_form->addElement($type_select);
if (!empty($mids)) {
	$mods_checkbox = new AstroFormCheckBox(_SR_SEARCHIN, "mids[]", $mids);
} else {
	$mods_checkbox = new AstroFormCheckBox(_SR_SEARCHIN, "mids[]", $mid);
}
if (empty($modules)) {
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('hassearch', 1));
    $criteria->add(new Criteria('isactive', 1));
    if (!empty($available_modules)) {
        $criteria->add(new Criteria('mid', "(".implode(',', $available_modules).")", 'IN'));
    }
    $module_handler =& astro_gethandler('module');
    $mods_checkbox->addOptionArray($module_handler->getList($criteria));
}
else {
    foreach ($modules as $mid => $module) {
        $module_array[$mid] = $module->getVar('name');
    }
    $mods_checkbox->addOptionArray($module_array);
}
$search_form->addElement($mods_checkbox);
if ($astroConfigSearch['keyword_min'] > 0) {
	$search_form->addElement(new AstroFormLabel(_SR_SEARCHRULE, sprintf(_SR_KEYIGNORE, $astroConfigSearch['keyword_min'])));
}
$search_form->addElement(new AstroFormHidden("action", "results"));
$search_form->addElement(new AstroFormHiddenToken('id'));
$search_form->addElement(new AstroFormButton("", "submit", _SR_SEARCH, "submit"));
?>
Return current item: Astrocytes