'#size' => 3,
'#maxlength' => 3,
);
+ $form['settings']['facets'][$facet]['remove'] = array(
+ '#type' => 'submit',
+ '#value' => t('Remove facet'),
+ '#mkdru facet' => $facet,
+ '#submit' => array('mkdru_remove_facet_submit'),
+ '#ahah' => array(
+ 'path' => 'ahah-mkdru-facet',
+ 'wrapper' => 'mkdru-facets-form-wrapper',
+ ),
+ );
}
$form['new_facet'] = array(
'#type' => 'fieldset',
return $form_state['values'];
}
+function mkdru_remove_facet_submit($form, &$form_state) {
+ dpm($form_state);
+ $delfacet = $form_state['clicked_button']['#mkdru facet'];
+ if ($delfacet)
+ unset($form_state['values']['settings']['facets'][$delfacet]);
+}
+
function mkdru_add_facet_callback() {
// Necessary to work with hook_form
module_load_include('inc', 'node', 'node.pages');