function commerce_reorder_preprocess_link in Commerce Reorder 7
Same name and namespace in other branches
- 7.2 commerce_reorder.module \commerce_reorder_preprocess_link()
Dynamically add a CSRF-protection token to the reorder-links usin a preprocess function.
See also
http://drupal.org/node/755584 for a reference to CSRF tokens for menus.
File
- ./
commerce_reorder.module, line 56 - Allows users to create a new order from their order history.
Code
function commerce_reorder_preprocess_link(&$variables) {
if (strpos($variables['path'], 'admin/commerce/orders/') === 0 && substr($variables['path'], -8) == '/reorder') {
$path = explode('/', $variables['path']);
$variables['options']['query']['token'] = drupal_get_token('commerce_reorder:' . $path[3]);
}
}