diff --git a/sharethis.admin.inc b/sharethis.admin.inc index 59ffdfa..46c57c3 100644 --- a/sharethis.admin.inc +++ b/sharethis.admin.inc @@ -42,7 +42,7 @@ function sharethis_configuration_form($form, &$form_state) { $publisher = $current_options_array['publisherID']; // Create the variables for teasers. // Convert Location variable from String to Array if needed. - $location_places = variable_get('sharethis_location', 'content'); + $location_places = variable_get('sharethis_location', array('content' => 'content')); if (!is_array($location_places)) { $location_places = array($location_places); variable_set('sharethis_location', $location_places); @@ -185,14 +185,14 @@ function sharethis_configuration_form($form, &$form_state) { 'block' => t('Block'), 'links' => t('Links area'), ), - '#default_value' => variable_get('sharethis_location', 'content'), + '#default_value' => variable_get('sharethis_location', array('content' => 'content')), ); // Add an information section for each location type, each dependent on the // currently selected location. foreach (array('links', 'content', 'block') as $location_type) { $form['context'][$location_type]['#type'] = 'container'; - $form['context'][$location_type]['#states']['visible'][':input[name="sharethis_location"]'] = array('value' => $location_type); + $form['context'][$location_type]['#states']['visible'][':input[name="sharethis_location[' . $location_type . ']"]'] = array('checked' => TRUE); } // Add help text for the 'content' location. @@ -402,7 +402,7 @@ function sharethis_configuration_form_validate($form, &$form_state) { */ function sharethis_configuration_form_submit($form, &$form_state) { // If the location is changing to/from 'content', clear the Field Info cache. - $current_location = variable_get('sharethis_location', 'content'); + $current_location = variable_get('sharethis_location', array('content' => 'content')); $new_location = $form_state['values']['sharethis_location']; if (($current_location == 'content' || $new_location == 'content') && $current_location != $new_location) { field_info_cache_clear(); diff --git a/sharethis.module b/sharethis.module index 9e6fa5f..f0ac8cd 100644 --- a/sharethis.module +++ b/sharethis.module @@ -82,7 +82,7 @@ function sharethis_node_view($node, $view_mode, $langcode) { $mTitle = $node->title; // Check where we want to display the ShareThis widget. - $location = variable_get('sharethis_location', array('content')); + $location = variable_get('sharethis_location', array('content' => 'content')); if (in_array('content', $location, TRUE)) { $enabled_types = $data_options['sharethis_node_types']; if (isset($enabled_types[$node->type]) && $enabled_types[$node->type] === $node->type) { @@ -144,7 +144,7 @@ function sharethis_node_view($node, $view_mode, $langcode) { function sharethis_field_extra_fields() { $extra = array(); // Only add extra fields if the location is the node content. - $location = variable_get('sharethis_location', array('content')); + $location = variable_get('sharethis_location', array('content' => 'content')); if (in_array('content', $location, TRUE)) { $entity_info = entity_get_info('node'); foreach ($entity_info['bundles'] as $bundle => $bundle_info) { @@ -451,7 +451,7 @@ function sharethis_block_view($delta = '') { * Returns cached contentfor block */ function sharethis_block_contents() { - $location = variable_get('sharethis_location', array('content')); + $location = variable_get('sharethis_location', array('content' => 'content')); if (in_array('block', $location, TRUE)) { // Output the embedded JavaScript. sharethis_include_js();