summaryrefslogtreecommitdiffstats
path: root/addthis.admin.inc
blob: f60ab4822e6060c82df7e4f53ff5ddee5afa30a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
// $Id$

/**
 * @file
 * Administration settings for AddThis button integration
 */

/**
 * Administration settings form.
 *
 * @return
 *   The completed form definition.
 */
function addthis_admin_settings() {
  $form = array();

  $form['addthis_general_settings'] = array(
    '#type'  => 'fieldset',
    '#title' => t('General settings'),
  );
  $form['addthis_general_settings']['addthis_username'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Username'),
    '#default_value' => variable_get('addthis_username', 'my-username'),
    '#description'   => t('Your username for <a href="http://www.addthis.com/">addthis.com</a>. Example: my-username'),
  );
  $form['addthis_general_settings']['addthis_display_in_links'] = array(
    '#type'          => 'checkbox',
    '#title'         => t('Display on node pages'),
    '#default_value' => variable_get('addthis_display_in_links', '0'),
    '#description'   => t('Display an AddThis button always on a node page\'s links section.'),
  );
  $form['addthis_general_settings']['addthis_display_in_teasers'] = array(
    '#type'          => 'checkbox',
    '#title'         => t('Display in node teasers'),
    '#default_value' => variable_get('addthis_display_in_teasers', '0'),
    '#description'   => t('Display an AddThis button in the node teasers.'),
  );

  $form['addthis_button_settings'] = array(
    '#type'         => 'fieldset',
    '#title'        => t('Button image settings'),
    '#collapsible'  => TRUE,
    '#collapsed'    => TRUE,
  );
  $form['addthis_button_settings']['addthis_image'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Button image url'),
    '#default_value' => variable_get('addthis_image', 'http://s9.addthis.com/button1-share.gif'),
    '#description'   => t('URL for small image in the button. Example: http://s9.addthis.com/button1-share.gif'),
  );
  $form['addthis_button_settings']['addthis_image_secure'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Button image url for secure https connection'),
    '#default_value' => variable_get('addthis_image_secure', 'https://secure.addthis.com/button1-share.gif'),
    '#description'   => t('This is only required if your site uses secure https connections. Example: https://secure.addthis.com/button1-share.gif'),
  );
  $form['addthis_button_settings']['addthis_image_width'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Button image width'),
    '#default_value' => variable_get('addthis_image_width', '125'),
    '#description'   => t('Width for button image. Example: 125'),
  );
  $form['addthis_button_settings']['addthis_image_height'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Button image height'),
    '#default_value' => variable_get('addthis_image_height', '16'),
    '#description'   => t('Height for button image. Example: 16'),
  );
  $form['addthis_button_settings']['addthis_image_attributes'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Button image HTML attributes'),
    '#default_value' => variable_get('addthis_image_attributes', 'alt=""'),
    '#description'   => t('Extra HTML attributes for img tag. Example: alt=""'),
  );

  $form['addthis_widget_settings'] = array(
    '#type'         => 'fieldset',
    '#title'        => t('Widget settings'),
    '#collapsible'  => TRUE,
    '#collapsed'    => TRUE,
  );
  $form['addthis_widget_settings']['addthis_dropdown_disabled'] = array(
    '#type'          => 'checkbox',
    '#title'         => t('Disable dropdown'),
    '#default_value' => variable_get('addthis_dropdown_disabled', '0'),
    '#description'   => t('You can disable the dropdown for selecting where to share your link and use a pop-up window instead. This can be useful if the button is for example located next to a flash object.'),
  );
  $form['addthis_widget_settings']['addthis_logo'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Logo url'),
    '#default_value' => variable_get('addthis_logo', 'http://www.addthis.com/images/yourlogo.png'),
    '#description'   => t('The logo to display on the popup window (about 200x50 pixels). The popup window is show when the user selects the \'More\' choice. Example: http://www.your-website.com/img/mylogo.gif'),
  );
  $form['addthis_widget_settings']['addthis_logo_background'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Logo background color'),
    '#default_value' => variable_get('addthis_logo_background', 'EFEFFF'),
    '#description'   => t('The color to use as a background around the logo in the popup. Example: EFEFEF'),
  );
  $form['addthis_widget_settings']['addthis_logo_color'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Logo text color'),
    '#default_value' => variable_get('addthis_logo_color', '666699'),
    '#description'   => t('The color to use for the text next to the logo in the popup. Example: 666666'),
  );
  $form['addthis_widget_settings']['addthis_brand'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Brand text'),
    '#default_value' => variable_get('addthis_brand', ''),
    '#description'   => t('The brand name to display in the drop-down (top right). Example: My Website. Leave blank to use the site_name variable, currently set to !site_name', array('!site_name' => variable_get('site_name', 'Drupal'))),
  );
  $form['addthis_widget_settings']['addthis_options'] = array(
    '#type'          => 'textarea',
    '#title'         => t('Options'),
    '#default_value' => variable_get('addthis_options', 'favorites, email, digg, delicious, myspace, facebook, google, live, more'),
    '#description'   => t('A comma-separated ordered list of options to include in the drop-down. Example: favorites, email, digg, delicious, more<br/>Currently supported options:<br/>
	aim, aolfav, ask, backflip, ballhype, blinklist, blogmarks, bluedot, buzz, delicious, digg, diigo, email, facebook, favorites, fark, feedmelinks, friendfeed, furl, google, kaboodle, kirtsy, linkedin, live, magnolia, misterwong, mixx, multiply, myweb, myspace, netvous, newsvine, pownce, propeller, reddit, segnalo, sharedstuff, slashdot, spurl, stumbleupon, stylehive, tailrank, technorati, thisnext, twitter, yardbarker, yahoobkm, more<br />
        The most up-to-date list can be found <a href="!url">here</a>.', array('!url' => url('http://addthis.com/services/list'))),
  );
  $form['addthis_widget_settings']['addthis_offset_top'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Offset top'),
    '#default_value' => variable_get('addthis_offset_top', '2'),
    '#description'   => t('Vertical offset for the drop-down window (in pixels). Example: 2'),
  );
  $form['addthis_widget_settings']['addthis_offset_left'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Offset top'),
    '#default_value' => variable_get('addthis_offset_left', '2'),
    '#description'   => t('Horizontal offset for the drop-down window (in pixels). Example: 2'),
  );
  $form['addthis_widget_settings']['addthis_disable_flash'] = array(
    '#type'          => 'checkbox',
    '#title'         => t('Disable Flash cookie'),
    '#default_value' => variable_get('addthis_disable_flash', '0'),
    '#description'   => t('AddThis.com uses Flash cookies by default to <a href="http://www.addthis.com/blog/2009/01/05/the-addthis-flash-cookie-we-need-your-feedback/">provide more accurate tracking information</a>. Some people consider this <a href="http://drupal.org/node/364078">a privacy concern</a> and Flash cookies can be replaced with normal ones by checking this checkbox.'),
  );
  $form['addthis_widget_settings']['addthis_widget_version'] = array(
    '#type'          => 'select',
    '#title'         => t('Widget Version'),
    '#default_value' => variable_get('addthis_widget_version', '152'),
    '#options'       => array(
        152 => t('152 - Uses a popup window for the more option'),
        200 => t('200 - Adds lightbox support for the more option')
    ),
    '#description'   => t('The version of the addthis widget to use.'),
  );
  return system_settings_form($form);
}