function tripal_get_files_dir

2.x tripal_core.files.api.inc tripal_get_files_dir($module_name = FALSE)

Retreives the Drupal relative directory for a Tripal module.

Each Tripal module has a unique data directory which was created using the tripal_create_files_dir function during installation. This function retrieves the directory path.

@returns The path within the Drupal installation where the data directory resides

Parameters

$module_name: (Optional) The name of the module.

Related topics

4 calls to tripal_get_files_dir()
tripal_create_files_dir in tripal_core/api/tripal_core.files.api.inc
Creates a directory for a module in the Drupal's public files directory.
tripal_file_directory_path in tripal_core/api/tripal_core.DEPRECATED.api.inc
@todo Remove. This was not in Tripal 1.x.
tripal_get_moddir in tripal_core/api/tripal_core.DEPRECATED.api.inc
tripal_get_organism_image_url in tripal_organism/api/tripal_organism.api.inc
Return the path for the organism image.
2 string references to 'tripal_get_files_dir'
tripal_file_directory_path in tripal_core/api/tripal_core.DEPRECATED.api.inc
@todo Remove. This was not in Tripal 1.x.
tripal_get_moddir in tripal_core/api/tripal_core.DEPRECATED.api.inc

File

tripal_core/api/tripal_core.files.api.inc, line 82
Provides an application programming interface (API) for managing files within the Tripal data directory structure.

Code

function tripal_get_files_dir($module_name = FALSE) {

  // Build the directory path.
  $data_dir = variable_get('file_public_path', conf_path() . '/files/tripal');

  // If a module name is provided then append the module directory.
  if ($module_name) {
    $data_dir .= "/$module_name";

    // Make sure the directory exists.
    tripal_create_files_dir($module_name);

  }

  return $data_dir;
}