function entityqueue_get_options in Entityqueue 7
Returns all queues or subqueues in a way which can be used on form options.
Parameters
array $objects: (optional) An array of fully loaded objects to display.
string $object_type: (optional) A string representing what needs to be loaded, queues or subqueues. Defaults to 'subqueue';
Return value
array An array of EntityQueue or EntitySubqueue objects, keyed by name.
1 call to entityqueue_get_options()
- entityqueue_handler_relationship_entityqueue::options_form in includes/
views/ entityqueue_handler_relationship_entityqueue.inc - Default options form that provides the label widget that all fields should have.
File
- ./
entityqueue.module, line 727 - Allows users to collect entities in arbitrarily ordered lists.
Code
function entityqueue_get_options($objects = array(), $object_type = 'subqueue') {
if (empty($objects)) {
switch ($object_type) {
case 'subqueue':
$objects = entityqueue_subqueue_load_multiple();
break;
case 'queue':
default:
$objects = entityqueue_queue_load_multiple();
break;
}
}
$options = array();
foreach ($objects as $object) {
$options[$object->name] = $object->label;
}
return $options;
}