You are here

function _popup_breadcrumb_row in Popup 6.x

1 call to _popup_breadcrumb_row()
popup_breadcrumb_settings in modules/popup_breadcrumb/includes/popup_breadcrumb.admin.inc

File

modules/popup_breadcrumb/includes/popup_breadcrumb.admin.inc, line 133

Code

function _popup_breadcrumb_row($key, $values, $options) {
  $row = array(
    'name' => array(
      '#default_value' => $values['name'],
      '#type' => 'textfield',
      '#size' => 20,
    ),
    'view' => array(
      '#default_value' => $values['view'],
      '#options' => $options['views'],
      '#type' => 'select',
    ),
    'display' => array(),
    'arguments' => array(
      '#options' => $options['arguments'],
      '#type' => 'checkboxes',
    ),
    'title_type' => array(
      '#default_value' => $values['title_type'],
      '#options' => array(
        0 => 'View title',
        'node' => 'Node title',
        'user' => 'User title',
        'term' => 'Term title',
      ),
      '#type' => 'select',
    ),
    'title_link_argument' => array(
      '#default_value' => $values['title_link_argument'],
      '#options' => $options['arguments'],
      '#type' => 'select',
    ),
    'weight' => array(
      '#attributes' => array(
        'class' => 'row-weight',
      ),
      '#default_value' => $values['weight'],
      '#size' => 5,
      '#type' => 'textfield',
    ),
    array(
      '#value' => $key == 'new' ? ' ' : popup_ui_confirm('Delete', 'Are you sure you want to delete this breadcrumb level? It cannot be undone!', 'admin/settings/popup/breadcrumb/delete/' . $key, array(
        'origin' => 'bottom-right',
        'expand' => 'bottom-left',
      )),
    ),
  );
  if ($options['displays']) {
    $row['display'] = array(
      '#default_value' => $values['display'],
      '#options' => $options['displays'],
      '#type' => 'select',
    );
  }
  else {
    $row['display'] = array(
      '#value' => 'Default',
      '#type' => 'value',
    );
  }
  if ($values['arguments']) {
    $row['arguments']['#default_value'] = array_filter($values['arguments']);
  }
  return $row;
}