You are here

function block_inject_implode_paragraphs in Block Inject 7

Takes an array of exploded paragraphs which contain the injected region wrapped in a div and 'implodes' them back into a string.

Parameters

$exploded: Array of exploded paragraphs

Return value

string

1 call to block_inject_implode_paragraphs()
block_inject_node in ./block_inject.module
Injects the region in the middle of the node.

File

./block_inject.module, line 327
The Block Inject module functions.

Code

function block_inject_implode_paragraphs($exploded) {
  $output = '';
  foreach ($exploded as $paragraph) {
    if (strpos($paragraph, '<div') === 0) {
      $output .= $paragraph;
      continue;
    }
    $output .= '<p>' . $paragraph;
  }
  return $output;
}