You are here

function pay_forms_list in Pay 7

List available payment forms.

Renamed in D7 to avoid conflict with hook_forms().

2 calls to pay_forms_list()
pay_node_admin_node_form_alter in modules/pay_node/includes/pay_node.admin.inc
A form_alter helper for node creation forms.
pay_node_admin_node_type_form_alter in modules/pay_node/includes/pay_node.admin.inc
@todo Please document this function.

File

./pay.module, line 474
Pay module allows for accepting payments using pluggable payment backends.

Code

function pay_forms_list($handler = NULL, $embeddable = NULL, $status = 1) {
  $query = db_select('pay_form', 'pf')
    ->fields('pf');
  if (!is_null($handler)) {
    $query
      ->condition('handler', $handler);
  }
  if (!is_null($status)) {
    $query
      ->condition('status', $status);
  }
  if (!is_null($embeddable)) {
    $query
      ->condition('embeddable', $embeddable);
  }
  $query
    ->orderBy('title');
  $result = $query
    ->execute();
  $forms = array();
  while ($row = $result
    ->fetchObject()) {
    if ($pay_form = pay_form_load($row)) {
      $forms[$row->pfid] = $pay_form;
    }
  }
  return $forms;
}