You are here

function _addthis_customize_form_row in AddThis 6.3

Helper function for addthis_customize_form.

Create the form elements for a service customization.

Parameters

array $def: An array defining a service customization.

Return value

array The branch of the form for this definition.

1 call to _addthis_customize_form_row()
addthis_customize_form in ./addthis.admin.inc
Form builder function for the Service Customization form.

File

./addthis.admin.inc, line 340
Configuration settings for AddThis.

Code

function _addthis_customize_form_row($def = array()) {
  $branch = array(
    '#type' => 'fieldset',
    '#title' => empty($def['code']) ? t('Add a service customization') : check_plain($def['code']),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $branch['code'] = array(
    '#type' => 'textfield',
    '#title' => t('Service code'),
    '#description' => t('The service code to override or a new code you are defining.'),
    '#default_value' => $def['code'],
  );
  $branch['class'] = array(
    '#type' => 'textfield',
    '#title' => t('HTML classes'),
    '#description' => t('Enter HTML classes to be used on this toolbox item. Example: <strong>addthis_button_tweet</strong> <br />You <strong>must</strong> provide this even if you are overriding an already existing code.'),
    '#default_value' => $def['class'],
  );
  $branch['attributes'] = array(
    '#type' => 'textfield',
    '#title' => t('HTML attributes'),
    '#description' => t('Custom attributes to insert into the toolbox item element. Example: <strong>tw:via="mytwittername"</strong>'),
    '#default_value' => $def['attributes'],
    '#maxlength' => 1024,
  );
  $branch['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title'),
    '#description' => t('Text or markup to be rendered inside the item element. Most of the time, this should be left blank.'),
    '#default_value' => $def['title'],
  );
  return $branch;
}