Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Module to prepopulate season price list with rooms
- */
- /**
- * Implements hook_form_FORM_ID_alter(&$form, &$form_state)
- */
- function mymodule_form_seasonal_prices_node_form_alter(&$form, &$form_state){
- // Load all of the room node ids into an array
- $node_type = "room";
- $result = db_query("SELECT nid FROM node WHERE type = '%s' ", $node_type);
- $nids = array();
- while ($obj = db_fetch_object($result)) {
- $nids[] = $obj->nid;
- }
- // Set the form state to include each room
- foreach($nids as $nid){
- $form_state->field_collection_you_want_to_edit[] = $nid
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement