--- services/widget_services.admin.inc 2011-07-30 17:13:40.000000000 +0200 +++ services/widget_services.admin.inc 2011-07-30 17:05:52.487172000 +0200 @@ -58,7 +58,7 @@ '#type' => 'textfield', '#default_value' => variable_get('service_links_fl_width', 100), '#description' => t('A good value for button layout is 100, for box layout is 80 and for standard layout 450'), - '#size' => '10', + '#size' => 10, ); $form['facebook_like']['service_links_fl_font'] = array( '#title' => t('Font'), @@ -109,7 +109,7 @@ '#type' => 'textfield', '#default_value' => variable_get('service_links_fl_locale', ''), '#description' => t('Enter the language code and the country code separated by an underscore (i.e. es_ES, en_EN, en_US, it_IT, fr_FR, pt_BR, pt_PT)'), - '#size' => '5', + '#size' => 5, '#attributes' => array('class' => array('container-inline')), ); @@ -196,5 +196,22 @@ '#default_value' => variable_get('service_links_gpo_counter', TRUE), ); + $form['linkedin_share_button'] = array( + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#title' => t('Linkedin Share Button'), + ); + $form['linkedin_share_button']['service_links_lsb_countmode'] = array( + '#title' => t('Count Mode'), + '#type' => 'select', + '#default_value' => variable_get('service_links_lsb_countmode', 'right'), + '#options' => array( + 'top' => t('Vertical'), + 'right' => t('Horizontal'), + '' => t('No Count'), + ), + ); + return system_settings_form($form); } --- services/widget_services.info 2011-07-30 17:13:40.000000000 +0200 +++ services/widget_services.info 2011-07-30 17:10:00.760222000 +0200 @@ -1,5 +1,5 @@ name = Widget Services -description = Provide the Widgets: Digg Smart Button, Facebook Like, Facebook Share, Google Plus One, Twitter +description = Provide the Widgets: Digg Smart Button, Facebook Like, Facebook Share, Google Plus One, Linkedin Share Button, Twitter core = 7.x package = Service Links dependencies[] = service_links --- services/widget_services.module 2011-07-30 17:13:40.000000000 +0200 +++ services/widget_services.module 2011-07-30 16:37:28.814582000 +0200 @@ -64,6 +64,18 @@ 'style' => SERVICE_LINKS_STYLE_EMPTY, 'callback' => 'ws_google_plus_one_data', ); + $links['linkedin_share_button'] = array( + 'name' => 'Linkedin Share Button', + 'link' => '', + 'icon' => 'linkedin.png', + 'description' => t('Share on Linkedin'), + 'javascript' => array( + 'linkedin_share_button.js', + 'http://platform.linkedin.com/in.js', + ), + 'style' => SERVICE_LINKS_STYLE_EMPTY, + 'callback' => 'ws_linkedin_share_button_data', + ); return $links; } @@ -179,6 +191,21 @@ } } +/** + * Callback function for Linkedin Share Button. + */ +function ws_linkedin_share_button_data(&$service, $subst) { + static $lsb_settings; + + if (!isset($lsb_settings)) { + $lsb_settings = array( + 'countmode' => check_plain(variable_get('service_links_lsb_countmode', 'right')), + ); + + drupal_add_js(array('ws_lsb' => $lsb_settings), 'setting'); + } +} + /** * Implements hook_menu(). */