function advpoll_promote_writein_form in Advanced Poll 7
Same name and namespace in other branches
- 7.3 includes/advpoll.pages.inc \advpoll_promote_writein_form()
- 7.2 includes/advpoll.pages.inc \advpoll_promote_writein_form()
1 string reference to 'advpoll_promote_writein_form'
- advpoll_writeins_page in includes/
advpoll.pages.inc
File
- includes/
advpoll.pages.inc, line 367
Code
function advpoll_promote_writein_form($form, &$form_state, $node) {
$data = advpoll_get_data($node);
$count = count($data->choices);
$options = array();
for ($i = 0; $i < $count; $i++) {
if ($data->choices[$i]['write_in']) {
$options[] = strip_tags($data->choices[$i]['choice']);
}
}
$form['#id'] = 'advpoll-promote_writein';
if ($options) {
$form['promote_writein'] = array(
'#type' => 'fieldset',
'#title' => t('Promote write-ins'),
'#description' => t('Write-ins can be converted to regular choices. This is useful if users cannot see past write-ins but you want to promote specific write-ins so that they can be seen by users who vote in the future.'),
);
$form['promote_writein']['choices'] = array(
'#type' => 'checkboxes',
'#title' => '',
'#options' => drupal_map_assoc($options),
);
$form['promote_writein']['submit'] = array(
'#type' => 'submit',
'#value' => t('Promote'),
);
}
else {
$form['promote_writein'] = array(
'#type' => 'fieldset',
'#title' => t('Promote write-ins'),
'#description' => t('There are currently no write-ins available to promote.'),
);
}
return $form;
}