Created
December 20, 2013 14:42
-
-
Save heddn/8055664 to your computer and use it in GitHub Desktop.
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
| /** | |
| * Create a taxonomy term and return the tid. | |
| */ | |
| function asg_estimate_create_taxonomy_term($name, $vid) { | |
| $term = new stdClass(); | |
| $term->name = $name; | |
| $term->vid = $vid; | |
| taxonomy_term_save($term); | |
| return $term->tid; | |
| } | |
| /** | |
| * Implements hook_install(). | |
| */ | |
| function asg_estimate_install() { | |
| $vocabulary = taxonomy_vocabulary_machine_name_load('status'); | |
| $statuses = array( | |
| 'Draft', | |
| 'Submitted', | |
| 'Queried', | |
| 'Cancelled', | |
| 'Complete', | |
| 'Approved', | |
| ); | |
| foreach ($statuses as $status) { | |
| asg_estimate_create_taxonomy_term($status, $vocabulary->vid); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment