You are here

function flag_check_link_types in Flag 6.2

Same name and namespace in other branches
  1. 7.3 includes/flag.admin.inc \flag_check_link_types()
  2. 7.2 includes/flag.admin.inc \flag_check_link_types()

FormAPI after_build function to check that the link type exists.

1 string reference to 'flag_check_link_types'
flag_form in includes/flag.admin.inc
Add/Edit flag page.

File

includes/flag.admin.inc, line 623
Contains administrative pages for creating, editing, and deleting flags.

Code

function flag_check_link_types($element) {
  $link_types = flag_get_link_types();
  if (!isset($link_types[$element['#value']])) {
    drupal_set_message(t('This flag uses a link type of %type, which does not exist.', array(
      '%type' => $element['#value'],
    )), 'error');
  }
  return $element;
}