You are here

function drupal_get_content in Drupal 4

Same name and namespace in other branches
  1. 5 includes/common.inc \drupal_get_content()
  2. 6 includes/common.inc \drupal_get_content()

Get assigned content.

Parameters

$region: A specified region to fetch content for. If null, all regions will be returned.

$delimiter: Content to be inserted between exploded array elements.

1 call to drupal_get_content()
theme_blocks in includes/theme.inc
Return a set of blocks available for the current user.

File

includes/common.inc, line 53
Common functions that many Drupal modules will need to reference.

Code

function drupal_get_content($region = NULL, $delimiter = ' ') {
  $content = drupal_set_content();
  if (isset($region)) {
    if (isset($content[$region]) && is_array($content[$region])) {
      return implode($delimiter, $content[$region]);
    }
  }
  else {
    foreach (array_keys($content) as $region) {
      if (is_array($content[$region])) {
        $content[$region] = implode($delimiter, $content[$region]);
      }
    }
    return $content;
  }
}