}
// always allow index page
- if ($url == $CONFIG->url) {
+ if ($url == elgg_get_site_url($this->guid)) {
return TRUE;
}
register_error(sprintf(elgg_echo('actionundefined'), $action));
}
- forward($CONFIG->url . $forwarder);
+ forward($forwarder);
}
/**
* @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']);
// 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
return $overrideurl;
}
- $url = $CONFIG->url . "_graphics/icons/default/$size.png";
+ $url = "_graphics/icons/default/$size.png";
}
- return $url;
+ return elgg_normalize_url($url);
}
/**
}
if ($url == "") {
- $url = $CONFIG->url . "pg/view/" . $entity_guid;
+ $url = "pg/view/" . $entity_guid;
}
- return $url;
+
+ return elgg_noramlize_url($url);
}
$item->href = $child->href;
} else {
// @todo There are no URLs anywhere in this tree.
- $item->href = $CONFIG->url;
+ $item->href = elgg_get_site_url();
}
}
}
$vars['config'] = $CONFIG;
}
- $vars['url'] = $CONFIG->url;
+ $vars['url'] = elgg_get_site_url();
// Load page owner variables into $vars
if (is_callable('page_owner')) {
require_once('../../start.php');
-$url = "{$CONFIG->url}engine/tests/ui/submenu.php";
+$url = "engine/tests/ui/submenu.php";
$items = array(
array(
}
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");
}
/**
?>
<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')
));
?>
<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')
));
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>";
$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)";
$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'),
),
);
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
));