You are here

function _hs_process_render_nojs in Hierarchical Select 7.3

1 call to _hs_process_render_nojs()
form_hierarchical_select_process in ./hierarchical_select.module
Hierarchical select form element type #process callback.

File

./hierarchical_select.module, line 722
This module defines the "hierarchical_select" form element, which is a greatly enhanced way for letting the user select items in a hierarchy.

Code

function _hs_process_render_nojs($element, $config) {

  // This button and accompanying help text will be hidden when Javascript is
  // enabled.
  $element['nojs'] = array(
    '#prefix' => '<div class="nojs">',
    '#suffix' => '</div>',
  );
  $element['nojs']['update_button'] = array(
    '#type' => 'submit',
    '#value' => t('Update'),
    '#attributes' => array(
      'class' => array(
        'update-button',
      ),
    ),
    '#limit_validation_errors' => array(
      $element['#parents'],
    ),
    '#validate' => array(),
    '#submit' => array(
      'hierarchical_select_ajax_update_submit',
    ),
    '#ajax' => array(
      'callback' => 'menu_link_weight_parent_ajax_callback',
      'wrapper' => 'menu-link-weight-wrapper',
    ),
  );
  $element['nojs']['update_button_help_text'] = array(
    '#markup' => _hierarchical_select_nojs_helptext($config['dropbox']['status']),
    '#prefix' => '<div class="help-text">',
    '#suffix' => '</div>',
  );
  return $element;
}