1 layout.context.admin.inc layout_context_return_form($form, &$form_state)

Helper function to return a partial context settings form.

File

core/modules/layout/layout.context.admin.inc, line 150
Administrative functions for custom layout contexts.

Code

function layout_context_return_form($form, &$form_state) {
  form_load_include($form_state, 'inc', 'layout', 'layout.context.admin');
  $layout = $form_state['layout'];

  // If no context has yet been selected, there is no sub-form to display.
  if (!isset($form_state['values']['context']) && !isset($form_state['handler'])) {
    return array();
  }

  if (isset($form_state['values']['context'])) {
    $handler = layout_create_context($form_state['values']['context']);
    $handler->is_new = TRUE;
  }
  else {
    $handler = $form_state['handler'];
  }

  $form_state['layout'] = $layout;
  $form_state['handler'] = $handler;
  $handler->form($form, $form_state);

  return $form;
}