You are here

function fieldable_panels_panes_settings in Fieldable Panels Panes (FPP) 7

Page callback for settings page.

1 string reference to 'fieldable_panels_panes_settings'
fieldable_panels_panes_menu in ./fieldable_panels_panes.module
Implements hook_menu().

File

includes/admin.inc, line 11
Contains administrative pages and functions for fieldable entity panes.

Code

function fieldable_panels_panes_settings() {
  $form = array();
  $form['fpp_revision_locking'] = array(
    '#type' => 'radios',
    '#title' => t('Should FPP CTools content panes reference FPP entities by entity ID or revision ID?'),
    '#description' => t('For example, a panelized entity can revert the entity to previous revision and FPPs will also revert if they are referenced by revision ID. This also allows for editorial workflows using e.g. the Workbench Moderation or Revisioning modules.'),
    '#options' => array(
      'legacy' => t('Legacy: Use entity ID for all FPPs.'),
      'lock' => t('Recommended: Use revision ID for non-reusable FPPs only; will also force each FPP update to create a new revision.'),
    ),
    '#default_value' => variable_get('fpp_revision_locking', 'lock'),
  );
  $form['fpp_hide_contextual_links'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hide the FPP contextual menus?'),
    '#description' => t('Being able to edit FPPs directly can cause problems with the editorial workflows when using e.g. Panelizer.'),
    '#default_value' => variable_get('fpp_hide_contextual_links', FALSE),
    '#disabled' => !module_exists('contextual'),
  );
  $form['fpp_blocks_expose'] = array(
    '#type' => 'checkbox',
    '#title' => t('Make fieldable panels panes available as blocks'),
    '#description' => t('Fieldable Panels Panes that are reusable will be made available as blocks.'),
    '#default_value' => variable_get('fpp_blocks_expose', FALSE),
  );
  $form['fpp_allow_reusable_access'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow access to the "reusable" option on the pane edit form after initial creation'),
    '#description' => t('This only allows the pane te be made reusable. Reusable panes cannot be changed back to non reusable panes.<br />Warning: enabling this option could break the editorial workflows using e.g. the Workbench Moderation or Revisioning modules, and could cause other problems too.'),
    '#default_value' => variable_get('fpp_allow_reusable_access', FALSE),
  );
  $form['bundles'] = array(
    '#type' => 'fieldset',
    '#title' => t('FPP Types Exposed as Blocks'),
    '#description' => t('Select FPP types to be exposed as blocks. If none is selected, then all FPP types will be exposed as blocks.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#states' => array(
      'visible' => array(
        ':input[name="fpp_blocks_expose"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );

  // Render checkbox for each FPP bundle if any FPP bundles exist.
  $bundles = fieldable_panels_panes_get_bundle_labels();
  if (!empty($bundles)) {
    foreach ($bundles as $bundle => $info) {
      $form['bundles']['fpp_expose_' . $bundle] = array(
        '#type' => 'checkbox',
        '#title' => $info . ' (' . $bundle . ')',
        '#default_value' => variable_get('fpp_expose_' . $bundle, FALSE),
      );
    }
  }
  else {
    $form['bundles']['empty'] = array(
      '#markup' => t('<p>No FPP types exist.</p>'),
    );
    $form['bundles']['#description'] = NULL;
  }
  return system_settings_form($form);
}