Last active
December 19, 2015 22:49
-
-
Save dmouse/6030177 to your computer and use it in GitHub Desktop.
Sample to option in drupal node_type_form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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