summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVesa Palmu2010-03-10 16:45:53 (GMT)
committer Vesa Palmu2010-03-10 16:45:53 (GMT)
commitbe65683528548d121733475ca2af66cc5944d632 (patch)
treef8eea806a82ebfcf7868600621f427cc8ebc3893
parente73755b08e47680961cebc0f25039fd3732372d5 (diff)
#731694 by gregarios - Fails SGML Parser validation (WARNING: This changes module functionality by removing 'Button image HTML attributes')
-rw-r--r--addthis.admin.inc15
-rw-r--r--addthis.module10
2 files changed, 16 insertions, 9 deletions
diff --git a/addthis.admin.inc b/addthis.admin.inc
index f60ab48..f963208 100644
--- a/addthis.admin.inc
+++ b/addthis.admin.inc
@@ -68,13 +68,18 @@ function addthis_admin_settings() {
'#default_value' => variable_get('addthis_image_height', '16'),
'#description' => t('Height for button image. Example: 16'),
);
- $form['addthis_button_settings']['addthis_image_attributes'] = array(
+ $form['addthis_button_settings']['addthis_image_attributes_alt'] = 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=""'),
+ '#title' => t('Button image Alt tag'),
+ '#default_value' => variable_get('addthis_image_attributes_alt', 'share'),
+ '#description' => t('Text for Alt tag in img tag. Default: share'),
+ );
+ $form['addthis_button_settings']['addthis_image_attributes_class'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Button image Class tag'),
+ '#default_value' => variable_get('addthis_image_attributes_class', 'addthisimage'),
+ '#description' => t('Text for CSS class in img tag. Default: addthisimage'),
);
-
$form['addthis_widget_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Widget settings'),
diff --git a/addthis.module b/addthis.module
index 31e32f0..24866b6 100644
--- a/addthis.module
+++ b/addthis.module
@@ -161,11 +161,12 @@ function theme_addthis_button($node, $teaser) {
$button = sprintf('
<a class="addthis-button" href="http://www.addthis.com/bookmark.php"
onclick="addthis_url = location.href; addthis_title = document.title; return addthis_click(this);">
- <img src="%s" width="%d" height="%d" %s /></a>',
+ <img src="%s" width="%d" height="%d" alt="%s" class="%s" /></a>',
$_SERVER['HTTPS'] == 'on' ? addslashes(check_plain(variable_get('addthis_image_secure', 'https://secure.addthis.com/button1-share.gif'))) : addslashes(check_plain(variable_get('addthis_image', 'http://s9.addthis.com/button1-share.gif'))),
variable_get('addthis_image_width', '125'),
variable_get('addthis_image_height', '16'),
- addslashes(filter_xss(variable_get('addthis_image_attributes', 'alt=""')))
+ trim(check_plain(strip_tags(variable_get('addthis_image_attributes_alt', 'share')))),
+ trim(check_plain(strip_tags(variable_get('addthis_image_attributes_class', 'addthisimage'))))
);
}
else {
@@ -173,13 +174,14 @@ function theme_addthis_button($node, $teaser) {
<a class="addthis-button" href="http://www.addthis.com/bookmark.php"
onmouseover="return addthis_open(this, \'\', \'%s\', \'%s\')"
onmouseout="addthis_close()"
- onclick="return addthis_sendto()"><img src="%s" width="%d" height="%d" %s /></a>',
+ onclick="return addthis_sendto()"><img src="%s" width="%d" height="%d" alt="%s" class="%s" /></a>',
$teaser ? url('node/'. $node->nid, array('absolute' => 1) ) : '[URL]',
$teaser ? addslashes($node->title) : '[TITLE]',
$_SERVER['HTTPS'] == 'on' ? addslashes(check_plain(variable_get('addthis_image_secure', 'https://secure.addthis.com/button1-share.gif'))) : addslashes(check_plain(variable_get('addthis_image', 'http://s9.addthis.com/button1-share.gif'))),
variable_get('addthis_image_width', '125'),
variable_get('addthis_image_height', '16'),
- check_plain(variable_get('addthis_image_attributes', 'alt=""'))
+ trim(check_plain(strip_tags(variable_get('addthis_image_attributes_alt', 'share')))),
+ trim(check_plain(strip_tags(variable_get('addthis_image_attributes_class', 'addthisimage'))))
);
if ($_addthis_counter == 1) {
$button .= sprintf('<script type="text/javascript" src="%s/js/%d/addthis_widget.js">',