You are here

public function dsDisplay::regionAttr in Display Suite 6.3

Wrapper to add an attribute to an item

3 calls to dsDisplay::regionAttr()
dsDisplay::regionFinalise in includes/dsDisplay.php
Finalise a region for rendering
dsDisplay::regionSetup in includes/dsDisplay.php
Set up a region for use
dsDisplay::render in includes/dsDisplay.php
Render content

File

includes/dsDisplay.php, line 584
Class definition for a Display Suite Display object

Class

dsDisplay
The Display Suite Display object

Code

public function regionAttr($region, $type, $data) {

  // Initialise empty attribute arrays
  if (!isset($this->regions[$region]['#attributes'])) {
    $this->regions[$region]['#attributes'] = array();
  }

  // Fix attributes passed as strings
  if (!is_array($this->regions[$region]['#attributes'][$type]) && !empty($this->regions[$region]['#attributes'][$type])) {
    $tmp = $this->regions[$region]['#attributes'][$type];
    $this->regions[$region]['#attributes'][$type] = array();
    $this->regions[$region]['#attributes'][$type][] = $tmp;
  }

  // Add the attribute specified
  $this->regions[$region]['#attributes'][$type][] = $data;
}