function dlike_form_flag_form_alter in Drupal like (Flag counter) 7.3
Same name and namespace in other branches
- 7 dlike.module \dlike_form_flag_form_alter()
- 7.2 dlike.module \dlike_form_flag_form_alter()
Implementation of hook_form_form_id_alter().
File
- ./
dlike.module, line 59
Code
function dlike_form_flag_form_alter(&$form, $form_state) {
$form['dlike-' . $form['#flag']->name . '_option'] = array(
'#type' => 'checkbox',
'#title' => 'Add Drupal like',
'#default_value' => variable_get('dlike-' . $form['#flag']->name . '_option', 0),
'#weight' => '900',
);
$form['dlike-' . $form['#flag']->name . '_text_value'] = array(
'#type' => 'textfield',
'#title' => t('Add the text you want to display'),
'#description' => t('Use <em>@count</em> token for displaying the number of times content has been flagged.<br>e.g. "(@count likes)" or "@count people have flagged this" or "See who all have flagged this content"'),
'#default_value' => variable_get('dlike-' . $form['#flag']->name . '_text_value', t('(@count)')),
'#weight' => '901',
);
$form['dlike-modal-window-title-' . $form['#flag']->name] = array(
'#type' => 'textfield',
'#title' => t('Title for modal window'),
'#default_value' => variable_get('dlike-modal-window-title-' . $form['#flag']->name, NULL),
'#description' => t('e.g. "People who like this"'),
'#weight' => '902',
);
$form['#submit'][] = 'dlike_form_data';
}