function certificate_form_alter in Certificate 6.2
Same name and namespace in other branches
- 8.3 certificate.module \certificate_form_alter()
- 6 certificate.module \certificate_form_alter()
- 7.3 certificate.module \certificate_form_alter()
- 7.2 certificate.module \certificate_form_alter()
- 3.x certificate.module \certificate_form_alter()
Implements hook_form_alter for course nodes.
File
- ./
certificate.module, line 284 - Certificate module.
Code
function certificate_form_alter(&$form, &$form_state, $form_id) {
if (isset($form['#node'])) {
if (certificate_node_is_certifiable($form['#node']) && strpos($form_id, '_node_form') !== FALSE) {
// Add per-node certificate settings.
module_load_include('inc', 'certificate', 'certificate.admin');
certificate_alter_node_form($form, $form_state);
}
}
if ($form_id == 'node_type_form') {
$form['certificate'] = array(
'#type' => 'fieldset',
'#title' => 'Certificate settings',
'#collapsed' => TRUE,
'#collapsible' => TRUE,
);
$form['certificate']['certificate_certifiable'] = array(
'#type' => 'checkbox',
'#title' => 'Award certificate',
'#description' => t('Make this content type certificate-enabled. Certificate mapping selections will show on the node form.'),
'#default_value' => variable_get("certificate_certifiable_{$form['#node_type']->type}", 0),
);
}
}