You are here

function panels_edit_configure_pane_lock_form in Panels 7.3

Configure lock on a pane form.

1 string reference to 'panels_edit_configure_pane_lock_form'
panels_renderer_editor::ajax_lock in plugins/display_renderers/panels_renderer_editor.class.php
AJAX entry point to configure CSS for a pane.

File

plugins/display_renderers/panels_renderer_editor.class.php, line 1851
Class file to control the main Panels editor.

Code

function panels_edit_configure_pane_lock_form($form, &$form_state) {
  ctools_form_include($form_state, 'plugins', 'panels');
  form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class');
  $display =& $form_state['display'];
  $pane =& $form_state['pane'];
  if (empty($pane->locks)) {
    $pane->locks = array(
      'type' => 'none',
      'regions' => array(),
    );
  }
  $form['type'] = array(
    '#type' => 'radios',
    '#title' => t('Lock type'),
    '#options' => array(
      'none' => t('No lock'),
      'immovable' => t('Immovable'),
      'regions' => t('Regions'),
    ),
    '#default_value' => $pane->locks['type'],
  );
  $layout = panels_get_layout($display->layout);
  $regions = panels_get_regions($layout, $display);
  $form['regions'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Regions'),
    '#options' => $regions,
    '#description' => t('Select which regions this pane can be moved to.'),
    '#dependency' => array(
      'radio:type' => array(
        'regions',
      ),
    ),
    '#default_value' => $pane->locks['regions'],
  );
  $form['#after_build'][] = 'panels_edit_configure_pane_lock_form_after_build';
  $form['next'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}