You are here

function _popup_menuelement_child_attribs in Popup 7

Same name and namespace in other branches
  1. 8 includes/popup.util.inc \_popup_menuelement_child_attribs()
  2. 7.x includes/popup.util.inc \_popup_menuelement_child_attribs()
  3. 6.x includes/popup.util.inc \_popup_menuelement_child_attribs()

Filters attributes to be passed on to child elements

1 call to _popup_menuelement_child_attribs()
_popup_menuelement in includes/popup.util.inc
Recursively generates popup menus

File

includes/popup.util.inc, line 373

Code

function _popup_menuelement_child_attribs($attributes) {
  $child_attributes = array();
  $copy = array(
    'activate' => 'activate',
    'effect' => 'effect',
    'expand' => 'submenu-expand',
    'style' => 'style',
    'submenu-expand' => 'submenu-expand',
    'submenu-origin' => 'submenu-origin',
    'opacity' => 'opacity',
    'origin' => 'submenu-origin',
    'width' => 'width',
  );
  foreach ($copy as $destination => $source) {
    if (isset($attributes[$source])) {
      $child_attributes[$destination] = $attributes[$source];
    }
  }
  if (isset($attributes['flat']) && $attributes['flat']) {
    $child_attributes['expand'] = $attributes['expand'];
    $child_attributes['origin'] = $attributes['origin'];
  }
  return $child_attributes;
}