You are here

function simpleads_form_alter in SimpleAds 7

Implements hook_form_alter().

2 string references to 'simpleads_form_alter'
_simpleads_hide_field in includes/simpleads.helper.inc
Helper function. Hide field from simpleads node form if some other module disabled, but not uninstalled yet. See hook_simpleads_form().
_simpleads_show_field in includes/simpleads.helper.inc
Helper function. Show field in simpleads node form if other module is enabled. See hook_simpleads_form().

File

./simpleads.module, line 473

Code

function simpleads_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'simpleads_node_form') {

    // Hide fields. See simpleads.helper.inc file
    $fields_to_hide = variable_get('simpleads_form_alter', array());
    if (count($fields_to_hide)) {
      foreach ($fields_to_hide as $field) {
        unset($form[$field]);
      }
    }
  }
}