You are here

function site_banner_verify_banner_text in Site Banner 7

Validates banner text against existing values to ensure no inconsistencies.

Parameters

array $site_banner_array: the current context array.

array $new_banner_context: the tested banner context.

array $current_banner_text_index: the current context index being analysed.

array $new_banner_text_index: the tested context index being analysed.

array $context_name: the context name.

array $context_tag: the context tag.

array $form_section: the form section to be tested.

1 call to site_banner_verify_banner_text()
site_banner_generate_context_banner_text_from_contexts in ./site_banner.module
Returns new banner text by collapsing all active contexts into string.

File

./site_banner.module, line 317
Main module file implementing callbacks for the site banner module.

Code

function site_banner_verify_banner_text($site_banner_array, $new_banner_context, $current_banner_text_index, $new_banner_text_index, $context_name, $context_tag, $form_section) {
  $banner_text = $site_banner_array[$context_tag][$current_banner_text_index];
  $new_banner_context = $new_banner_context[$new_banner_text_index];
  if ($banner_text != $new_banner_context) {
    $error_message = t("Inconsistent %form_section detected for context: %context_name. tag: %context_tag. Using first detected %form_section.", array(
      '%form_selection' => $form_section,
      '%context_name' => $context_name,
      '%context_tag' => $context_tag,
      '%form_section' => $form_section,
    ));
    drupal_set_message($error_message, 'warning');
  }
}