You are here

public function PowerMenuTaxonomyHandler::menuFormValidate in Power Menu 7.2

Overrides PowerMenuHandlerInterface::menuFormValidate

See also

PowerMenuHandlerInterface::menuFormValidate()

File

plugins/menu_handlers/PowerMenuTaxonomyHandler.class.php, line 184

Class

PowerMenuTaxonomyHandler
Implementation of the interface PowerMenuHandlerInterface.

Code

public function menuFormValidate(array &$elements, array &$form_state, $form_id = NULL) {

  // Check is a term selection or creation necessary
  if (variable_get('power_menu_taxonomy_force_term_selection', TRUE)) {
    if (empty($form_state['values']['power_menu_taxonomy_create']) && empty($form_state['values']['power_menu_taxonomy_terms'])) {
      form_set_error('power_menu_taxonomy_create', t('Select \'Create Taxonomy term\' or select one from the existing terms.'));
      form_set_error('power_menu_taxonomy_terms');
    }
  }
}