drupal_get_messages

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

includes/bootstrap.inc, строка 892

Версии
5 – 6
drupal_get_messages($type = NULL, $clear_queue = TRUE)

Return all messages that have been set.

Параметры

$type (optional) Only return messages of this type.

$clear_queue (optional) Set to FALSE if you do not want to clear the messages queue

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

An associative array, the key is the message type, the value an array of messages. If the $type parameter is passed, you get only that type, or an empty array if there are no such messages. If $type is not passed, all message types are returned, or an empty array if none exist.

▾ 1 функция вызывает drupal_get_messages()

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

Код

<?php
function drupal_get_messages($type = NULL, $clear_queue = TRUE) {
  if ($messages = drupal_set_message()) {
    if ($type) {
      if ($clear_queue) {
        unset($_SESSION['messages'][$type]);
      }
      if (isset($messages[$type])) {
        return array($type => $messages[$type]);
      }
    }
    else {
      if ($clear_queue) {
        unset($_SESSION['messages']);
      }
      return $messages;
    }
  }
  return array();
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

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