You are here

function _formdefaults_search in Form Defaults 6.2

Same name and namespace in other branches
  1. 5.3 formdefaults.admin.inc \_formdefaults_search()
  2. 7 formdefaults.admin.inc \_formdefaults_search()

Search for forms matching wildcard and return all those that match.

Parameters

String $search_str:

Return value

array Array of forms matching search criteria and their definitions

2 calls to _formdefaults_search()
formdefaults_export in ./formdefaults.admin.inc
formdefaults_manage in ./formdefaults.admin.inc
Form management form used for inspecting and resetting forms.

File

./formdefaults.admin.inc, line 9

Code

function _formdefaults_search($search_str) {
  $search_str = "%{$search_str}%";
  $result = db_query('SELECT * FROM {formdefaults_forms} WHERE formid LIKE\'%s\'', array(
    $search_str,
  ));
  $forms = array();
  while ($form = db_fetch_object($result)) {
    if ($form) {
      $formarray = unserialize($form->formdata);
      $forms[$form->formid] = $formarray;
    }
  }
  return $forms;
}