You are here

function webform_protected_downloads_set_configuration in Webform Protected Downloads 7

Same name and namespace in other branches
  1. 6 webform_protected_downloads.module \webform_protected_downloads_set_configuration()

Set the configuration for the given node

Parameters

int $nid:

int $cid:

string $subject:

string $body:

string $text_access:

string $text_noaccess:

Return value

void

2 calls to webform_protected_downloads_set_configuration()
webform_protected_downloads_configuration_form_submit in ./webform_protected_downloads.form.inc
Implementation of hook_submit().
webform_protected_downloads_node_insert in ./webform_protected_downloads.module
Implementation of hook_insert().

File

./webform_protected_downloads.module, line 731
This file contains hook declarations and functions for the Webform Protected Downloads module.

Code

function webform_protected_downloads_set_configuration($nid, $args) {
  $configuration = array(
    'nid' => $nid,
    'mail_field_cid' => $args['mail_field_cid'],
    'mail_from' => $args['mail_from'],
    'mail_subject' => $args['mail_subject'],
    'mail_body' => $args['mail_body'],
    'access_type' => $args['access_type'],
    'expiration_download' => $args['expiration_download'],
    'expiration_session' => $args['expiration_session'],
    'retroactive' => $args['retroactive'],
    'redirect' => $args['redirect'],
    'text_download_access' => $args['text_download_access'],
    'text_download_access_format' => $args['text_download_access_format'],
    'text_download_noaccess' => $args['text_download_noaccess'],
    'text_download_noaccess_format' => $args['text_download_noaccess_format'],
  );
  drupal_write_record('wpd_node_configuration', $configuration, webform_protected_downloads_get_configuration($nid) ? array(
    'nid',
  ) : array());
}