You are here

function payment_page_payment_method_add_select_controller_access in Payment 7

Menu access callback for payment_page_payment_method_add_select_controller().

Return value

boolean TRUE if there is at least one payment method controller the current user has permission to create payment methods with.

1 string reference to 'payment_page_payment_method_add_select_controller_access'
payment_menu in ./payment.module
Implements hook_menu().

File

./payment.ui.inc, line 270
The Payment user interface.

Code

function payment_page_payment_method_add_select_controller_access() {
  $controllers = payment_method_controller_load_multiple();
  unset($controllers['PaymentMethodControllerUnavailable']);
  foreach ($controllers as $controller) {
    $payment_method = new PaymentMethod(array(
      'controller' => $controller,
    ));
    if (payment_method_access('create', $payment_method)) {
      return TRUE;
    }
  }
  return FALSE;
}