You are here

function userpoints_create_operation_autocomplete_label in User Points 7

Same name and namespace in other branches
  1. 7.2 userpoints.admin.inc \userpoints_create_operation_autocomplete_label()

Create a autocomplete label with highlighted search text.

Parameters

$operation: Operation string.

$info: Operation info array.

$search: Search text that will be highlighted if found.

Return value

Highlighted label. If existing, the admin description is used and if not, the operation string.

1 call to userpoints_create_operation_autocomplete_label()
userpoints_operation_autocomplete in ./userpoints.admin.inc
Autocomplete callback for search an operation.

File

./userpoints.admin.inc, line 279
Admin menu callbacks for userpoints.module.

Code

function userpoints_create_operation_autocomplete_label($operation, $info, $search) {
  $label = $operation;
  if (!empty($info['admin description'])) {
    $label = $info['admin description'];
  }
  return preg_replace("/(" . preg_quote($search) . ")/i", "<strong>\$1</strong>", $label);
}