Tripal v1.0 (6.x-1.0)
|
Functions | |
tripal_create_moddir ($module_name) | |
tripal_get_moddir ($module_name) |
Provides an application programming interface (API) for managing files within the Tripal data directory structure.
tripal_create_moddir | ( | $ | module_name | ) |
This function is typically used in the '.install' file for a Tripal module Each module should call this function during installation to create the module data directory which is sites/default/files/tripal/[module_name] for default Drupal settings. This directory can then be used by the module for storing files.
$module_name | the name of the module being installed. |
Definition at line 34 of file tripal_core_files.api.inc.
{ // make the data directory for this module $data_dir = file_directory_path() . "/tripal/$module_name"; if (!file_check_directory($data_dir, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS)) { $message = "Cannot create directory $data_dir. This module may not ". "behave correctly without this directory. Please create ". "the directory manually or fix the problem and reinstall."; drupal_set_message(check_plain(t($message)), 'error'); watchdog('tripal_core', $message, array(), WATCHDOG_ERROR); } }
tripal_get_moddir | ( | $ | module_name | ) |
Each Tripal module has a unique data directory which was creatd using the tripal_create_moddir function during installation. This function retrieves the directory path.
$module_name | The name of the module |
Definition at line 60 of file tripal_core_files.api.inc.
{ $data_dir = file_directory_path() . "/tripal/$module_name"; return $data_dir; }