| 1 |
<?php |
<?php |
| 2 |
// $Id: bandwidth.module,v 1.3 2008/10/30 19:23:36 yrocq Exp $ |
// $Id: bandwidth.module,v 1.4 2008/11/05 18:25:04 yrocq Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Bandwidth Module |
* Bandwidth Module |
| 217 |
} |
} |
| 218 |
|
|
| 219 |
/** |
/** |
| 220 |
* Pluggable Drupal function |
* Define custom_url_rewrite_outbound() if the url_alter.module is not enabled. |
| 221 |
*/ |
*/ |
| 222 |
|
if (!function_exists('custom_url_rewrite_outbound')) { |
| 223 |
|
function custom_url_rewrite_outbound(&$path, &$options, $original_path) { |
| 224 |
|
bandwidth_url_alter_outbound($path, $options, $original_path); |
| 225 |
|
} |
| 226 |
|
} |
| 227 |
|
|
| 228 |
function custom_url_rewrite_outbound(&$path, &$options, $original_path) |
/** |
| 229 |
{ |
* Implement hook_url_alter_outbound(). |
| 230 |
|
*/ |
| 231 |
|
function bandwidth_url_alter_outbound(&$path, &$options, $original_path) { |
| 232 |
// If it is a link to change bandwidth (changeBandwidth argument in the query) |
// If it is a link to change bandwidth (changeBandwidth argument in the query) |
| 233 |
// We alter the link and clear the query |
// We alter the link and clear the query |
| 234 |
if (strstr($options['query'], 'changeBandwidth=')) { |
if (strstr($options['query'], 'changeBandwidth=')) { |