You are here

function bootstrap_languages_block_configure in Bootstrap Languages 7

Implements hook_block_configure().

File

./bootstrap_languages.module, line 62
Provides a Bootstrap dropdown button to switch between available languages.

Code

function bootstrap_languages_block_configure($delta = '') {
  $settings = variable_get('bootstrap_languages_block_settings');
  $form = array();

  // Check if the Languages for Bootstrap 3 library is present.
  $library = libraries_load('bootstrap-languages');
  if ($library['loaded'] == FALSE) {
    drupal_set_message($library['error message'], 'error');
  }
  $form['bootstrap_languages'] = array(
    '#type' => 'fieldset',
    '#title' => t('Bootstrap Languages settings'),
    '#weight' => 0,
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['bootstrap_languages']['show_all'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show all enabled languages'),
    '#description' => t('Show all languages in the switcher no matter if there is a translation for the node or not. For languages without translation the switcher will redirect to homepage.'),
    '#default_value' => $settings['show_all'],
  );
  $form['bootstrap_languages']['btn_type'] = array(
    '#type' => 'select',
    '#title' => t('Bootstrap button type'),
    '#options' => array(
      'btn-default' => t('Default'),
      'btn-primary' => t('Primary'),
      'btn-info' => t('Info'),
    ),
    '#default_value' => $settings['btn_type'],
  );
  return $form;
}