You are here

function itoggle_hide_checkbox in iToggle 7.2

After build callback.

This is used to hide the original checkbox when using an iToggle widget replacement for node property fields or in the iToggle widget settings form.

See also

itoggle_form_alter()

2 string references to 'itoggle_hide_checkbox'
itoggle_field_field_widget_form in modules/field/itoggle_field.module
Implements hook_field_widget_form().
itoggle_form_node_form_alter in ./itoggle.module
Implements hook_form_BASE_FORM_ID_alter().

File

./itoggle.module, line 475
iToggle core module.

Code

function itoggle_hide_checkbox($element) {

  // Hide original checkbox.
  // We hide it like this so it can still be checked and unchecked by
  // javascript. This allows for a quick & clean way of persisting the
  // iToggle widget state.
  $element['#theme_wrappers'] = array();
  $element['#title'] = NULL;
  $element['#attributes']['style'] = array(
    'display:none;',
  );
  return $element;
}