You are here

function panels_mini_context_form in Panels 6.2

Same name and namespace in other branches
  1. 5.2 panels_mini/panels_mini.module \panels_mini_context_form()

Form to edit the context settings of a mini panel.

1 string reference to 'panels_mini_context_form'
panels_mini_edit_context in panels_mini/panels_mini.admin.inc
Form to edit context features of a mini panel.

File

panels_mini/panels_mini.admin.inc, line 572
Administrative items for the panels mini module.

Code

function panels_mini_context_form(&$form_state, $panel_mini, $next = NULL) {
  drupal_add_css(panels_get_path('css/panels_admin.css'));
  panels_load_include('plugins');
  $layout = panels_get_layout($panel_mini->display->layout);
  $form['panel_mini'] = array(
    '#type' => 'value',
    '#value' => $panel_mini,
  );
  $form_state['panel_mini'] = $panel_mini;
  $form['right'] = array(
    '#prefix' => '<div class="right-container">',
    '#suffix' => '</div>',
  );
  $form['left'] = array(
    '#prefix' => '<div class="left-container">',
    '#suffix' => '</div>',
  );
  panels_load_include('common-context');
  panels_load_include('ajax');
  $settings = panels_common_add_context_form('panel_mini', $form, $form_state, $form['right']['contexts_table'], $panel_mini);
  $settings += panels_common_add_required_context_form('panel_mini', $form, $form_state, $form['left']['required_contexts_table'], $panel_mini);
  $settings += panels_common_add_relationship_form('panel_mini', $form, $form_state, $form['right']['relationships_table'], $panel_mini);
  panels_common_add_context_js($settings);
  $label = $next ? t('Save and proceed') : t('Save');
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => $label,
  );
  return $form;
}