123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
-
- function tripal_file_directory_path() {
- return variable_get('file_public_path', conf_path() . '/files/tripal');
- }
- function tripal_create_moddir($module_name) {
-
- $data_dir = tripal_file_directory_path() . "/$module_name";
- if (!file_prepare_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);
- }
- }
- function tripal_create_mod_subdir($module_name, $path) {
-
- tripal_create_moddir($module_name);
-
-
- $sub_dir = tripal_file_directory_path() . $module_name . $path;
- if (!file_prepare_directory($sub_dir, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS)) {
- $message = "Cannot create directory $sub_dir. ";
- drupal_set_message(check_plain(t($message)), 'error');
- watchdog('tripal_core', $message, array(), WATCHDOG_ERROR);
- }
- }
- function tripal_get_moddir($module_name) {
- $data_dir = tripal_file_directory_path() . "/$module_name";
- return $data_dir;
- }
|