theme_status_messages

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/theme.inc, строка 1114

Версии
5 – 6
theme_status_messages($display = NULL)

Возвращает темизированные сообщения статуса и/или ошибок. Сообщения сгруппированы по типу.

Параметры

$display (опция) Устанавливается в 'status' или 'error' для отображения сообщений только данного типа.

Возвращаемое значение

Строка, содержащия сообщения.

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

▾ 7 функции вызывают theme_status_messages()

chameleon_page in themes/chameleon/chameleon.theme
poll_choice_js in modules/poll/poll.module
Коллбэк меню для AHAH добавления пунктов.
template_preprocess_maintenance_page in includes/theme.maintenance.inc
The variables generated here is a mirror of template_preprocess_page(). This preprocessor will run it's course when theme_maintenance_page() is invoked. It is also used in theme_install_page() and theme_update_page() to keep all the variables...
template_preprocess_page in includes/theme.inc
Обрабатывает переменные для page.tpl.php
theme_install_page in includes/theme.maintenance.inc
Generate a themed installation page.
theme_update_page in includes/theme.maintenance.inc
Generate a themed update page.
upload_js in modules/upload/upload.module
Коллбэк меню для JavaScript загрузок файлов.

Код

<?php
function theme_status_messages($display = NULL) {
  $output = '';
  foreach (drupal_get_messages($display) as $type => $messages) {
    $output .= "<div class=\"messages $type\">\n";
    if (count($messages) > 1) {
      $output .= " <ul>\n";
      foreach ($messages as $message) {
        $output .= '  <li>'. $message ."</li>\n";
      }
      $output .= " </ul>\n";
    }
    else {
      $output .= $messages[0];
    }
    $output .= "</div>\n";
  }
  return $output;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

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