You are here

function _path_breadcrumbs_ui_form_step_basic_settings in Path Breadcrumbs 7.2

Same name and namespace in other branches
  1. 7.3 path_breadcrumbs_ui/path_breadcrumbs_ui.module \_path_breadcrumbs_ui_form_step_basic_settings()

FIRST STEP. Provide form with basic settings.

_state

Parameters

$form:

File

path_breadcrumbs_ui/path_breadcrumbs_ui.module, line 342
Provide user interface for CRUD operations with path breadcrumbs.

Code

function _path_breadcrumbs_ui_form_step_basic_settings(&$form, &$form_state) {
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Breadcrumb definition'),
    '#description' => t('Human-readable name of breadcrumb navigation'),
    '#required' => TRUE,
    '#maxlength' => 64,
  );
  $form['machine_name'] = array(
    '#type' => 'machine_name',
    '#maxlength' => 64,
    '#machine_name' => array(
      'exists' => 'path_breadcrumbs_load_by_name',
      'source' => array(
        'name',
      ),
    ),
  );
  $form['path'] = array(
    '#type' => 'textfield',
    '#title' => t('Path'),
    '#description' => t('The URL path where breadcrumb will be shown. You may create named placeholders for variable parts of the path by using %name for required elements. For example: "node/%node/foo" or "forum/%forum". These named placeholders can be turned into contexts on the arguments form.'),
    '#required' => TRUE,
    '#maxlength' => 256,
    '#field_prefix' => url(NULL, array(
      'absolute' => TRUE,
    )) . (variable_get('clean_url', 0) ? '' : '?q='),
  );
  $form['#validate'][] = '_path_breadcrumbs_ui_form_step_basic_settings_validate';
  $form['#submit'][] = '_path_breadcrumbs_ui_form_step_basic_settings_submit';
  if (!empty($form_state['storage']['machine_name'])) {
    _path_breadcrumbs_ui_form_apply_default_values($form, $form_state['storage']['machine_name']);
  }
  _path_breadcrumbs_ui_form_attach_buttons($form, array(
    'next',
  ), 'path_breadcrumbs_ui_add_form');
}