function cl in Context 5
Custom l wrapper for links that need to leave all group contexts
TODO: Like context_prefix_goto(), this function needs to allow the selective dropping/adding of contexts.
1 call to cl()
- theme_context_links in context_prefix/
context_prefix.module - Like theme_links, but handles context warping. theme_links couldn't believe it.
File
- context_prefix/
context_prefix.module, line 654
Code
function cl($text, $path, $attributes = array(), $query = NULL, $fragment = NULL, $absolute = FALSE, $html = FALSE, $dropcontext = FALSE) {
global $base_url;
clswitch('set', $dropcontext);
if (!$dropcontext && $path == '<front>') {
$path = context_prefix_url_rewrite('alias', '', '');
}
// Handle domains -- need to force domain onto the path and push through as absolute url
if ($dropcontext) {
$absolute = TRUE;
if ($path == '<front>') {
$path = variable_get('site_frontpage', 'node');
}
if ($domain = variable_get('context_prefix_base_domain', '')) {
$path = $domain . '/' . $path;
// REPLACE BASE_URL with the hub domain.
}
}
$l = l($text, $path, $attributes, $query, $fragment, $absolute, $html);
clswitch('reset');
return $l;
}