diff options
author | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-20 11:04:57 +0000 |
---|---|---|
committer | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-20 11:04:57 +0000 |
commit | 81ce05a964142f77539b11926d4638b085201daf (patch) | |
tree | 3f1a16ff965468232f8297818dd5552ced29b47c /engine/lib | |
parent | 68d0553cc7bee69a859e5be2fad99362d5b8b917 (diff) | |
download | elgg-81ce05a964142f77539b11926d4638b085201daf.tar.gz elgg-81ce05a964142f77539b11926d4638b085201daf.tar.bz2 |
Marcus Povey <marcus@dushka.co.uk>
* Introducing: current_page_url()
git-svn-id: https://code.elgg.org/elgg/trunk@654 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/elgglib.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 9005cf010..7e785ce07 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -38,6 +38,30 @@ return false;
}
+ + /** + * Return the current page URL. + */ + function current_page_url() + { + global $CONFIG; + + $url = parse_url($CONFIG->wwwroot); + + $page = $url['scheme'] . "://"; + + // user/pass + if ($url['user']) $page .= $url['user']; + if ($url['pass']) $page .= ":".$url['pass']; + if (($url['user']) || $url['pass']) $page .="@"; + + $page .= $url['host']; + $page = trim($page, "/"); $page.="/"; + + $page .= $_SERVER['REQUEST_URI']; + + return $page; + } /**
* Templating
|