You are here

party_hat.devel_generate.inc in Party 8.2

Same filename and directory in other branches
  1. 7 modules/party_hat/party_hat.devel_generate.inc

Party hat developer tools

File

modules/party_hat/party_hat.devel_generate.inc
View source
<?php

/**
 * @file 
 * Party hat developer tools
 */
function party_hat_devel_generate($object, $field, $instance, $bundle) {
  if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
    return devel_generate_multiple('_party_hat_devel_generate', $object, $field, $instance, $bundle);
  }
  else {
    return _party_hat_devel_generate($object, $field, $instance, $bundle);
  }
}
function _party_hat_devel_generate($object, $field, $instance, $bundle) {
  $object_field = array();

  // Get All hats
  $hats = party_hat_get_all_hats();
  $id = array_rand($hats);
  $hat = $hats[$id];
  $object_field['hat_name'] = $hat->name;
  return $object_field;
}

Functions

Namesort descending Description
party_hat_devel_generate @file Party hat developer tools
_party_hat_devel_generate