Skip to content

Instantly share code, notes, and snippets.

@dmouse
Last active December 19, 2015 22:49
Show Gist options
  • Select an option

  • Save dmouse/6030177 to your computer and use it in GitHub Desktop.

Select an option

Save dmouse/6030177 to your computer and use it in GitHub Desktop.
Sample to option in drupal node_type_form
function hook_form_node_type_form_alter(&$form, $form_state) {
$form['workflow']['node_options']['#options']['sample'] = t('Sample');
$form['workflow']['node_options']['rotativa']['#description'] = t('Sample enable');
//$form['#validate'][] = 'rotativa_node_type_form_validate';
}
/* Validate if Sample is active*/
function my_node_type_valid($type) {
$options = variable_get("node_options_$type", array());
if (in_array('sample', $options)) {
return TRUE;
}
return FALSE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment