You are here

function slickgrid_callback_get_messages in Slickgrid 7

3 calls to slickgrid_callback_get_messages()
slickgrid_callback in includes/slickgrid.callbacks.inc
hook_menu callback; Universal json callback - builds function name and returns error = true
slickgrid_callback_add in includes/slickgrid.callbacks.inc
Callback function - add an entity
slickgrid_plugin_modal_form_process in plugins/editors/ModalForm.inc
Retrieve form / process a modal form This uses ctools ajax & the whole form so it works with all fields

File

includes/slickgrid.callbacks.inc, line 26

Code

function slickgrid_callback_get_messages(&$json) {

  // Add any drupal messages that have been created
  foreach (drupal_get_messages() as $type => $messages) {
    foreach ($messages as $message) {
      if ($type == 'error') {
        $json['error'] = true;
      }
      $json['messages'][] = array(
        'type' => $type,
        'message' => $message,
      );
    }
  }
}