1)); $form['settings']['contextual'] = array( '#type' => 'radios', '#title' => t('Contextual links integration'), '#default_value' => isset($settings['contextual']) ? $settings['contextual'] : 1, '#options' => array( 0 => t('Disabled'), 1 => t('Enabled on all Formatters except those listed'), 2 => t('Enabled on only the listed Formatters'), ), ); $form['settings']['contextual_list'] = array( '#type' => 'textarea', '#default_value' => isset($settings['contextual_list']) ? $settings['contextual_list'] : '', '#description' => t('Specify Formatters by using their machine names. Enter one machine name per line.'), '#states' => array( 'visible' => array( 'input[name="settings[contextual]"]' => array('checked' => FALSE), ), ), ); } } /** * Implements hook_custom_formatters_field_formatter_view_element_alter() on * behalf of contextual.module. * * Adds contextual links to Custom Formatter fields. */ function contextual_custom_formatters_field_formatter_view_element_alter(&$element, $formatter) { if (_custom_formatters_contextual_access($formatter->name, $element)) { foreach (element_children($element) as $delta) { $element[$delta] = array( 'markup' => $element[$delta], 'contextual_links' => array( '#type' => 'contextual_links', '#contextual_links' => array('custom_formatters' => array('admin/structure/formatters/list', array($formatter->name, 'edit'))), '#element' => $element[$delta], ), '#prefix' => '