You are here

function ds_regions in Display Suite 6

Same name and namespace in other branches
  1. 6.3 ds.module \ds_regions()
  2. 6.2 ds.module \ds_regions()

Return array of available regions.

This is a multi dimensional array because when ordering fields on the display, we want them to order in a logical order. However, when rendering the HTML, we want left-right-middle for easy css practice.

Parameters

string $regions Whether to return all regions or not.:

Return value

array $regions Collection of regions.

12 calls to ds_regions()
ds_cssoverrider::plugin_form in plugins/ds_cssoverrider.inc
plugin_form().
ds_cssoverrider::plugin_form_submit in plugins/ds_cssoverrider.inc
plugin_form_submit().
ds_display_overview_form in includes/ds.display.inc
Menu callback; presents a listing of fields display settings for an object type.
ds_emptyregionrender::plugin_form in plugins/ds_emptyregionrender.inc
plugin_form().
ds_emptyregionrender::plugin_form_submit in plugins/ds_emptyregionrender.inc
plugin_form_submit().

... See full list

File

./ds.module, line 680

Code

function ds_regions($regions = 'all', $render = FALSE) {
  if ($regions == 'all') {
    if ($render == FALSE) {
      return array(
        'header' => t('Header'),
        'left' => t('Left'),
        'middle' => t('Middle'),
        'right' => t('Right'),
        'footer' => t('Footer'),
        'disabled' => t('Disabled'),
      );
    }
    else {
      return array(
        'header' => t('Header'),
        'middle' => t('Middle'),
        'left' => t('Left'),
        'right' => t('Right'),
        'footer' => t('Footer'),
        'disabled' => t('Disabled'),
      );
    }
  }
  else {
    return array(
      'middle' => t('Enabled'),
      'disabled' => t('Disabled'),
    );
  }
}