You are here

function _simpleads_hide_field in SimpleAds 7

Helper function. Hide field from simpleads node form if some other module disabled, but not uninstalled yet. See hook_simpleads_form().

Parameters

string $field_name:

1 call to _simpleads_hide_field()
simpleads_campaigns_disable in modules/simpleads_campaigns/simpleads_campaigns.install
Implements hook_enable().

File

includes/simpleads.helper.inc, line 448
SimpleAds Helper functions.

Code

function _simpleads_hide_field($field_name) {
  $fields_to_hide = variable_get('simpleads_form_alter', array());
  $new_array = array();
  if (count($fields_to_hide)) {
    foreach ($fields_to_hide as $field) {
      $new_array[$field] = $field;
    }
  }
  $new_array[$field_name] = $field_name;
  variable_set('simpleads_form_alter', $new_array);
}