Move implementations of hook_form_FORM_ID_alter() to farm_data_field.module.

This commit is contained in:
Michael Stenta 2019-04-10 23:59:19 -04:00
parent d53d67d047
commit b0cac436a4
2 changed files with 22 additions and 22 deletions

View File

@ -93,3 +93,25 @@ function farm_data_field_farm_fields_dynamic_instances() {
// Return the array of field instance definitions.
return $field_instances;
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function farm_data_field_form_log_form_alter(&$form, &$form_state, $form_id) {
// Hide the data field in log forms.
if (!empty($form['field_farm_data'])) {
$form['field_farm_data']['#access'] = FALSE;
}
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function farm_data_field_form_farm_asset_form_alter(&$form, &$form_state, $form_id) {
// Hide the data field in asset forms.
if (!empty($form['field_farm_data'])) {
$form['field_farm_data']['#access'] = FALSE;
}
}

View File

@ -32,28 +32,6 @@ function farm_fields_farm_access_perms($role) {
return $perms;
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function farm_fields_form_log_form_alter(&$form, &$form_state, $form_id) {
// Hide the data field in log forms.
if (!empty($form['field_farm_data'])) {
$form['field_farm_data']['#access'] = FALSE;
}
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function farm_fields_form_farm_asset_form_alter(&$form, &$form_state, $form_id) {
// Hide the data field in asset forms.
if (!empty($form['field_farm_data'])) {
$form['field_farm_data']['#access'] = FALSE;
}
}
/**
* Implements hook_field_default_field_instances_alter().
*/