You are here

function icomoon_icon_bundle_configure in Icomoon 7

Implements hook_icon_bundle_configure().

File

./icomoon.module, line 177
icomoon.module Integrates the Icomoon service as an icon provider for Icon API.

Code

function icomoon_icon_bundle_configure(&$settings, &$form_state, &$complete_form) {
  $bundle = $form_state['bundle'];
  if ($bundle['provider'] === 'icomoon') {

    // @todo remove the description once core can handle browser conditions in
    // drupal_add_js().
    // @see https://drupal.org/node/865536
    $settings['ie7'] = array(
      '#type' => 'checkbox',
      '#title' => t('Enable IE7 Support'),
      '#description' => t('<strong>WARNING:</strong> Drupal core does not detect browser conditional comments in drupal_add_js(). Enabling this setting might result in duplicated icons.<br />It is strongly recommended that this setting remain disabled until the latest patch in <a href="!link">!link</a> is committed to Drupal.<br />If you decide to apply the patch manually and enable this setting, do so at your own risk.', array(
        '!link' => url('https://drupal.org/node/865536'),
      )),
      '#default_value' => $bundle['settings']['ie7'],
    );
    $settings['tag'] = array(
      '#type' => 'select',
      '#title' => t('HTML Markup'),
      '#description' => t('Choose the HTML markup tag that icons should be created with. Typically, this is an %tag tag, however it can be changed to suite the theme requirements.', array(
        '%tag' => '<span/>',
      )),
      '#options' => drupal_map_assoc(array(
        'span',
        'div',
        'i',
      )),
      '#default_value' => $bundle['settings']['tag'],
    );
  }
}