You are here

function ife_load_form_ids in Inline Form Errors 6

Same name and namespace in other branches
  1. 6.2 ife.module \ife_load_form_ids()
  2. 7.2 ife.module \ife_load_form_ids()
  3. 7 ife.module \ife_load_form_ids()

Load all form ids from the data base

2 calls to ife_load_form_ids()
ife_form_id_load in ./ife.module
Menu loader function to fetch a form id.
ife_settings_form in ./ife.settings.inc
IFE settings form

File

./ife.module, line 105
Drupal hooks

Code

function ife_load_form_ids() {
  static $ife_form_ids;
  if ($ife_form_ids) {
    $form_ids = $ife_form_ids;
  }
  else {
    $form_ids = cache_get('ife_form_ids', 'cache');
    $form_ids = $form_ids ? $form_ids->data : NULL;
  }
  if (empty($form_ids)) {
    $result = db_query("SELECT form_id, field_types, status, display FROM {ife} ORDER BY form_id");
    $form_ids = array();
    while ($form_id = db_fetch_object($result)) {
      $form_ids[$form_id->form_id] = $form_id;
    }
    cache_set('ife_form_ids', $form_ids, 'cache');
  }
  $ife_form_ids = $form_ids;
  return $ife_form_ids;
}