You are here

function views_megarow_display in Views Megarow 7

Displays the provided output in a megarow.

Works by returning an array that ajax_deliver() can understand.

3 calls to views_megarow_display()
views_megarow_form_wrapper in ./views_megarow.module
Wrap a form so that we can use it properly with AJAX. Essentially if the form wishes to render, it automatically does that, otherwise it returns so we can see submission results.
views_megarow_node_page_edit in ./views_megarow.module
Overrides the node edit callback.
views_megarow_user_page_edit in ./views_megarow.module
Wrap the default user edition form.

File

./views_megarow.module, line 306

Code

function views_megarow_display($title, $output, $entity_id) {

  // Add the messages in the renderable array if the source is an array or
  // render them if we already have markup in order to display potential error
  // messages or confirmation messages to the user.
  if (is_array($output)) {
    $renderable_output = array(
      array(
        '#theme' => 'status_messages',
      ),
      $output,
    );
  }
  else {
    $renderable_output = theme('status_messages') . $output;
  }
  $commands = array();
  $commands[] = views_megarow_command_display($title, $renderable_output, $entity_id);
  return array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
}