You are here

function diff_extract_state in Diff 7.3

Helper function to parse out the state in the diff results.

2 calls to diff_extract_state()
diff_entity_body_rows in ./diff.pages.inc
Creates an array of rows which represent the difference between two entities.
diff_markdown_state in ./diff.pages.inc
Helper function to render plain states from the corresponding raw state.

File

./diff.diff.inc, line 348
Includes the hooks defined by diff_hook_info().

Code

function diff_extract_state($diff, $state = 'raw') {
  $states = array(
    0 => NULL,
    1 => NULL,
  );
  if (isset($diff['#states'][$state])) {
    if (isset($diff['#states'][$state]['#old'])) {
      $states[0] = $diff['#states'][$state]['#old'];
    }
    if (isset($diff['#states'][$state]['#new'])) {
      $states[1] = $diff['#states'][$state]['#new'];
    }
  }
  return $states;
}