-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added hook_TYPE_alter() and make all entity fields available in form …
…element list.
- Loading branch information
Showing
2 changed files
with
53 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Hooks provided by the rules_forms module. | ||
* | ||
* @ingroup xmlsitemap | ||
*/ | ||
|
||
/** | ||
* @addtogroup hooks | ||
* @{ | ||
*/ | ||
|
||
|
||
/** | ||
* Implements hook_TYPE_alter(). | ||
* | ||
* Alter the current form_info data of rules_forms. | ||
*/ | ||
function hook_rules_forms_form_info_alter(&$form_info, $context) { | ||
|
||
$module = 'foo_module'; | ||
foreach ($context['fields'] as $key => $field) { | ||
if ($field['widget']['module'] == $module) { | ||
$form_info['elements'][$module . ':' . $module] = array( | ||
'type' => $module, | ||
'label' => $field['label'], | ||
); | ||
} | ||
} | ||
|
||
} | ||
|
||
/** | ||
* @} End of "addtogroup hooks". | ||
*/ |
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