Skip to content

Instantly share code, notes, and snippets.

@snowstorm0182
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snowstorm0182/e50c7fe4d9a2f831560b to your computer and use it in GitHub Desktop.
Save snowstorm0182/e50c7fe4d9a2f831560b to your computer and use it in GitHub Desktop.
<?php
/**
* Implements hook_rules_action_info()
* @see rules_core_modules()
*/
function mymodule_data_action_info() {
$return['mymodule_get_entityform_types_action'] = array(
'label' => t('Get entityform types'),
'provides' => array(
'entityform_types' => array(
'type' => 'unknown',
'label' => t('Entityform types'),
),
),
'group' => t('Data'),
'base' => 'mymodule_get_entityform_types',
);
return $return;
}
/**
* Action: Get entityform types
*/
function mymodule_get_entityform_types() {
$query = db_select('entityform_type', 'eft');
$query->fields('eft',array('id'));
$form_types = array();
$result = $query->execute();
foreach ($result as $record) {
$form_types[]= entityform_load($record->id);
}
return array('entityform_types' => $form_types);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment