You are here

function path_breadcrumbs_ui_settings in Path Breadcrumbs 7.2

Same name and namespace in other branches
  1. 7.3 path_breadcrumbs_ui/path_breadcrumbs_ui.admin.inc \path_breadcrumbs_ui_settings()

Path breadcrumbs settings form.

1 string reference to 'path_breadcrumbs_ui_settings'
path_breadcrumbs_ui_menu in path_breadcrumbs_ui/path_breadcrumbs_ui.module
Implements hook_menu().

File

path_breadcrumbs_ui/path_breadcrumbs_ui.admin.inc, line 117
Administrative callbacks for PATH BREADCRUMBS UI module.

Code

function path_breadcrumbs_ui_settings($form, $form_state) {
  $form['path_breadcrumbs_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Breadcrumbs settings'),
  );
  $form['path_breadcrumbs_settings']['path_breadcrumbs_delimiter'] = array(
    '#type' => 'textfield',
    '#title' => t('Delimiter'),
    '#default_value' => variable_get('path_breadcrumbs_delimiter', '»'),
    '#size' => 3,
    '#description' => t('Symbol that separates breadcrumbs.'),
  );
  $form['path_breadcrumbs_settings']['path_breadcrumbs_rich_snippets'] = array(
    '#type' => 'select',
    '#title' => t('Rich snippets support'),
    '#options' => array(
      PATH_BREADCRUMBS_RICH_SNIPPETS_DISABLED => t('Disabled'),
      PATH_BREADCRUMBS_RICH_SNIPPETS_RDFA => t('RDFa'),
      PATH_BREADCRUMBS_RICH_SNIPPETS_MICRODATA => t('Microdata'),
    ),
    '#default_value' => variable_get('path_breadcrumbs_rich_snippets', PATH_BREADCRUMBS_RICH_SNIPPETS_DISABLED),
    '#description' => t('Provides rich snippets support for breadcrumbs. It is important to build a structure of a site in the SERP.'),
  );
  $form['path_breadcrumbs_settings']['path_breadcrumbs_hide_single_breadcrumb'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hide breadcrumbs navigation for single breadcrumb'),
    '#default_value' => variable_get('path_breadcrumbs_hide_single_breadcrumb', 0),
    '#description' => t('If breacrumbs navigation contains only one breadcrumb then breadcrumb navigation will be hidden.'),
  );
  $form['path_breadcrumbs_settings']['path_breadcrumbs_decode_entities'] = array(
    '#type' => 'checkbox',
    '#title' => t('Decode HTML entities'),
    '#description' => t('Converts quotes in the breadcrumbs to their applicable characters.'),
    '#default_value' => variable_get('path_breadcrumbs_decode_entities', TRUE),
  );
  $internal_render = variable_get('path_breadcrumbs_internal_render', 1);
  if (!$internal_render) {
    $form['path_breadcrumbs_settings']['path_breadcrumbs_delimiter']['#disabled'] = TRUE;
    $form['path_breadcrumbs_settings']['path_breadcrumbs_rich_snippets']['#disabled'] = TRUE;
    $form['path_breadcrumbs_settings']['path_breadcrumbs_hide_single_breadcrumb']['#disabled'] = TRUE;
    $notice = '<div style="color:red">' . t('You are not able to use this feature until internal render is disabled.') . '</div>';
    $form['path_breadcrumbs_settings']['path_breadcrumbs_delimiter']['#description'] .= $notice;
    $form['path_breadcrumbs_settings']['path_breadcrumbs_rich_snippets']['#description'] .= $notice;
    $form['path_breadcrumbs_settings']['path_breadcrumbs_hide_single_breadcrumb']['#description'] .= $notice;
  }
  $form['path_breadcrumbs_settings']['path_breadcrumbs_internal_render'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use module breadcrumbs render function'),
    '#default_value' => variable_get('path_breadcrumbs_internal_render', 1),
    '#description' => t("If this value checked module will replace system or theme breadcrumb render function by module's one.<br/>Note that if this checkbox is unchecked module will not be able to implement settings above."),
  );
  $form['path_breadcrumbs_home_link'] = array(
    '#type' => 'fieldset',
    '#title' => t('Home link settings'),
  );
  $form['path_breadcrumbs_home_link']['path_breadcrumbs_home_link_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Prepend breadcrumbs with a home link by default'),
    '#default_value' => variable_get('path_breadcrumbs_home_link_enabled', 1),
    '#description' => t('This value does not changes current breadcrumbs navigation. It is just set default value for new path breadcrumbs.'),
  );
  $form['path_breadcrumbs_home_link']['path_breadcrumbs_home_link_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Home link title'),
    '#default_value' => variable_get('path_breadcrumbs_home_link_title', 'Home'),
    '#description' => t('Title of the link that points to the front page.'),
    '#size' => 30,
  );
  $form['#submit'][] = 'path_breadcrumbs_ui_settings_submit';
  return system_settings_form($form);
}