You are here

function admin_menu_settings_process_components in Administration menu 8.3

Same name and namespace in other branches
  1. 7.3 admin_menu.inc \admin_menu_settings_process_components()

#process callback for component plugin form element in admin_menu_theme_settings().

1 string reference to 'admin_menu_settings_process_components'
admin_menu_admin_settings_form in ./admin_menu.inc
Form builder function for module settings.

File

./admin_menu.inc, line 705
Menu builder functions for Administration menu.

Code

function admin_menu_settings_process_components($element) {

  // Assign 'rel' attributes to all options to achieve a live preview.
  // Unfortunately, #states relies on wrapping .form-wrapper classes, so it
  // cannot be used here.
  foreach ($element['#options'] as $key => $label) {
    if (!isset($element[$key]['#attributes']['rel'])) {
      $id = preg_replace('/[^a-z]/', '-', $key);
      $element[$key]['#attributes']['rel'] = '#' . $id;
    }
  }
  return $element;
}