You are here

function bynder_parse_selected_facets in Bynder 7

Parse the selected facets.

File

includes/bynder.browser.inc, line 433
Manages the Bynder media browser functionality

Code

function bynder_parse_selected_facets($selected_facets) {
  if (!$selected_facets) {
    return false;
  }
  if (!empty($selected_facets)) {
    $selected_facet_list = array(
      '#theme' => 'item_list',
      '#type' => 'ul',
      '#title' => t('Selected Filters'),
      '#attributes' => array(
        'class' => 'selected_facet_list',
      ),
    );
    foreach ($selected_facets as $facet_category => $facets) {
      foreach ($facets as $facet) {
        $selected_facet_list['#items'][] = $facet_category . ' => ' . $facet;
      }
    }
    return $selected_facet_list;
  }
  return false;
}