You are here

function panels_edit_form_submit in Panels 5

File

./panels.module, line 583

Code

function panels_edit_form_submit($form_id, $form_values) {
  $panels = (object) $form_values;

  // be sure we get the order right.
  foreach ($form_values['content'] as $area => $content) {
    $array = array();
    $order = unserialize($content['order']);
    if (is_array($order)) {
      foreach ($order as $id) {
        $array[] = $content[$id];
      }
    }
    $panels->content[$area] = $array;
  }
  $panels->access = array_keys(array_filter($panels->access));
  panels_save_panels($panels);
  drupal_set_message(t('The panels has been saved.'));
  return 'admin/build/panels';
}