function tripal_get_files_dir
2.x tripal_core.files.api.inc | tripal_get_files_dir($module_name = FALSE) |
3.x tripal.files.api.inc | tripal_get_files_dir($module_name = FALSE) |
Retrieves 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
5 calls to tripal_get_files_dir()
- chado_get_organism_image_url in tripal_chado/
api/ modules/ tripal_chado.organism.api.inc - Return the path for the organism image.
- tripal_chado_migrate_organism_images in tripal_chado/
includes/ tripal_chado.migrate.inc - Migrate images for Tripal v2 organism content
- tripal_create_files_dir in tripal/
api/ tripal.files.api.inc - Creates a directory for a module in the Drupal's public files directory.
- tripal_file_directory_path in legacy/
tripal_core/ api/ tripal_core.DEPRECATED.inc - @todo Remove. This was not in Tripal 1.x.
- tripal_get_moddir in legacy/
tripal_core/ api/ tripal_core.DEPRECATED.inc
2 string references to 'tripal_get_files_dir'
- tripal_file_directory_path in legacy/
tripal_core/ api/ tripal_core.DEPRECATED.inc - @todo Remove. This was not in Tripal 1.x.
- tripal_get_moddir in legacy/
tripal_core/ api/ tripal_core.DEPRECATED.inc
File
- tripal/
api/ tripal.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;
}