You are here

function panels_breadcrumbs_partial_configuration_form in Panels Breadcrumbs 7.2

Returns a partially formed panels breadcrumbs configuration form.

Parameters

array $conf: An array containing panels breadcrumbs configuration.

array $contexts: An array containing panels breadcrumbs contexts.

Return value

array An array containing a partial panels breadcrumbs configuration form.

3 calls to panels_breadcrumbs_partial_configuration_form()
panels_breadcrumbs_page_breadcrumb_content_type_edit_form in ./panels_breadcrumbs.module
Configuration callback override of 'page_breadcrumb' ctools content-type.
panels_breadcrumbs_panelizer_breadcrumbs_form in ./panels_breadcrumbs.module
Panelizer breadcrumb configuration form.
panels_breadcrumbs_variant_breadcrumb_form in ./panels_breadcrumbs.module
Panels breadcrumbs configuration form.

File

./panels_breadcrumbs.module, line 83
Main file for panels breadcrumbs module.

Code

function panels_breadcrumbs_partial_configuration_form(array $conf, array $contexts) {
  if (empty($conf['panels_breadcrumbs_state'])) {
    $conf['panels_breadcrumbs_state'] = '0';
  }
  if (empty($conf['panels_breadcrumbs_titles'])) {
    $conf['panels_breadcrumbs_titles'] = '';
  }
  if (empty($conf['panels_breadcrumbs_paths'])) {
    $conf['panels_breadcrumbs_paths'] = '';
  }
  $form['settings']['panels_breadcrumbs_state'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable custom breadcrumb configuration.'),
    '#default_value' => $conf['panels_breadcrumbs_state'],
  );
  $form['settings']['panels_breadcrumbs_titles'] = array(
    '#type' => 'textarea',
    '#title' => t('Breadcrumb titles'),
    '#description' => t('Enter one title per line.'),
    '#default_value' => $conf['panels_breadcrumbs_titles'],
  );
  $form['settings']['panels_breadcrumbs_paths'] = array(
    '#type' => 'textarea',
    '#title' => t('Breadcrumb paths'),
    '#description' => t('Enter one path per line. You can use @front to link
      to the front page, or @none for no link.', array(
      '@front' => '<front>',
      '@none' => '<none>',
    )),
    '#default_value' => $conf['panels_breadcrumbs_paths'],
  );
  $form['settings']['panels_breadcrumbs_home'] = array(
    '#type' => 'checkbox',
    '#title' => t('Prepend Home Link to the Breadcrumb'),
    '#default_value' => isset($conf['panels_breadcrumbs_home']) ? $conf['panels_breadcrumbs_home'] : TRUE,
  );
  $form['settings']['panels_breadcrumbs_menu_active_trail'] = array(
    '#type' => 'checkbox',
    '#title' => t('Activate panels breadcrumbs menu active trail.'),
    '#default_value' => isset($conf['panels_breadcrumbs_menu_active_trail']) ? $conf['panels_breadcrumbs_menu_active_trail'] : FALSE,
  );
  $rows = array();
  foreach ($contexts as $context) {
    foreach (ctools_context_get_converters('%' . check_plain($context->keyword) . ':', $context) as $keyword => $title) {
      $rows[] = array(
        check_plain($keyword),
        t('@identifier: @title', array(
          '@title' => $title,
          '@identifier' => $context->identifier,
        )),
      );
    }
  }
  $header = array(
    t('Keyword'),
    t('Value'),
  );
  $form['contexts'] = array(
    '#type' => 'fieldset',
    '#title' => t('Substitutions'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#value' => theme('table', array(
      'header' => $header,
      'rows' => $rows,
    )),
  );
  return $form;
}