You are here

function yashare_settings in Yandex.Share 7

Returns settings form.

1 string reference to 'yashare_settings'
yashare_menu in ./yashare.module
Implements hook_menu().

File

./yashare.module, line 90

Code

function yashare_settings() {
  $form['settings'] = array(
    '#type' => 'vertical_tabs',
  );
  $form['settings']['general'] = array(
    '#type' => 'fieldset',
    '#title' => t('General settings'),
  );
  $form['settings']['general']['yashare_l10n'] = array(
    '#type' => 'select',
    '#title' => t('Language'),
    '#options' => yashare_get_languages(),
    '#default_value' => yashare_get_language(),
  );
  $title = drupal_get_title();
  $form['settings']['general']['yashare_type'] = array(
    '#type' => 'radios',
    '#title' => t('Style'),
    '#options' => array(
      'button' => yashare_render('init-button', '<front>', $title, NULL, 'button'),
      'link' => yashare_render('init-link', '<front>', $title, NULL, 'link'),
      'icon' => yashare_render('init-icon', '<front>', $title, NULL, 'icon'),
      'none' => yashare_render('init-none', '<front>', $title, NULL, 'none'),
    ),
    '#default_value' => variable_get('yashare_type', 'button'),
  );
  $form['settings']['general']['yashare_border'] = array(
    '#type' => 'checkbox',
    '#title' => t('Border'),
    '#default_value' => variable_get('yashare_border', FALSE),
  );
  $form['settings']['general']['yashare_linkunderline'] = array(
    '#type' => 'checkbox',
    '#title' => t('Underline link'),
    '#default_value' => variable_get('yashare_linkunderline', FALSE),
  );
  $form['settings']['general']['yashare_linkicon'] = array(
    '#type' => 'checkbox',
    '#title' => t('Icon link'),
    '#default_value' => variable_get('yashare_linkicon', FALSE),
  );
  $form['settings']['general']['yashare_image'] = array(
    '#type' => 'checkbox',
    '#title' => t('Pass site logo'),
    '#default_value' => variable_get('yashare_image', FALSE),
  );
  $form['settings']['block_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Display settings'),
  );
  $form['settings']['block_settings']['yashare_block_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Block title'),
    '#default_value' => variable_get('yashare_block_title', ''),
  );
  $form['settings']['block_settings']['yashare_block_services'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Inline services'),
    '#options' => yashare_get_services(),
    '#default_value' => yashare_get_block_services(),
  );
  $form['settings']['popup_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Popup settings'),
  );
  $form['settings']['popup_settings']['yashare_popup_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Popup title'),
    '#default_value' => variable_get('yashare_popup_title', ''),
  );
  $form['settings']['popup_settings']['yashare_popup_link'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show link for copy'),
    '#default_value' => variable_get('yashare_popup_link', FALSE),
  );
  $form['settings']['popup_settings']['yashare_popup_codeforblog'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show code for blog'),
    '#default_value' => variable_get('yashare_popup_codeforblog', FALSE),
  );
  $form['settings']['popup_settings']['yashare_popup_vdirection'] = array(
    '#type' => 'select',
    '#title' => t('Popup direction'),
    '#options' => array(
      0 => t('Auto'),
      'up' => t('Up'),
      'down' => t('Down'),
    ),
    '#default_value' => variable_get('yashare_popup_vdirection', 0),
  );
  $form['settings']['popup_settings']['yashare_popup_services'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Popup services'),
    '#options' => yashare_get_services(),
    '#default_value' => yashare_get_popup_services(),
  );
  return system_settings_form($form);
}