There is a handwritten search module for drupal.
The question is how from the function my_search_submit to transfer an array to the function that displays information on the screen. The writing below. There must be a normal way, but I can not find it.
//Описание блоков function my_search_hblock($op = 'list', $delta = 0, $edit = array()){ switch ($op) { case 'list': $blocks[0] = array( 'info' => t('Поиск GM'), ); $blocks[1]= array( 'info' =>t('Результат поиска'), ); return $blocks; case 'view': switch ($delta) { case 0: $block['content'] = my_search_page();//форма для поиска break; case 1: $block['content'] = my_search_result_contents();//результат поиска break; } return $block; } } //Сам сабмитер function my_search_form_submit($form, &$form_state){ //некоторый код container($keywords); } function container($result=NULL){ /** * Это что-то типа контейнера * Если в функцию передана переменная--то её данные заносятся в сессию * Если ничего не переданно--то из сссии извлекаются данные, сама сессия обнуляться. **/ if(is_null($result)){ $result=$_SESSION['result']; unset($_SESSION['result']); return $result; }elseif(!is_null($result)){ $_SESSION['result']=$result; } } function my_search_result_contents(){ $result=container(); $output = theme('search', $result); return $output; }