XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
searchform.php
Go to the documentation of this file.
1 <?php
18 defined('XOOPS_ROOT_PATH') or die('Restricted access');
19 
20 include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
21 
22 // create form
23 $search_form = new XoopsThemeForm(_SR_SEARCH, 'search', 'search.php', 'get');
24 
25 // create form elements
26 $search_form->addElement(new XoopsFormText(_SR_KEYWORDS, 'query', 30, 255, htmlspecialchars(stripslashes(implode(' ', $queries)), ENT_QUOTES)), true);
28 $type_select->addOptionArray(array(
29  'AND' => _SR_ALL ,
30  'OR' => _SR_ANY ,
31  'exact' => _SR_EXACT));
32 $search_form->addElement($type_select);
33 if (!empty($mids)) {
34  $mods_checkbox = new XoopsFormCheckBox(_SR_SEARCHIN, 'mids[]', $mids);
35 } else {
36  $mods_checkbox = new XoopsFormCheckBox(_SR_SEARCHIN, 'mids[]', $mid);
37 }
38 if (empty($modules)) {
39  $criteria = new CriteriaCompo();
40  $criteria->add(new Criteria('hassearch', 1));
41  $criteria->add(new Criteria('isactive', 1));
42  if (!empty($available_modules)) {
43  $criteria->add(new Criteria('mid', '(' . implode(',', $available_modules) . ')', 'IN'));
44  }
45  $module_handler =& xoops_gethandler('module');
46  $mods_checkbox->addOptionArray($module_handler->getList($criteria));
47 } else {
48  foreach ($modules as $mid => $module) {
49  $module_array[$mid] = $module->getVar('name');
50  }
51  $mods_checkbox->addOptionArray($module_array);
52 }
53 $search_form->addElement($mods_checkbox);
54 if ($xoopsConfigSearch['keyword_min'] > 0) {
55  $search_form->addElement(new XoopsFormLabel(_SR_SEARCHRULE, sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])));
56 }
57 $search_form->addElement(new XoopsFormHidden('action', 'results'));
58 $search_form->addElement(new XoopsFormHiddenToken('id'));
59 $search_form->addElement(new XoopsFormButton('', 'submit', _SR_SEARCH, 'submit'));
60 ?>