You are here

function file_aliases_filefield_paths_field_settings in File Aliases 6

Same name and namespace in other branches
  1. 5 file_aliases.module \file_aliases_filefield_paths_field_settings()
  2. 7 modules/filefield_paths.inc \file_aliases_filefield_paths_field_settings()

Implements hook_filefield_paths_field_settings().

File

./file_aliases.module, line 35
Contains core functions for the File Aliases module.

Code

function file_aliases_filefield_paths_field_settings() {
  return array(
    'file_alias' => array(
      'title' => 'File alias',
      'sql' => 'filealias',
      'data' => array(
        'display' => 'file_alias_display',
      ),
      'form' => array(
        'file_alias' => array(
          '#type' => 'textfield',
          '#title' => t('File alias'),
          '#default_value' => (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC ? file_directory_path() : 'system/files') . '/[filefield-onlyname-original].[filefield-extension-original]',
          '#maxlength' => 512,
          '#size' => 128,
        ),
        'file_alias_display' => array(
          '#type' => 'checkbox',
          '#title' => t('Display alias'),
          '#description' => t('If checked, the file alias will be displayed instead of the file') . '.',
          '#default_value' => 0,
          '#weight' => 3,
        ),
      ),
    ),
  );
}