summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Glastra2011-10-16 21:22:31 (GMT)
committer Matthias Glastra2011-10-16 21:22:31 (GMT)
commit1784116b6e445e51dae0951fa517cf8af60f4323 (patch)
tree01691d20598da490e0129b21b1f79b896cf648be
parent1c0a69f75da4efca861cce88aa2d970d0b206d8c (diff)
Fix for #1308970 reported by vasike,fixed by matglas86. Error in block configure.
There was a bug introduced when adding the different displays through formatters this bug was not noticed but reported by vasike in issue #1308970.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--README.txt6
-rw-r--r--TODO.txt4
-rw-r--r--addthis.addthis.inc10
-rw-r--r--addthis.module5
-rw-r--r--includes/addthis.block.inc6
-rw-r--r--includes/addthis.field.inc4
7 files changed, 23 insertions, 13 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index e69de29..1faa7c6 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -0,0 +1 @@
+Fix for #1308970 reported by vasike,fixed by matglas86. Error in block configure. \ No newline at end of file
diff --git a/README.txt b/README.txt
index b99f769..f9b8b1c 100644
--- a/README.txt
+++ b/README.txt
@@ -16,7 +16,7 @@ month our button is displayed 20 billion times.
-- REQUIREMENTS --
-None.
+Field, Block
-- INSTALLATION --
@@ -26,8 +26,8 @@ For link sharing statistics registration at http://addthis.com/ is required, but
-- CONFIGURATION --
-Use the admin configuration page to configure settings.
-
+Use the admin configuration page to configure settings and see http://drupal.org/node/1309922
+for a walkthrough on how to configure the rest.
-- CONTACT --
diff --git a/TODO.txt b/TODO.txt
index 7ecf92d..f7cf876 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,2 +1,4 @@
- Create asynchronous load checkbox in settings page.
-- Refactor the order of methods in the AddThis class to collect same type of methods. \ No newline at end of file
+- Refactor the order of methods in the AddThis class to collect same type of methods.
+- Add hook for altering markup ofter preperation.
+- Add Facebook namespaces \ No newline at end of file
diff --git a/addthis.addthis.inc b/addthis.addthis.inc
index 862cf44..248051a 100644
--- a/addthis.addthis.inc
+++ b/addthis.addthis.inc
@@ -1,5 +1,11 @@
<?php
/**
+ * @file
+ * This file contains the definitions for the AddThis Display types and the
+ * rendering of markup.
+ */
+
+/**
* Implementation of hook_addthis_display_markup().
*/
function addthis_addthis_display_markup($display, $variables = NULL) {
@@ -117,8 +123,8 @@ function addthis_addthis_display_markup__addthis_toolbox($variables = NULL) {
),
),
);
- $numberOfPreferredServices = $addthis->getNumberOfPreferredServices();
- for ($i = 1; $i <= $numberOfPreferredServices; $i++) {
+ $number_of_preferred_services = $addthis->getNumberOfPreferredServices();
+ for ($i = 1; $i <= $number_of_preferred_services; $i++) {
$items[] = array(
'#theme' => 'addthis_element',
'#tag' => 'a',
diff --git a/addthis.module b/addthis.module
index 060e3d5..a094e29 100644
--- a/addthis.module
+++ b/addthis.module
@@ -133,7 +133,8 @@ function template_preprocess_addthis(&$variables) {
if (isset($variables[0]) && count($variables) == 3) {
$variables['#display'] = $variables[0];
unset($variables[0]);
- } elseif (isset($variables['#display'])) {
+ }
+ elseif (isset($variables['#display'])) {
$display_type = $variables['#display'];
}
}
@@ -153,7 +154,7 @@ function theme_addthis_wrapper($variables) {
$children = element_children($element);
if (count($children) > 0) {
- foreach($children as $child) {
+ foreach ($children as $child) {
$output .= render($element[$child]);
}
}
diff --git a/includes/addthis.block.inc b/includes/addthis.block.inc
index e1fe228..3395c0a 100644
--- a/includes/addthis.block.inc
+++ b/includes/addthis.block.inc
@@ -11,7 +11,7 @@
function addthis_block_info() {
$block_info = array();
$block_info[AddThis::BLOCK_NAME] = array(
- 'info' => t('An AddThis-block.'),
+ 'info' => t('AddThis'),
'cache' => DRUPAL_NO_CACHE,
);
return $block_info;
@@ -37,9 +37,9 @@ function addthis_block_view($block_name = '') {
function addthis_block_configure($delta = '') {
$form[AddThis::BLOCK_WIDGET_TYPE_KEY] = array(
'#type' => 'select',
- '#title' => t('AddThis widget type'),
+ '#title' => t('AddThis Display type'),
'#options' => AddThis::getInstance()->getWidgetTypes(),
- '#default_value' => AddThis::getInstance()->getBlockWidgetType(),
+ '#default_value' => AddThis::getInstance()->getBlockDisplayType(),
);
return $form;
}
diff --git a/includes/addthis.field.inc b/includes/addthis.field.inc
index d4d6f8c..6288cdf 100644
--- a/includes/addthis.field.inc
+++ b/includes/addthis.field.inc
@@ -58,7 +58,7 @@ function addthis_field_formatter_info() {
*/
function addthis_field_info_formatter_field_type($field_type = NULL) {
$formatters = field_info_formatter_types();
- foreach($formatters as $key => $formatter) {
+ foreach ($formatters as $key => $formatter) {
if (!in_array((!isset($field_type) ? AddThis::FIELD_TYPE : $field_type), $formatter['field types'])) {
unset($formatters[$key]);
}
@@ -89,7 +89,7 @@ function addthis_field_formatter_view($entity_type, $entity, $field, $instance,
*/
function addthis_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) {
$dummy_value = "Don't mind this value. Is't a placeholder.";
- foreach($items as $key => $item) {
+ foreach ($items as $key => $item) {
if (!isset($item[0]['value'])) {
$items[$key][0]['value'] = $dummy_value;
}