function shariff_settings_form in Shariff Social Media Buttons 7
Admin settings menu callback.
See also
1 string reference to 'shariff_settings_form'
- shariff_menu in ./
shariff.module - Implements hook_menu().
File
- ./
shariff.module, line 118 - Integrating Shariff library, providing settings form and block.
Code
function shariff_settings_form() {
$settings = _shariff_get_settings();
$form['shariff_services'] = array(
'#title' => t('Activated services'),
'#description' => t('Please define for which services a sharing button should be included.'),
'#type' => 'checkboxes',
'#options' => array(
'twitter' => t('Twitter'),
'facebook' => t('Facebook'),
'googleplus' => t('Google+'),
'linkedin' => t('LinkedIn'),
'pinterest' => t('Pinterest'),
'xing' => t('Xing'),
'whatsapp' => t('WhatsApp'),
'addthis' => t('AddThis'),
'tumblr' => t('Tumblr'),
'flattr' => t('Flattr'),
'diaspora' => t('Diaspora'),
'reddit' => t('reddit'),
'stumbleupon' => t('StumbleUpon'),
'threema' => t('Threema'),
'mail' => t('E-Mail'),
'weibo' => t('Weibo'),
'tencent-weibo' => t('Tencent-Weibo'),
'qzone' => t('Qzone'),
'info' => t('Info Button'),
),
'#default_value' => $settings['services'],
);
$form['shariff_theme'] = array(
'#title' => t('Theme'),
'#description' => t('Please choose a layout option.'),
'#type' => 'radios',
'#options' => array(
'colored' => t('Colored'),
'grey' => t('Grey'),
'white' => t('White'),
),
'#default_value' => $settings['shariff_theme'],
);
$form['shariff_css'] = array(
'#title' => t('CSS'),
'#description' => t('Please choose a CSS variant. !FontAwesome is used to display the services icons.', array(
'!FontAwesome' => l(t('Font Awesome'), 'http://fortawesome.github.io/Font-Awesome/', array(
'attributes' => array(
'target' => '_blank',
),
)),
)),
'#type' => 'radios',
'#options' => array(
'complete' => t('Complete (Contains also Font Awesome)'),
'min' => t('Minimal (If Font Awesome is already included in your site)'),
'naked' => t('None (Without any CSS)'),
),
'#default_value' => variable_get('shariff_css', 'complete'),
);
$form['shariff_orientation'] = array(
'#title' => t('Orientation'),
'#description' => t('Vertical will stack the buttons vertically. Default is horizontally.'),
'#type' => 'radios',
'#options' => array(
'vertical' => t('Vertical'),
'horizontal' => t('Horizontal'),
),
'#default_value' => $settings['orientation'],
);
$form['shariff_twitter_via'] = array(
'#title' => t('Twitter Via User'),
'#description' => t('Screen name of the Twitter user to attribute the Tweets to.'),
'#type' => 'textfield',
'#default_value' => $settings['twitter_via'],
);
$form['shariff_mail_url'] = array(
'#title' => t('Mail link'),
'#description' => t('The url target used for the mail service button. Leave it as "mailto:" to let the user
choose an email address.'),
'#type' => 'textfield',
'#default_value' => $settings['mail_url'] ? $settings['mail_url'] : 'mailto:',
);
$form['shariff_mail_subject'] = array(
'#title' => t('Mail subject'),
'#description' => t("If a mailto: link is provided in Mail link above, then this value is used as the mail subject.\n Left empty the page's current (canonical) URL or og:url is used."),
'#type' => 'textfield',
'#default_value' => $settings['mail_subject'],
);
$form['shariff_mail_body'] = array(
'#title' => t('Mail body'),
'#description' => t("If a mailto: link is provided in Mail link above, then this value is used as the mail body.\n Left empty the page title is used."),
'#type' => 'textarea',
'#default_value' => $settings['mail_body'],
);
$form['shariff_referrer_track'] = array(
'#title' => t('Referrer track code'),
'#description' => t('A string that will be appended to the share url. Disabled when empty.'),
'#type' => 'textfield',
'#default_value' => $settings['referrer_track'],
);
$form['shariff_backend_url'] = array(
'#title' => t('Backend URL'),
'#description' => t('The path to your Shariff backend. Leaving the value blank disables the backend feature and no counts will occur.'),
'#type' => 'textfield',
'#default_value' => $settings['backend_url'],
);
$form['shariff_flattr_category'] = array(
'#title' => t('Flattr category'),
'#description' => t('Category to be used for Flattr.'),
'#type' => 'textfield',
'#default_value' => $settings['flattr_category'],
);
$form['shariff_flattr_user'] = array(
'#title' => t('Flattr user'),
'#description' => t('User that receives Flattr donation.'),
'#type' => 'textfield',
'#default_value' => $settings['flattr_user'],
);
$form['shariff_media_url'] = array(
'#title' => t('Media url'),
'#description' => t('Media url to be shared (Pinterest).'),
'#type' => 'textfield',
'#default_value' => $settings['media_url'],
);
$form['#validate'] = array(
'shariff_settings_validate',
);
$form['#submit'] = array(
'shariff_settings_submit',
);
return system_settings_form($form);
}