| 10 |
* Menu callback; Settings administration. |
* Menu callback; Settings administration. |
| 11 |
*/ |
*/ |
| 12 |
function sharethis_admin_settings() { |
function sharethis_admin_settings() { |
|
// Clear the cache. |
|
|
service_links_get_links(array('sharethis' => 'sharethis'), TRUE); |
|
| 13 |
$form['sharethis_code'] = array( |
$form['sharethis_code'] = array( |
| 14 |
'#type' => 'textarea', |
'#type' => 'textarea', |
| 15 |
'#title' => t('Code'), |
'#title' => t('Code'), |
| 16 |
'#default_value' => variable_get('sharethis_code', ''), |
'#default_value' => variable_get('sharethis_code', ''), |
| 17 |
'#description' => t('The <a href="@code">Get the Button code</a> provided by ShareThis. If this is not given, the default one will be used.', array('@code' => 'http://sharethis.com/publishers/getbutton/')), |
'#description' => t('The <a href="@code">Get the Button code</a> provided by ShareThis. If this is not given, the default one will be used.', array('@code' => 'http://sharethis.com/publishers/getbutton/')), |
| 18 |
); |
); |
| 19 |
$form['sharethis_icon'] = array( |
$form['sharethis_sharethis_this_node_types'] = array( |
| 20 |
'#type' => 'radios', |
'#type' => 'checkboxes', |
| 21 |
'#title' => t('Icon'), |
'#title' => t('Node types'), |
| 22 |
'#default_value' => variable_get('sharethis_icon', 'sharethis.png'), |
'#description' => t('Choose which node types to display the ShareThis button on.'), |
| 23 |
'#description' => t('The icon to associate with the ShareThis link.'), |
'#default_value' => variable_get('sharethis_sharethis_this_node_types', array()), |
| 24 |
'#options' => array( |
'#options' => node_get_types('names'), |
| 25 |
'sharethis.png' => t('!image Static', array('!image' => theme('image', drupal_get_path('module', 'sharethis') .'/sharethis.png'))), |
); |
| 26 |
'sharethis-rotating.gif' => t('!image Rotating', array('!image' => theme('image', drupal_get_path('module', 'sharethis') .'/sharethis-rotating.gif'))), |
$form['sharethis_teaser'] = array( |
| 27 |
|
'#type' => 'checkbox', |
| 28 |
|
'#title' => t('Display in teaser view'), |
| 29 |
|
'#description' => t('If enabled, the ShareThis links will appear in node teasers. If disabled, they will only appear on the full node page.'), |
| 30 |
|
'#default_value' => variable_get('sharethis_teaser', 1), |
| 31 |
|
); |
| 32 |
|
$form['sharethis_sharethis_this_where'] = array( |
| 33 |
|
'#type' => 'select', |
| 34 |
|
'#title' => t('Where to display'), |
| 35 |
|
'#description' => t('Select where you would like the ShareThis link to appear.'), |
| 36 |
|
'#default_value' => variable_get('sharethis_sharethis_this_where', 'links'), |
| 37 |
|
'#options'=> array( |
| 38 |
|
'links' => t('Links'), |
| 39 |
|
'nodes' => t('Nodes'), |
| 40 |
), |
), |
| 41 |
); |
); |
| 42 |
|
$form['sharethis_sharethis_weight'] = array( |
| 43 |
|
'#type' => 'weight', |
| 44 |
|
'#delta' => 10, |
| 45 |
|
'#description' => t('Only applies when node type display is selected.'), |
| 46 |
|
'#title' => t('Weight'), |
| 47 |
|
'#default_value' => variable_get('sharethis_sharethis_weight', 0), |
| 48 |
|
); |
| 49 |
return system_settings_form($form); |
return system_settings_form($form); |
| 50 |
} |
} |