function tweetbutton_field_widget_form in Tweet Button 7.2
Implements hook_field_widget_form().
File
- ./
tweetbutton.module, line 96
Code
function tweetbutton_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
$default_author = isset($instance['settings']['author_twitter']) ? $instance['settings']['author_twitter'] : '';
$default_text = isset($instance['settings']['tweet_text']) ? $instance['settings']['tweet_text'] : '';
$element['account'] = array(
'#type' => 'textfield',
'#default_value' => !empty($items[$delta]['account']) ? $items[$delta]['account'] : $default_author,
'#title' => t('Author twitter account'),
'#description' => t('Leave blank to use global twitter account.'),
'#maxlength' => 32,
'#access' => user_access('use tweetbutton field'),
);
$element['text'] = array(
'#type' => 'textfield',
'#default_value' => !empty($items[$delta]['text']) ? $items[$delta]['text'] : $default_text,
'#title' => t('Tweet text'),
'#description' => t('Leave blank to use content title as tweet text'),
'#maxlength' => 128,
'#access' => user_access('use tweetbutton field'),
);
return $element;
}