function tripal_create_moddir
2.x tripal_core.DEPRECATED.api.inc | tripal_create_moddir($module_name) |
3.x tripal_core.DEPRECATED.inc | tripal_create_moddir($module_name) |
1.x tripal_core_files.api.inc | 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.
@returns nothing
Parameters
$module_name: the name of the module being installed.
Related topics
12 calls to tripal_create_moddir()
- tripal_analysis_install in tripal_analysis/
tripal_analysis.install - Implementation of hook_install().
- tripal_contact_install in tripal_contact/
tripal_contact.install - Implementation of hook_install().
- tripal_cv_install in tripal_cv/
tripal_cv.install - Implementation of hook_install().
- tripal_db_install in tripal_db/
tripal_db.install - Implementation of hook_install().
- tripal_featuremap_install in tripal_featuremap/
tripal_featuremap.install - Implementation of hook_install().
File
- tripal_core/
api/ tripal_core_files.api.inc, line 34 - The Tripal Files API
Code
function tripal_create_moddir($module_name) {
// 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);
}
}