You are here

function fe_paths_get_settings in File Entity Paths 7.2

Get all variables defined by File Entity Paths

Parameters

$file_type: The bundle name of file, eg. image, application

Return value

$settings An array of variables.If $file_type set, only returns the settings of $file_type

2 calls to fe_paths_get_settings()
fe_paths_add_global_settings_to_config in ./fe_paths.module
Add default configuration based on file to the end of the loaded configurations.
fe_paths_admin_form in ./fe_paths.admin.inc
Form builder for default configuration admin form.

File

./fe_paths.module, line 758
Contains functions for the File Entity Paths module.

Code

function fe_paths_get_settings($file_type = NULL) {
  $settings =& drupal_static(__FUNCTION__);
  if (!isset($settings[$file_type])) {
    $entity_info = entity_get_info('file');
    foreach ($entity_info['bundles'] as $type => $bundle_info) {
      $defaults = array();
      if (isset($bundle_info['admin'])) {
        foreach (file_get_stream_wrappers() as $scheme => $wrapper) {
          $defaults[$scheme] = array(
            'path' => '',
            'filename' => '[file:name-only-original].[file:extension-original]',
          );
        }
        $settings[$type] = variable_get("fep_{$type}", $defaults);
      }
    }
  }
  return is_null($file_type) ? $settings : $settings[$file_type];
}