You are here

function _semantic_panels_attributes_save in Semantic Panels 7.2

Same name and namespace in other branches
  1. 7 plugins/styles/semantic_panels.inc \_semantic_panels_attributes_save()
1 call to _semantic_panels_attributes_save()
semantic_panels_pane_settings_form_submit in plugins/styles/semantic_panels.inc
Pane settings form submit handler.

File

plugins/styles/semantic_panels.inc, line 258

Code

function _semantic_panels_attributes_save(&$style_element) {
  $style_element['attributes_array'] = array();
  foreach ($style_element['attributes'] as $machine_name => $attribute_settings) {
    if (empty($style_element['attributes'][$machine_name]['enabled'])) {

      // Don't save disabled attributes
      unset($style_element['attributes'][$machine_name]);
    }
    else {

      // Build up $settings['attributes_array'] ready for drupal_attributes with only enabled attributes
      $style_element['attributes_array'][$machine_name] = $style_element['attributes'][$machine_name]['value'];
    }
  }
}