You are here

function panels_flexible_config_item_form_submit in Panels 6.3

Same name and namespace in other branches
  1. 7.3 plugins/layouts/flexible/flexible.inc \panels_flexible_config_item_form_submit()

Submit handler for editing a flexible item.

File

plugins/layouts/flexible/flexible.inc, line 1182

Code

function panels_flexible_config_item_form_submit(&$form, &$form_state) {
  $item =& $form_state['item'];
  if ($item['type'] == 'region') {
    $item['title'] = $form_state['values']['title'];
  }
  $item['class'] = $form_state['values']['class'];
  if ($form_state['id'] == 'canvas') {
    $item['column_class'] = $form_state['values']['column_class'];
    $item['row_class'] = $form_state['values']['row_class'];
    $item['region_class'] = $form_state['values']['region_class'];

    // Reverse this as the checkbox is backward from how we actually store
    // it to make it simpler to default to scaling.
    $item['no_scale'] = !$form_state['values']['no_scale'];
    $item['fixed_width'] = $form_state['values']['fixed_width'];
    $item['column_separation'] = $form_state['values']['column_separation'];
    $item['region_separation'] = $form_state['values']['region_separation'];
    $item['row_separation'] = $form_state['values']['row_separation'];
  }
  else {
    if ($item['type'] != 'row') {
      $item['width_type'] = $form_state['values']['width_type'];
    }
    else {
      $item['contains'] = $form_state['values']['contains'];
    }
  }
}