You are here

function commerce_invoice_pdf_rules_action_info in Commerce Invoice 7.2

Implements hook_rules_action_info().

File

modules/pdf/commerce_invoice_pdf.rules.inc, line 35
Rules integration for the Commerce Invoice PDF module.

Code

function commerce_invoice_pdf_rules_action_info() {
  $actions = array();
  $actions['commerce_invoice_pdf_create'] = array(
    'base' => 'commerce_invoice_pdf_action_create',
    'label' => t('Create a PDF'),
    'parameter' => [
      'invoice' => [
        'type' => 'commerce_invoice',
        'label' => t('Invoice'),
      ],
      'recreate' => [
        'type' => 'boolean',
        'label' => t('Recreate existing'),
        'description' => t('Recreate (replace) the file if it already exists.'),
        'default value' => 1,
      ],
    ],
    'group' => t('Commerce Invoice'),
  );
  if (module_exists('advancedqueue')) {
    $actions['commerce_invoice_pdf_create']['parameter']['queue'] = [
      'type' => 'boolean',
      'label' => t('Use Advanced Queue'),
      'description' => t('Do not create PDF immediately. Instead, add the task to Advanced Queue.'),
      'default value' => 1,
      'optional' => TRUE,
    ];
  }
  return $actions;
}