I'm trying to wrap my head around the best way to handle rewriting links that need to be passed to our proxy server (similar to this comment - http://drupal.org/node/535612#comment-2273552). My train of thought is as follows. First, I should probably create a content type (let's just call it "proxy_link") that has very basic information (title, link url, etc). When this link is displayed, my understanding is that custom_url_rewrite_outbound would be the way to handle manipulating/rewriting the link right? This would be invoked for every link though, including those that are not "proxy_link" content types.
I am slightly confused as to how I would handle rewriting the link and incorporating a token that is updated semi-regularly in the back-end (which is easy). For simplicity's sake, here is what I am envisioning:
function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
global $user;
$secret_token = 'xed45frteds' // Hard-coded for this example; would normally come from a database query
// If this is a proxy_link content type
if (........) {
// QUESTION: How can I determine the content type and/or see if this needs the proxy change?
$resource_url = ??; // How can I pull this value from the proxy_link content type?
$path = 'http://ezproxy.example-library.edu/login?url=' . $resource_url . '&token=' . $secret_token;
}
}