finder_admin_custom_matching_entry

  1. finder
    1. 7.x-1.x
Versions
7.x-1.x finder_admin_custom_matching_entry(&$form, $key, $value, $default)

Build the form for a single entry.

Parameters

&$form Reference to the form array to add the form to.

$key The key of the match entry.

$value The value of the match entry.

$default Boolean indicating whether this is a default entry (vs. custom).

Code

includes/finder.admin.inc, line 1063

<?php
function finder_admin_custom_matching_entry(&$form, $key, $value, $default) {
  $form[$key] = array(
    '#type' => 'fieldset',
  );
  $form[$key]['name'] = array(
    '#type' => 'textfield', 
    '#title' => t('Name'), 
    '#default_value' => isset($value['name']) ? $value['name'] : '', 
    '#size' => 20, 
    '#maxlength' => 128, 
    '#disabled' => $default, 
    '#field_suffix' => isset($value['name']) ? '<small class="finder-condition-machine-name"> (' . t('Machine name') . ': ' . $key . ')</small>' : '', 
    '#description' => $default ? '' : (isset($value['name']) ? t('Clear name to delete row.') : t('Enter name to create row.')),
  );
  $form[$key]['description'] = array(
    '#type' => 'textfield', 
    '#title' => t('Description'), 
    '#default_value' => isset($value['description']) ? $value['description'] : '', 
    '#size' => 60, 
    '#maxlength' => 512, 
    '#disabled' => $default, 
    '#description' => $default ? '' : t('Explain, in these terms, how <em>!matches</em> relates to <em>!keywords</em>.'),
  );
  $form[$key]['operator'] = array(
    '#type' => 'textfield', 
    '#title' => t('Operator'), 
    '#default_value' => isset($value['operator']) ? $value['operator'] : '', 
    '#size' => ($x = (isset($value['operator']) ? min(drupal_strlen($value['operator']), 30) : 5)) ? $x : 1, 
    '#maxlength' => 512, 
    '#field_prefix' => "'" . t('field') . "'", 
    '#disabled' => $default, 
    '#prefix' => '<div class="finder-condition"><span class="finder-condition-operator">', 
    '#suffix' => '</span>',
  );
  $form[$key]['value_prefix'] = array(
    '#type' => 'textfield', 
    '#title' => t('Prefix'), 
    '#default_value' => isset($value['value_prefix']) ? $value['value_prefix'] : '', 
    '#size' => ($x = (isset($value['value_prefix']) ? min(drupal_strlen($value['value_prefix']), 30) : 3)) ? $x : 1, 
    '#maxlength' => 512, 
    '#field_suffix' => t('value'), 
    '#disabled' => $default, 
    '#prefix' => '<span class="finder-condition-value-prefix">', 
    '#suffix' => '</span>',
  );
  $form[$key]['value_suffix'] = array(
    '#type' => 'textfield', 
    '#title' => t('Suffix'), 
    '#default_value' => isset($value['value_suffix']) ? $value['value_suffix'] : '', 
    '#size' => ($x = (isset($value['value_suffix']) ? min(drupal_strlen($value['value_suffix']), 30) : 3)) ? $x : 1, 
    '#maxlength' => 512, 
    '#disabled' => $default, 
    '#prefix' => '<span class="finder-condition-value-suffix">', 
    '#suffix' => '</span></div>',
  );
}
?>

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.