You are here

function addthis_admin_settings_advanced_form in AddThis 7.4

Form handler for admin_settings_advanced_form.

1 string reference to 'addthis_admin_settings_advanced_form'
addthis_menu in ./addthis.module
Implements hook_menu().

File

includes/addthis.admin.inc, line 293
Administrative page callbacks for the AddThis-module.

Code

function addthis_admin_settings_advanced_form($form_state) {

  // Service URL's settings.
  $form['service_urls_fieldset'] = array(
    '#type' => 'fieldset',
    '#title' => t('Service URLs'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['service_urls_fieldset'][AddThis::BOOKMARK_URL_KEY] = array(
    '#type' => 'textfield',
    '#title' => t('AddThis bookmark URL'),
    '#default_value' => AddThis::getInstance()
      ->getBaseBookmarkUrl(),
    '#required' => TRUE,
  );
  $form['service_urls_fieldset'][AddThis::SERVICES_CSS_URL_KEY] = array(
    '#type' => 'textfield',
    '#title' => t('AddThis services stylesheet URL'),
    '#default_value' => AddThis::getInstance()
      ->getServicesCssUrl(),
    '#required' => TRUE,
  );
  $form['service_urls_fieldset'][AddThis::SERVICES_JSON_URL_KEY] = array(
    '#type' => 'textfield',
    '#title' => t('AddThis services json URL'),
    '#default_value' => AddThis::getInstance()
      ->getServicesJsonUrl(),
    '#required' => TRUE,
  );
  $form['service_urls_fieldset'][AddThis::WIDGET_JS_URL_KEY] = array(
    '#type' => 'textfield',
    '#title' => t('AddThis javascript widget URL'),
    '#default_value' => AddThis::getInstance()
      ->getBaseWidgetJsUrl(),
    '#required' => TRUE,
  );

  // Advanced settings.
  $form['advanced_settings_fieldset'] = array(
    '#type' => 'fieldset',
    '#title' => t('Additional customization'),
    '#access' => user_access(AddThis::PERMISSION_ADMINISTER_ADVANCED_ADDTHIS),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['advanced_settings_fieldset'][AddThis::CUSTOM_CONFIGURATION_CODE_ENABLED_KEY] = array(
    '#type' => 'checkbox',
    '#title' => t('Use custom AddThis configuration code'),
    '#default_value' => AddThis::getInstance()
      ->isCustomConfigurationCodeEnabled(),
    '#required' => FALSE,
    '#description' => t('Use custom AddThis configuration code. If checked, custom configuration will be used instead of other configuration settings provided in AddThis administration user interface.'),
  );
  $form['advanced_settings_fieldset'][AddThis::CUSTOM_CONFIGURATION_CODE_KEY] = array(
    '#type' => 'textarea',
    '#title' => t('AddThis custom configuration code'),
    '#default_value' => AddThis::getInstance()
      ->getCustomConfigurationCode(),
    '#required' => FALSE,
    '#description' => t('AddThis custom configuration code. See format at <a href="http://addthis.com/" target="_blank">AddThis.com</a>'),
  );
  $form['advanced_settings_fieldset'][AddThis::WIDGET_JS_LOAD_DOMREADY] = array(
    '#type' => 'checkbox',
    '#title' => t('Load the AddThis resources after the DOM is ready.'),
    '#default_value' => AddThis::getInstance()
      ->getWidgetJsDomReady(),
  );
  $form['advanced_settings_fieldset'][AddThis::WIDGET_JS_LOAD_ASYNC] = array(
    '#type' => 'checkbox',
    '#title' => t('Initialize asynchronously through addthis.init().'),
    '#description' => t('Use this when you have your own Ajax functionality or create things after the DOM is ready trough Javascript. Initialize the addthis functionality through addthis.init().'),
    '#default_value' => AddThis::getInstance()
      ->getWidgetJsAsync(),
  );
  $form['advanced_settings_fieldset'][AddThis::WIDGET_JS_INCLUDE] = array(
    '#type' => 'select',
    '#title' => t('Load widget js.'),
    '#options' => array(
      '0' => t('Don\'t include at all.'),
      '1' => t('Include on all (non admin) pages'),
      '2' => t('(Default) Include on widget rendering by Drupal.'),
    ),
    '#default_value' => AddThis::getInstance()
      ->getWidgetJsInclude(),
  );
  return system_settings_form($form);
}