You are here

function views_content_exposed_form_pane_edit in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 views_content/views_content.module \views_content_exposed_form_pane_edit()

Add settings to the "exposed form in block" views.

1 string reference to 'views_content_exposed_form_pane_edit'
views_ctools_block_info in views_content/views_content.module
Don't show Views' blocks; we expose them already.

File

views_content/views_content.module, line 68
Provides views as panels content, configurable by the administrator. Each view provided as panel content must be configured in advance, but once configured, building panels with views is a little bit simpler.

Code

function views_content_exposed_form_pane_edit($form, &$form_state) {

  // This is a cheesy way to add defaults only to new versions of the block
  // but leave older blocks without the setting alone. We can tell because
  // all older content will have something set for override_title which is
  // the only pre-existing setting.
  if (!isset($form_state['conf']['inherit_path']) && !isset($form_state['conf']['override_title'])) {
    $form_state['conf']['inherit_path'] = TRUE;
  }
  $form['inherit_path'] = array(
    '#type' => 'checkbox',
    '#title' => t('Inherit path'),
    '#default_value' => !empty($form_state['conf']['inherit_path']),
  );
  return $form;
}