You are here

function fusion_apply_flatten_skins_array in Fusion Accelerator 7

Same name and namespace in other branches
  1. 7.2 fusion_apply/fusion_apply.module \fusion_apply_flatten_skins_array()

Returns an array of classes.

@todo Optimize this function by removing dependencies on the resource heavy fusion_apply_get_skin_info() function. @todo Rename function to reflect new functionality.

Parameters

$skin_options: An array of skin options keyed by their skin name. The key '_additional' is reserved for additional classes entered by the user.

1 call to fusion_apply_flatten_skins_array()
fusion_apply_preprocess in fusion_apply/fusion_apply.module
Implements hook_preprocess().

File

fusion_apply/fusion_apply.module, line 175
Handles core Fusion Apply functionality.

Code

function fusion_apply_flatten_skins_array($skin_options) {
  $skin_info = fusion_apply_get_skin_info();
  $classes = array();
  foreach ($skin_options as $skin_name => $options) {
    if ($skin_name == '_additional') {
      $classes = array_merge($classes, $options);
    }
    else {
      foreach ($options as $option) {
        if (!empty($skin_info[$skin_name]['options'][$option]['class'])) {
          $classes = array_merge($classes, $skin_info[$skin_name]['options'][$option]['class']);
        }
      }
    }
  }
  return array_unique($classes);
}