finder_admin_custom_matching

  1. finder
    1. 7.x-1.x
Versions
7.x-1.x finder_admin_custom_matching($form, &$form_state)

Finder admin custom matching configuration page.

Code

includes/finder.admin.inc, line 1006

<?php
function finder_admin_custom_matching($form, &$form_state) {
  $form['#tree'] = TRUE;

  // This page is styled.
  $form['#attributes']['class'][] = 'finder-custom-matching';
  drupal_add_css(drupal_get_path('module', 'finder') . '/finder.css');

  $form['intro']['#markup'] = '<p>' . t('This page allows you to configure custom matching methods for use in finder configuration.  Presented here for reference are the default matching methods built into finder.  At the bottom of the page you will find two blank rows where you can create new matching methods.  To remove a custom row, delete the name and save the form.') . '</p>';

  // Add the default rows.
  $default_matching = finder_condition_args_default();
  foreach ($default_matching as $k => $v) {
    finder_admin_custom_matching_entry($form, $k, $v, TRUE);
  }

  // Add the configured custom rows.
  $custom_matching = variable_get('finder_custom_matching', array());
  foreach ($custom_matching as $k => $v) {
    finder_admin_custom_matching_entry($form, $k, $v, FALSE);
  }

  // Add two more rows.
  $more = array();
  $custom = 0;
  while (count($more) < 2) {
    if (!isset($custom_matching['c' . $custom])) {
      $more['c' . $custom] = array();
    }
    $custom++;
  }
  foreach ($more as $k => $v) {
    finder_admin_custom_matching_entry($form, $k, $v, FALSE);
  }

  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit', 
    '#value' => t('Save custom matching'),
  );

  return $form;
}
?>

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.