Commit fd24ca01 authored by Nigel McNie's avatar Nigel McNie
Browse files

Added a method for building the url for a block editing page. Used as a base...

Added a method for building the url for a block editing page. Used as a base for pagination urls, and as a target for canceled configuration forms
parent 0b6eaa44
......@@ -1126,6 +1126,21 @@ class View {
return display_name($user);
}
}
/**
* Makes a URL for a view block editing page
*/
public static function make_base_url() {
static $allowed_keys = array('id', 'change', 'c', 'new');
$baseurl = '?';
foreach (array_merge($_POST, $_GET) as $key => $value) {
if (in_array($key, $allowed_keys) || preg_match('/^action_.*_x$/', $key)/* || preg_match('/^cb_\d+_[a-z_]+_o$/', $key)*/) {
$baseurl .= hsc($key) . '=' . hsc($value) . '&';
}
}
$baseurl = substr($baseurl, 0, -5);
return $baseurl;
}
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment