Mercurial > hg > rr-repo
view sites/all/modules/references/node_reference/node_reference.devel_generate.inc @ 11:b0ee71395280
deleted .DS_Store files
author | danieleb <danielebarchiesi@me.com> |
---|---|
date | Mon, 28 Oct 2013 16:12:13 +0000 |
parents | ce11bbd8f642 |
children |
line wrap: on
line source
<?php // $Id: nodereference.devel_generate.inc,v 1.1 2010/01/28 21:06:42 weitzman Exp $ function node_reference_devel_generate($object, $field, $instance, $bundle) { if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) { return devel_generate_multiple('_node_reference_devel_generate', $object, $field, $instance, $bundle); } else { return _node_reference_devel_generate($object, $field, $instance, $bundle); } } function _node_reference_devel_generate($object, $field, $instance, $bundle) { $object_field = array(); $allowed_values = node_reference_potential_references($field); // unset($allowed_values[0]); if (!empty($allowed_values)) { // Just pick one of the specified allowed values. $object_field['nid'] = array_rand($allowed_values); } return $object_field; }