Last active
August 29, 2015 14:06
-
-
Save snowstorm0182/e50c7fe4d9a2f831560b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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