You are here

function _webform_protected_downloads_token_replace in Webform Protected Downloads 6

Same name and namespace in other branches
  1. 7 webform_protected_downloads.module \_webform_protected_downloads_token_replace()

Helper function for token replacement

Parameters

string $string :

object $node :

string $hash :

Return value

string

2 calls to _webform_protected_downloads_token_replace()
webform_protected_downloads_download_page in ./webform_protected_downloads.page.inc
Displays the download page
webform_protected_downloads_send_mail in ./webform_protected_downloads.module
Send mail to the user with a valid hash so that he can access the download page

File

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

Code

function _webform_protected_downloads_token_replace($string, $node, $hash) {
  if (!module_exists('token')) {
    return $string;
  }
  return token_replace_multiple($string, array(
    'webform_protected_downloads' => NULL,
    'global' => NULL,
  ), '[', ']', array(
    'node' => $node,
    'hash' => $hash,
  ));
}