aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-02 20:59:56 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-02 20:59:56 +0000
commit2820a231076cc640d2de867faeba2e1a3d45a402 (patch)
tree1fd80c05de913fb0c53f38ada6caef36e310d545
parentb314a9a072d301e2e89c4873d76429ba46e9c94a (diff)
downloadelgg-2820a231076cc640d2de867faeba2e1a3d45a402.tar.gz
elgg-2820a231076cc640d2de867faeba2e1a3d45a402.tar.bz2
Refs #2463: Removed some more instances of $CONFIG->url. Added support for elgg_normalize_url to elgg_add_action_tokens_to_url
git-svn-id: http://code.elgg.org/elgg/trunk@7200 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/classes/ElggSite.php2
-rw-r--r--engine/lib/actions.php2
-rw-r--r--engine/lib/elgglib.php6
-rw-r--r--engine/lib/entities.php9
-rw-r--r--engine/lib/navigation.php2
-rw-r--r--engine/lib/views.php2
-rw-r--r--engine/tests/ui/submenu.php2
-rw-r--r--install/ElggInstaller.php6
-rw-r--r--views/default/annotation/generic_comment.php2
-rw-r--r--views/default/annotation/likes.php2
-rw-r--r--views/default/friends/collection.php2
-rw-r--r--views/default/object/default.php2
-rw-r--r--views/default/page_elements/content_header.php6
-rw-r--r--views/default/page_elements/elgg_topbar_logout.php2
14 files changed, 24 insertions, 23 deletions
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php
index 6e73e56a4..febd70be6 100644
--- a/engine/classes/ElggSite.php
+++ b/engine/classes/ElggSite.php
@@ -352,7 +352,7 @@ class ElggSite extends ElggEntity {
}
// always allow index page
- if ($url == $CONFIG->url) {
+ if ($url == elgg_get_site_url($this->guid)) {
return TRUE;
}
diff --git a/engine/lib/actions.php b/engine/lib/actions.php
index fef6004cc..38fdef1ee 100644
--- a/engine/lib/actions.php
+++ b/engine/lib/actions.php
@@ -113,7 +113,7 @@ function action($action, $forwarder = "") {
register_error(sprintf(elgg_echo('actionundefined'), $action));
}
- forward($CONFIG->url . $forwarder);
+ forward($forwarder);
}
/**
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 282b69fce..e45b231d4 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1565,7 +1565,7 @@ function elgg_http_build_url(array $parts, $html_encode = TRUE) {
* @link http://docs.elgg.org/Tutorials/Actions
*/
function elgg_add_action_tokens_to_url($url, $html_encode = TRUE) {
- $components = parse_url($url);
+ $components = parse_url(elgg_normalize_url($url));
if (isset($components['query'])) {
$query = elgg_parse_str($components['query']);
@@ -1680,11 +1680,11 @@ function elgg_http_url_is_identical($url1, $url2, $ignore_params = array('offset
// if the server portion is missing but it starts with / then add the url in.
if (elgg_substr($url1, 0, 1) == '/') {
- $url1 = $CONFIG->url . ltrim($url1, '/');
+ $url1 = elgg_get_site_url() . ltrim($url1, '/');
}
if (elgg_substr($url1, 0, 1) == '/') {
- $url2 = $CONFIG->url . ltrim($url2, '/');
+ $url2 = elgg_get_site_url() . ltrim($url2, '/');
}
// @todo - should probably do something with relative URLs
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 1c8db655b..34dc39de5 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -2097,10 +2097,10 @@ function get_entity_icon_url(ElggEntity $entity, $size = 'medium') {
return $overrideurl;
}
- $url = $CONFIG->url . "_graphics/icons/default/$size.png";
+ $url = "_graphics/icons/default/$size.png";
}
- return $url;
+ return elgg_normalize_url($url);
}
/**
@@ -2137,9 +2137,10 @@ function get_entity_url($entity_guid) {
}
if ($url == "") {
- $url = $CONFIG->url . "pg/view/" . $entity_guid;
+ $url = "pg/view/" . $entity_guid;
}
- return $url;
+
+ return elgg_noramlize_url($url);
}
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php
index beb154f30..fcfc553fd 100644
--- a/engine/lib/navigation.php
+++ b/engine/lib/navigation.php
@@ -196,7 +196,7 @@ function elgg_prepare_submenu($context = 'main', $sort = FALSE) {
$item->href = $child->href;
} else {
// @todo There are no URLs anywhere in this tree.
- $item->href = $CONFIG->url;
+ $item->href = elgg_get_site_url();
}
}
}
diff --git a/engine/lib/views.php b/engine/lib/views.php
index d8564c5e3..82be10118 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -279,7 +279,7 @@ function elgg_view($view, $vars = array(), $bypass = false, $debug = false, $vie
$vars['config'] = $CONFIG;
}
- $vars['url'] = $CONFIG->url;
+ $vars['url'] = elgg_get_site_url();
// Load page owner variables into $vars
if (is_callable('page_owner')) {
diff --git a/engine/tests/ui/submenu.php b/engine/tests/ui/submenu.php
index 745364890..fcf4589e2 100644
--- a/engine/tests/ui/submenu.php
+++ b/engine/tests/ui/submenu.php
@@ -15,7 +15,7 @@
require_once('../../start.php');
-$url = "{$CONFIG->url}engine/tests/ui/submenu.php";
+$url = "engine/tests/ui/submenu.php";
$items = array(
array(
diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php
index 1527572d6..8f7e7eb8f 100644
--- a/install/ElggInstaller.php
+++ b/install/ElggInstaller.php
@@ -659,15 +659,15 @@ class ElggInstaller {
}
if ($this->status['settings'] == FALSE) {
- forward(elgg_get_site_url()."install.php?step=settings");
+ forward("install.php?step=settings");
}
if ($this->status['admin'] == FALSE) {
- forward(elgg_get_site_url()."install.php?step=admin");
+ forward("install.php?step=admin");
}
// everything appears to be set up
- forward(elgg_get_site_url()."install.php?step=complete");
+ forward("install.php?step=complete");
}
/**
diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php
index 464ffb8c5..492c04eab 100644
--- a/views/default/annotation/generic_comment.php
+++ b/views/default/annotation/generic_comment.php
@@ -24,7 +24,7 @@ $owner = get_user($vars['annotation']->owner_guid);
?>
<span class="delete_button">
<?php echo elgg_view("output/confirmlink",array(
- 'href' => elgg_get_site_url() . "action/comments/delete?annotation_id=" . $vars['annotation']->id,
+ 'href' => "action/comments/delete?annotation_id=" . $vars['annotation']->id,
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm')
));
diff --git a/views/default/annotation/likes.php b/views/default/annotation/likes.php
index ecd109978..8b6be9220 100644
--- a/views/default/annotation/likes.php
+++ b/views/default/annotation/likes.php
@@ -23,7 +23,7 @@ $owner = get_user($vars['annotation']->owner_guid);
?>
<div class="entity_metadata"><span class="delete_button">
<?php echo elgg_view("output/confirmlink",array(
- 'href' => elgg_get_site_url() . "action/likes/delete?annotation_id=" . $vars['annotation']->id,
+ 'href' => "action/likes/delete?annotation_id=" . $vars['annotation']->id,
'text' => elgg_echo('remove'),
'confirm' => elgg_echo('deleteconfirm')
));
diff --git a/views/default/friends/collection.php b/views/default/friends/collection.php
index 636d2ab5c..9981dd291 100644
--- a/views/default/friends/collection.php
+++ b/views/default/friends/collection.php
@@ -25,7 +25,7 @@ echo "<li><h2>";
if ($coll->owner_guid == get_loggedin_userid()) {
echo "<div class=\"friends_collections_controls\">";
echo elgg_view('output/confirmlink', array(
- 'href' => elgg_get_site_url() . 'action/friends/deletecollection?collection=' . $coll->id,
+ 'href' => 'action/friends/deletecollection?collection=' . $coll->id,
'class' => 'delete_collection'
));
echo "</div>";
diff --git a/views/default/object/default.php b/views/default/object/default.php
index 6975804c3..0f07996b2 100644
--- a/views/default/object/default.php
+++ b/views/default/object/default.php
@@ -29,7 +29,7 @@ if ($vars['full']) {
$controls = "";
if ($vars['entity']->canEdit()) {
$delete = elgg_view('output/confirm_link', array(
- 'href' => elgg_get_site_url()."action/entities/delete?guid={$vars['entity']->guid}",
+ 'href' => "action/entities/delete?guid={$vars['entity']->guid}",
'text' => elgg_echo('delete')
));
$controls .= " ($delete)";
diff --git a/views/default/page_elements/content_header.php b/views/default/page_elements/content_header.php
index 3704e9a49..37cba4425 100644
--- a/views/default/page_elements/content_header.php
+++ b/views/default/page_elements/content_header.php
@@ -38,17 +38,17 @@ $new_button = '';
$default_tabs = array(
'all' => array(
'title' => elgg_echo('all'),
- 'url' => (isset($vars['all_link'])) ? $vars['all_link'] : elgg_get_site_url()."mod/$type/all.php",
+ 'url' => (isset($vars['all_link'])) ? $vars['all_link'] : "mod/$type/all.php",
'selected' => ($filter_context == 'everyone'),
),
'mine' => array(
'title' => elgg_echo('mine'),
- 'url' => (isset($vars['mine_link'])) ? $vars['mine_link'] : elgg_get_site_url()."pg/$type/$username",
+ 'url' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "pg/$type/$username",
'selected' => ($filter_context == 'mine'),
),
'friend' => array(
'title' => elgg_echo('friends'),
- 'url' => (isset($vars['friend_link'])) ? $vars['friend_link'] : elgg_get_site_url()."pg/$type/$username/friends",
+ 'url' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "pg/$type/$username/friends",
'selected' => ($filter_context == 'friends'),
),
);
diff --git a/views/default/page_elements/elgg_topbar_logout.php b/views/default/page_elements/elgg_topbar_logout.php
index ca3d16707..38a37bc22 100644
--- a/views/default/page_elements/elgg_topbar_logout.php
+++ b/views/default/page_elements/elgg_topbar_logout.php
@@ -7,7 +7,7 @@
echo '<div class="log_out">';
echo elgg_view('output/url', array(
- 'href' => elgg_get_site_url()."action/logout",
+ 'href' => "action/logout",
'text' => elgg_echo('logout'),
'is_action' => TRUE
));