You are here

function admin_config_easy_social in Easy Social 7

1 string reference to 'admin_config_easy_social'
easy_social_menu in ./easy_social.module
Implements hook_menu().

File

./easy_social.module, line 130
This is the file description for Easy Social module.

Code

function admin_config_easy_social() {
  $form = array();
  $form['global_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Global Settings'),
    '#description' => t('Settings available for all content types'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['global_settings']['easysocial_global_typebtn'] = array(
    '#type' => 'radios',
    '#title' => t('Type of buttons'),
    '#options' => array(
      t('Horizontal'),
      t('Vertical'),
    ),
    '#default_value' => variable_get_value('easysocial_global_typebtn'),
  );
  $form['global_settings']['easysocial_global_social_buttons'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Social Buttons'),
    '#options' => array(
      'twitter' => 'Twitter',
      'facebook' => 'Facebook',
      'googleplus' => 'Google Plus',
      'linkedin' => 'Linked In',
    ),
    '#default_value' => variable_get_value('easysocial_global_social_buttons'),
  );
  $form['global_settings']['twitter_global_data'] = array(
    '#type' => 'fieldset',
    '#title' => t('Twitter Info'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['global_settings']['twitter_global_data']['easysocial_tt_global_account_via'] = array(
    '#type' => 'textfield',
    '#title' => t('Mention account'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => variable_get_value('easysocial_tt_global_account_via'),
  );
  $form['global_settings']['twitter_global_data']['easysocial_tt_global_account_related'] = array(
    '#type' => 'textfield',
    '#title' => t('Related account'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => variable_get_value('easysocial_tt_global_account_related'),
  );
  $form['global_settings']['twitter_global_data']['easysocial_tt_global_account_description'] = array(
    '#type' => 'textfield',
    '#title' => t('Related account description'),
    '#size' => 120,
    '#maxlength' => 120,
    '#default_value' => variable_get_value('easysocial_tt_global_account_description'),
    '#description' => 'Use !title for the current page title',
  );
  $form['override_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Override Settings by Type'),
    '#description' => t('Settings by content type'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $node_types = node_type_get_types();

  // sometimes when dealing with feature-defined content types they appear out of order
  // since this is an admin page we prefer organization over performance so go ahead and sort it
  ksort($node_types);
  foreach ($node_types as $type => $typeobj) {
    $form['override_settings']['easysocial_settings_type_' . $type] = array(
      '#type' => 'fieldset',
      '#title' => t('Custom Settings for %type', array(
        '%type' => $typeobj->name,
      )),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $form['override_settings']['easysocial_settings_type_' . $type]['easysocial_' . $type . '_override'] = array(
      '#type' => 'checkbox',
      '#title' => t('Override'),
      '#description' => t('Check this option to override the global settings for this type'),
      '#default_value' => variable_get_value('easysocial_' . $type . '_override'),
    );
    $form['override_settings']['easysocial_settings_type_' . $type]['easysocial_' . $type . '_typebtn'] = array(
      '#type' => 'radios',
      '#title' => t('Type of buttons'),
      // '#description' => t('Type of buttons, horizontal or vertical.'),
      '#options' => array(
        t('Horizontal'),
        t('Vertical'),
      ),
      '#default_value' => variable_get_value('easysocial_' . $type . '_typebtn'),
    );
    $form['override_settings']['easysocial_settings_type_' . $type]['easysocial_' . $type . '_social_buttons'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Social Buttons'),
      '#options' => array(
        'twitter' => 'Twitter',
        'facebook' => 'Facebook',
        'googleplus' => 'Google Plus',
        'linkedin' => 'Linked In',
      ),
      '#default_value' => variable_get_value('easysocial_' . $type . '_social_buttons'),
    );
  }
  $form = system_settings_form($form);
  return $form;
}