Drupal API

template_preprocess_search_theme_form

Мы скоро все здесь переведем. Присоединяйся к нам, пока еще осталось что переводить ;)

modules/search/search.module, строка 1095

Версии
6
template_preprocess_search_theme_form(&$variables)

Process variables for search-theme-form.tpl.php.

The $variables array contains the following arguments:

  • $form

See also

search-theme-form.tpl.php

Связанные темы

Код

<?php
function template_preprocess_search_theme_form(&$variables) {
  $variables['search'] = array();
  $hidden = array();
  // Provide variables named after form keys so themers can print each element independently.
  foreach (element_children($variables['form']) as $key) {
    $type = $variables['form'][$key]['#type'];
    if ($type == 'hidden' || $type == 'token') {
      $hidden[] = drupal_render($variables['form'][$key]);
    }
    else {
      $variables['search'][$key] = drupal_render($variables['form'][$key]);
    }
  }
  // Hidden form elements have no value to themers. No need for separation.
  $variables['search']['hidden'] = implode($hidden);
  // Collect all form elements to make it easier to print the whole form.
  $variables['search_form'] = implode($variables['search']);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему

Что такое OpenID?
  • Регистрация
  • Забыли пароль?

Документация

  • Drupal 6
  • Константы
  • Файлы
  • Функции
  • Глобальные переменные
  • Разделы