You are here

function panels_mini_context_form in Panels 5.2

Same name and namespace in other branches
  1. 6.2 panels_mini/panels_mini.admin.inc \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.module
Form to edit context features of a mini panel.

File

panels_mini/panels_mini.module, line 635
panels_mini.module

Code

function panels_mini_context_form($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['pid'] = array(
    '#type' => 'value',
    '#value' => $panel_mini->pid,
  );
  $form['panel_mini'] = array(
    '#type' => 'value',
    '#value' => $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');
  $settings = panels_common_add_context_form('panel_mini', $form, $form['right']['contexts_table'], $panel_mini);
  $settings += panels_common_add_required_context_form('panel_mini', $form, $form['left']['required_contexts_table'], $panel_mini);
  $settings += panels_common_add_relationship_form('panel_mini', $form, $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;
}