Closed (duplicate)
Project:
Insert
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 May 2011 at 20:11 UTC
Updated:
12 May 2011 at 13:08 UTC
In D7, I needed the absolute insert,
I modify function insert_create_url($uri) like this, there is perhaps problème with stream wrapper, but in my case it works.
function insert_create_url($uri) {
// This variable has no configuration location. It may be set by placing
// $conf['insert_absolute_paths'] = FALSE;
// in the site settings.php file, or by manually running variable_set().
// For reasons why this might not do what you want and why there's no UI
// see http://drupal.org/node/640352.
$absolute = variable_get('insert_absolute_paths', TRUE);
// TODO: Rewrite this function to support relative paths? Tricky because
// not all stream wrappers support local paths at all.
if ($absolute) {
return file_create_url($uri);
}
else {
return str_replace($GLOBALS['base_url'],'',file_create_url($uri));
}
}
Comments
Comment #1
nico059 commentedCorrection in the text
In D7, I needed the absolute insert,In D7, I needed the "relative" insert,
Comment #2
quicksketchThanks for the update, but could you please merge with the existing issue at #1149910: drupal7 insert relative paths and mark this one duplicate?
Comment #3
nico059 commentedI close this post, it's duplicate.
I copied the code in http://drupal.org/node/1149910