You are here

function elfinder_file_directory_url in elFinder file manager 6

Same name and namespace in other branches
  1. 8.2 elfinder.module \elfinder_file_directory_url()
  2. 6.2 elfinder.module \elfinder_file_directory_url()
  3. 7.3 elfinder.module \elfinder_file_directory_url()
  4. 7 elfinder.module \elfinder_file_directory_url()
  5. 7.2 elfinder.module \elfinder_file_directory_url()

files directory url

1 call to elfinder_file_directory_url()
elfinder_connector in ./elfinder.module
File browser to filesystem php connector callback

File

./elfinder.module, line 689

Code

function elfinder_file_directory_url($force_relative = FALSE) {
  global $base_root;
  $fileurl = '';
  if (variable_get('elfinder_settings_filesystem_root', 'system') == 'custom') {
    $fileurl = variable_get('elfinder_settings_filesystem_url_custom', '') . '/';
    if ($fileurl) {
      $fileurl = elfinder_parse_path_tokens($fileurl);
    }
  }
  else {
    if (variable_get('file_default_scheme', 'public') != 'private') {
      $fileurl = url('', array(
        'absolute' => variable_get('elfinder_settings_filesystem_fileurl', 'true') == 'true' ? TRUE : FALSE,
        'language' => '',
      ));
      if (!preg_match("/\\/\$/", $fileurl)) {
        $fileurl .= '/';
      }
      $fileurl .= elfinder_file_directory_path();
    }
    else {
      drupal_set_message(t('Private filesystem support is not implemented yet!'), 'warning');
      $fileurl = url('system/files', array(
        'absolute' => variable_get('elfinder_settings_filesystem_fileurl', 'true') == 'true' ? TRUE : FALSE,
        'language' => '',
      ));
    }
    $fileurl .= '/';
  }

  // Cutting off absolute url prefix
  if ($force_relative) {
    $fileurl = str_replace($base_root, '', $fileurl);
  }
  return $fileurl;
}