* @return string URL of blog.
*/
function blog_url_handler($entity) {
- global $CONFIG;
-
if (!$user = get_entity($entity->owner_guid)) {
// default to a standard view if no owner.
return FALSE;
$friendly_title = elgg_get_friendly_title($entity->title);
- $url = "{$CONFIG->site->url}pg/blog/{$user->username}/read/{$entity->getGUID()}/$friendly_title";
- return $url;
+ return "pg/blog/{$user->username}/read/{$entity->guid}/$friendly_title";
}
/**
if (!($params['owner'] instanceof ElggGroup)) {
$return_value[] = array(
'text' => elgg_echo('blog'),
- 'href' => "{$CONFIG->url}pg/blog/{$params['owner']->username}/read",
+ 'href' => "pg/blog/{$params['owner']->username}/read",
);
}
}
// add a delete button if editing
- $delete_url = elgg_get_site_url()."action/blog/delete?guid={$blog->getGUID()}";
+ $delete_url = "action/blog/delete?guid={$blog->getGUID()}";
$delete_link = elgg_view('output/confirmlink', array(
'href' => $delete_url,
'text' => elgg_echo('delete'),
echo elgg_view('input/form', array(
'internalid' => 'blog_post_edit',
'internalname' => 'blog_post',
- 'action' => elgg_get_site_url()."action/blog/save",
+ 'action' => "action/blog/save",
'body' => $form_body
));
if ($revisions) {
echo '<ul class="blog_revisions">';
- $load_base_url = elgg_get_site_url()."pg/blog/{$owner->username}/edit/{$blog->getGUID()}/";
+ $load_base_url = "pg/blog/{$owner->username}/edit/{$blog->getGUID()}/";
foreach ($revisions as $revision) {
$time = elgg_view_friendly_time($revision->time_created);
$n = count($revisions);
echo '<ul class="blog_revisions">';
- $load_base_url = elgg_get_site_url()."pg/blog/{$owner->username}/edit/{$blog->getGUID()}/";
+ $load_base_url = "pg/blog/{$owner->username}/edit/{$blog->getGUID()}/";
// show the "published revision"
if ($blog->status == 'published') {
$edit_url = elgg_get_site_url()."pg/blog/{$owner->username}/edit/{$blog->getGUID()}/";
$edit_link = "<span class='entity_edit'><a href=\"$edit_url\">" . elgg_echo('edit') . '</a></span>';
- $delete_url = elgg_get_site_url()."action/blog/delete?guid={$blog->getGUID()}";
+ $delete_url = "action/blog/delete?guid={$blog->getGUID()}";
$delete_link = "<span class='delete_button'>" . elgg_view('output/confirmlink', array(
'href' => $delete_url,
'text' => elgg_echo('delete'),
$header .= elgg_view("page_elements/content_header", array(
'context' => $context,
'type' => 'bookmarks',
- 'all_link' => "{$CONFIG->url}pg/bookmarks/",
- 'new_link' => "{$CONFIG->url}pg/bookmarks/{$owner_name}/add"
+ 'all_link' => "pg/bookmarks/",
+ 'new_link' => "pg/bookmarks/{$owner_name}/add"
));
}
}else{
$header .= elgg_view("page_elements/content_header", array(
'context' => $context,
'type' => 'bookmarks',
- 'all_link' => "{$CONFIG->url}pg/bookmarks/",
- 'new_link' => "{$CONFIG->url}pg/bookmarks/{$owner_name}/add"
+ 'all_link' => "pg/bookmarks/",
+ 'new_link' => "pg/bookmarks/{$owner_name}/add"
));
}
global $CONFIG;
$title = $entity->title;
$title = elgg_get_friendly_title($title);
- return $CONFIG->url . "pg/bookmarks/" . $entity->getOwnerEntity()->username . "/read/" . $entity->getGUID() . "/" . $title;
+ return "pg/bookmarks/" . $entity->getOwnerEntity()->username . "/read/" . $entity->getGUID() . "/" . $title;
}
/**
$return_value[] = array(
'text' => elgg_echo('bookmarks'),
- 'href' => "{$CONFIG->url}pg/bookmarks/{$params['owner']->username}",
+ 'href' => "pg/bookmarks/{$params['owner']->username}",
);
return $return_value;
//delete
if($vars['entity']->canEdit()){
$delete .= "<span class='delete_button'>" . elgg_view('output/confirmlink',array(
- 'href' => elgg_get_site_url() . "action/bookmarks/delete?bookmark_guid=" . $vars['entity']->guid,
+ 'href' => "action/bookmarks/delete?bookmark_guid=" . $vars['entity']->guid,
'text' => elgg_echo("delete"),
'confirm' => elgg_echo("bookmarks:delete:confirm"),
)) . "</span>";
*/
$form_body = elgg_view('input/submit', array('value' => elgg_echo('diagnostics:download')));
- echo elgg_view('input/form', array('body' => $form_body, 'action' => $CONFIG->url . "action/diagnostics/download"));
+ echo elgg_view('input/form', array('body' => $form_body, 'action' => "action/diagnostics/download"));
?>
\ No newline at end of file
* @return string File URL
*/
function file_url($entity) {
-
- global $CONFIG;
$title = $entity->title;
$title = elgg_get_friendly_title($title);
- return $CONFIG->url . "pg/file/" . $entity->getOwnerEntity()->username . "/read/" . $entity->getGUID() . "/" . $title;
+ return "pg/file/" . $entity->getOwnerEntity()->username . "/read/" . $entity->getGUID() . "/" . $title;
}
// Make sure test_init is called on initialisation
echo "<a href=\"".elgg_get_site_url()."mod/file/edit.php?file_guid={$file->getGUID()}\">" . elgg_echo('edit') . "</a> ";
echo elgg_view('output/confirmlink',array(
- 'href' => elgg_get_site_url() . "action/file/delete?file=" . $file->getGUID(),
+ 'href' => "action/file/delete?file=" . $file->getGUID(),
'text' => elgg_echo("delete"),
'confirm' => elgg_echo("file:delete:confirm"),
'is_action' => true,
<?php
echo elgg_view('output/confirmlink',array(
- 'href' => elgg_get_site_url() . "action/file/delete?file=" . $file->getGUID(),
+ 'href' => "action/file/delete?file=" . $file->getGUID(),
'text' => elgg_echo("delete"),
'confirm' => elgg_echo("file:delete:confirm"),
'is_action' => true,
add_entity_relationship($group->guid, 'invited', $user->guid);
// Send email
- $url = "{$CONFIG->url}pg/groups/invited?user_guid={$user->guid}&group_guid={$group->guid}";
+ $url = elgg_get_site_url()."pg/groups/invited?user_guid={$user->guid}&group_guid={$group->guid}";
if (notify_user($user->getGUID(), $group->owner_guid,
sprintf(elgg_echo('groups:invite:subject'), $user->name, $group->name),
sprintf(elgg_echo('groups:invite:body'), $user->name, $logged_in_user->name, $group->name, $url),
{
// Closed group, request membership
system_message(elgg_echo('groups:privategroup'));
- forward(elgg_add_action_tokens_to_url($CONFIG->url . "action/groups/joinrequest?user_guid=$user_guid&group_guid=$group_guid", FALSE));
+ forward(elgg_add_action_tokens_to_url("action/groups/joinrequest?user_guid=$user_guid&group_guid=$group_guid", FALSE));
exit;
}
}
$title = sprintf(elgg_echo("groups:all"), elgg_get_page_owner()->name);
if(isloggedin()){
- $area1 .= elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'groups', 'new_link' => "{$CONFIG->url}pg/groups/new"));
+ $area1 .= elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'groups', 'new_link' => "pg/groups/new"));
}
$area1 .= elgg_view("groups/group_sort_menu", array("count" => $group_count, "filter" => $filter)) . $objects;
$body = elgg_view_layout('one_column_with_sidebar', $area1, $area2);
$title = elgg_echo("groups:owned");
// Get objects
- $area1 = elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'groups', 'new_link' => "{$CONFIG->url}pg/groups/new"));
+ $area1 = elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'groups', 'new_link' => "pg/groups/new"));
set_context('search');
$objects = elgg_list_entities(array('types' => 'group', 'owner_guid' => elgg_get_page_owner_guid(), 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE));
} else $title = elgg_echo("groups:owned");
// Get objects
- $area2 = elgg_view('page_elements/content_header', array('context' => "mine", 'type' => 'groups', 'new_link' => "{$CONFIG->url}pg/groups/new"));
+ $area2 = elgg_view('page_elements/content_header', array('context' => "mine", 'type' => 'groups', 'new_link' => "pg/groups/new"));
set_context('search');
// offset is grabbed in the list_entities_from_relationship() function
* @return string File URL
*/
function groups_url($entity) {
-
- global $CONFIG;
-
$title = elgg_get_friendly_title($entity->name);
- return $CONFIG->url . "pg/groups/{$entity->guid}/$title/";
+ return "pg/groups/{$entity->guid}/$title/";
}
function groups_groupforumtopic_url($entity) {
-
- global $CONFIG;
- return $CONFIG->url . 'mod/groups/topicposts.php?topic='. $entity->guid .'&group_guid=' . $entity->container_guid;
-
+ return 'mod/groups/topicposts.php?topic='. $entity->guid .'&group_guid=' . $entity->container_guid;
}
/**
$filehandler->setFilename("groups/" . $entity->guid . $size . ".jpg");
if ($filehandler->exists()) {
- $url = $CONFIG->url . "pg/groupicon/{$entity->guid}/$size/$icontime.jpg";
+ $url = elgg_get_site_url() . "pg/groupicon/{$entity->guid}/$size/$icontime.jpg";
return $url;
}
function group_topicpost_url($annotation) {
if ($parent = get_entity($annotation->entity_guid)) {
global $CONFIG;
- return elgg_get_site_url() . 'mod/groups/topicposts.php?topic='.$parent->guid.'&group_guid='.$parent->container_guid.'#' . $annotation->id;
+ return 'mod/groups/topicposts.php?topic='.$parent->guid.'&group_guid='.$parent->container_guid.'#' . $annotation->id;
}
}
if ($params['owner'] instanceof ElggGroup && $group_owner->forum_enable != 'no') {
$return_value[] = array(
'text' => elgg_echo('groups:forum'),
- 'href' => "{$CONFIG->url}pg/groups/forum/{$params['owner']->getGUID()}"
+ 'href' => "pg/groups/forum/{$params['owner']->getGUID()}"
);
}
return $return_value;
if ($params['owner'] instanceof ElggGroup) {
$return_value[] = array(
'text' => elgg_echo('Activity'),
- 'href' => "{$CONFIG->url}pg/groups/activity/{$params['owner']->getGUID()}"
+ 'href' => "pg/groups/activity/{$params['owner']->getGUID()}"
);
}
return $return_value;
if (groups_can_edit_discussion($vars['entity'], elgg_get_page_owner()->owner_guid)) {\r
echo "<div class='entity_metadata'>";\r
echo "<span class='delete_button'>".elgg_view("output/confirmlink",array(\r
- 'href' => elgg_get_site_url() . "action/groups/deletepost?post=" . $vars['entity']->id . "&topic=" . get_input('topic') . "&group=" . get_input('group_guid'),\r
+ 'href' => "action/groups/deletepost?post=" . $vars['entity']->id . "&topic=" . get_input('topic') . "&group=" . get_input('group_guid'),\r
'text' => elgg_echo('delete'),\r
'confirm' => elgg_echo('deleteconfirm')\r
))."</span>";\r
<a href="<?php echo $url; ?>" class="submit_button"><?php echo elgg_echo('accept'); ?></a>
<?php
echo str_replace('<a', '<a class="action_button disabled" ', elgg_view('output/confirmlink',array(
- 'href' => elgg_get_site_url() . "action/groups/killinvitation?user_guid={$user->getGUID()}&group_guid={$group->getGUID()}",
+ 'href' => "action/groups/killinvitation?user_guid={$user->getGUID()}&group_guid={$group->getGUID()}",
'confirm' => elgg_echo('groups:invite:remove:check'),
'text' => elgg_echo('delete'),
)));
<a href="<?php echo $url; ?>" class="submit_button"><?php echo elgg_echo('accept'); ?></a>
<?php
echo str_replace('<a', '<a class="action_button disabled" ', elgg_view('output/confirmlink',array(
- 'href' => elgg_get_site_url() . 'action/groups/killrequest?user_guid='.$request->guid.'&group_guid=' . $vars['entity']->guid,
+ 'href' => 'action/groups/killrequest?user_guid='.$request->guid.'&group_guid=' . $vars['entity']->guid,
'confirm' => elgg_echo('groups:joinrequest:remove:check'),
'text' => elgg_echo('delete'),
)));
// display the delete link to those allowed to delete
$info .= "<div class='entity_metadata'>";
$info .= '<span class="entity_edit">' . elgg_view("output/url", array(
- 'href' => elgg_get_site_url() . "mod/groups/edittopic.php?group={$vars['entity']->container_guid}&topic={$vars['entity']->guid}",
+ 'href' => "mod/groups/edittopic.php?group={$vars['entity']->container_guid}&topic={$vars['entity']->guid}",
'text' => elgg_echo('edit'),
));
$info .= '</span>';
// display the delete link to those allowed to delete
$info .= '<span class="delete_button">' . elgg_view("output/confirmlink", array(
- 'href' => elgg_get_site_url() . "action/groups/deletetopic?topic=" . $vars['entity']->guid . "&group=" . $vars['entity']->container_guid,
+ 'href' => "action/groups/deletetopic?topic=" . $vars['entity']->guid . "&group=" . $vars['entity']->container_guid,
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
));