Assuming arguments you want to use are not views arguments or contextual filters, if you wantthem as tokens, you basically need to create a module that implements hook_tokens() and hook_token_info(), as described in the API. I don't think anyone did it already.
Here is how I'd do it:
function yourmodule_token_info() {
$type = array(
'name' => t('GET'),
'description' => t('Tokens related to $_GET superglobal.'),
);
$tokens = array();
foreach($_GET as $key => $val) { //discard $val now
$tokens[$key] = array(
'name' => $key,
'description' => "\$_GET['$key']",
);
}
return array(
'types' => array('get' => $type),
'tokens' => array('get' => $tokens),
);
}
function yourmodule_tokens($type, $tokens, array $data = array(), array $options = array()) {
if($type == 'get') {
$replacements = array();
foreach ($tokens as $name => $original) {
$replacements[$original] = (string)$_GET[$name];
}
return $replacements;
}
}
Of course code above is not production ready, it ignores proper type handling, security issues and so on. It's meant to set you on the right track, but you need to apply your own sanity before deploying it. I take no responsibility for abuse. Read about the reasons it was removed in the first place before you decide to add it back, and be careful to restore only what you really need.
If you want parameters accesible by arg()
instead of $_GET, of course in hook_tokens iterate over them with while
:
function yourmodule_tokens($type, $tokens, array $data = array(), array $options = array()) {
if($type == 'arg') {
$replacements = array();
$i = 0;
while ( NULL !== ($arg = arg($i))) {
$replacements["arg:$i"] = (string)$arg;
}
return $replacements;
}
}
Change yourmodule_token_info()
accordingly.