View source
<?php
function _option_cfs_newadmin(&$form, &$form_state, $settings, $node) {
if ($settings['cfs_newadmin'] == 0 && empty($form['cid']['value']) && user_access('administer comments')) {
global $user;
$form['admin'] = array(
'#type' => 'fieldset',
'#title' => t('Administration'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#weight' => -2,
);
unset($form['_author']);
unset($form['author']);
$form['admin']['author'] = array(
'#type' => 'textfield',
'#title' => t('Authored by'),
'#size' => 30,
'#maxlength' => 60,
'#autocomplete_path' => 'user/autocomplete',
'#default_value' => $user->name,
'#weight' => -1,
);
$form['admin']['date'] = array(
'#type' => 'textfield',
'#parents' => array(
'date',
),
'#title' => t('Authored on'),
'#size' => 20,
'#maxlength' => 25,
'#default_value' => format_date(time(), 'custom', 'Y-m-d H:i O'),
'#weight' => -1,
);
$form['admin']['status'] = array(
'#type' => 'radios',
'#parents' => array(
'status',
),
'#title' => t('Status'),
'#default_value' => 0,
'#options' => array(
t('Published'),
t('Not published'),
),
'#weight' => -1,
);
}
return $form;
}