You are here

function _semantic_panels_get_fences_options in Semantic Panels 7.2

Same name and namespace in other branches
  1. 7 semantic_panels.module \_semantic_panels_get_fences_options()

Same as _fences_get_fences_options() except:

  • Skips element keys with underscore in them. Since that is 2 elements in one which wouldn't allow control over classes and other attributes
  • Doesn't take no_wrapper into account when sorting.
1 call to _semantic_panels_get_fences_options()
_semantic_panels_get_elements in ./semantic_panels.module
Returns elements.

File

./semantic_panels.module, line 196
Semantic Panels.

Code

function _semantic_panels_get_fences_options($theme_hook) {
  $options = array();

  // Get the list of suggestions.
  $fences = fences_get_fences_suggestion_info();
  foreach (array_keys($fences[$theme_hook]) as $key) {
    if (strpos($key, '_') === FALSE) {
      $tags = '';
      if ($fences[$theme_hook][$key]['element'] && $fences[$theme_hook][$key]['element'] != $fences[$theme_hook][$key]['label']) {
        $tags = ' — <' . implode('> <', explode(' ', $fences[$theme_hook][$key]['element'])) . '>';
      }
      $option = $fences[$theme_hook][$key]['label'] . $tags . ' — ' . $fences[$theme_hook][$key]['description'];
      if (empty($fences[$theme_hook][$key]['groups'])) {
        $options[$key] = $option;
      }
      else {
        foreach ($fences[$theme_hook][$key]['groups'] as $optgroup) {
          $options[$optgroup][$key] = $option;
        }
      }
    }
  }

  // Sort the option groups
  ksort($options);
  return $options;
}