I’m utilizing taxonomy supervisor module I need to add ajax callback to checkbox tree view for checkbox is checked situation however it’s not working can some one please counsel me. I’ve modified Drupal Development Company code like this
$type[$term->tid]['checkbox'] = array( '#sort' => ($a number of) ? 'checkbox' : 'radio', '#title' => $term->title, // Escaping is finished in theme wrappers. '#worth' => $worth, '#return_value' => $term->tid, '#ajax' => array( 'callback' => 'ajax_example_autocheckboxes_callback', 'wrapper' => 'checkboxes-div', 'technique' => 'substitute', 'impact' => 'fade', ), '#required' => FALSE, '#theme_wrappers' => ($a number of) ? array('taxonomy_manager_tree_checkbox') : array('taxonomy_manager_tree_radio'), '#spotlight' => in_array($term->tid, $terms_to_highlight) ? TRUE : FALSE, );
That is Drupal Development Company taxonomy supervisor module theme operate.
operate theme_taxonomy_manager_tree_checkbox($variables) { world $consumer; $component = $variables['element']; $component['#attributes']['type'] = 'checkbox'; $component['#attributes']['ajax']['event'] = 'change'; element_set_attributes($component, array('id', 'title', '#return_value' => 'worth')); // Unchecked checkbox has #worth of integer 0. if (!empty($component['#checked'])) { $component['#attributes']['checked'] = 'checked'; } _form_set_class($component, array('form-checkbox')); $output = '<enter' . drupal_attributes($component['#attributes']) . ' />'; /* customized alter operate */ if(user_is_logged_in()){ if(!user_access('administer taxonomy')){ $cdms_taxonomy_id = taxonomy_term_load($component['#return_value']); // echo "IF"; exit; }else{ $cdms_taxonomy_id = taxonomy_term_load($component['#return_value']); // echo "Else"; exit; } } // echo '<pre>';print_r($variables); echo"Time period load"; print_r($cdms_taxonomy_id); exit; $information = [ 'title' => $element['#title'], 'tid' => @$cdms_taxonomy_id->field_cdms_txy_id[LANGUAGE_NONE][0][value], 'rely' => '', ]; // Calling all modules implementing hook_my_data_alter(): drupal_alter('my_data', $information); if (!in_array("Consumer Person", array_values($user->roles))) { $title = $component['#title'] ."(".$information['count'].")"; }else{ $title = $component['#title']; } if (in_array("Consumer Person", array_values($user->roles))) { $title = check_plain($title); }else{ if (isset($component['#link'])) { $attr = array(); $attr["class"][] = "term-data-link"; $attr["class"][] = "term-data-link-id-" . $component['#return_value']; if (isset($component['#extra_info'])) { $attr["title"] = $component['#extra_info']; } $title = l($title, $component['#link'], array('attributes' => $attr)); } else { $title = check_plain($title); } } $component['#children'] = '<label class="possibility">' . $output . ' ' . $title . '</label>'; $component['#title_display'] = 'none'; return theme('form_element', array('component' => $component)); }