You are here

function ccl_blocks_validation in Custom Contextual Links 7

Same name and namespace in other branches
  1. 8 ccl_blocks/ccl_blocks.module \ccl_blocks_validation()

Custom validation for the block options.

1 string reference to 'ccl_blocks_validation'
ccl_blocks_form_ccl_add_form_alter in ccl_blocks/ccl_blocks.module
Implements hook_form_FORM_ID_alter().

File

ccl_blocks/ccl_blocks.module, line 63
Implments support for CCL on blocks.

Code

function ccl_blocks_validation($form, &$form_state) {
  $values = $form_state['values'];

  // Check that the node id token is not used for blocks.
  if ($values['ccl_type'] == 'block' && strpos($values['ccl_link'], '[node:') !== FALSE) {
    form_set_error('ccl_link', t('Node tokens are not processed for links added to blocks.'));
  }
}