Revision 7df1be04
Added by Andreas Kohlbecker almost 11 years ago
7.x/modules/cdm_dataportal/settings.php | ||
---|---|---|
82 | 82 |
define('DISTRIBUTION_TEXTDATA_DISPLAY_ON_TOP', 'distribution_textdata_on_top'); |
83 | 83 |
define('CDM_DEFAULT_IMAGE_MAXEXTEND', 'cdm_default_image_maxextend'); |
84 | 84 |
define('CDM_DEFAULT_IMAGE_MAXEXTEND_DEFAULT', 184); |
85 |
define('CDM_DEFAULT_REPLACEMENT_IMAGE', 'cdm_default_replacement_image'); |
|
85 | 86 |
|
86 | 87 |
|
87 | 88 |
/** |
... | ... | |
974 | 975 |
$collapsed = FALSE; |
975 | 976 |
$form = array(); |
976 | 977 |
|
978 |
$form['#submit'][] = 'cdm_settings_layout_taxon_submit'; |
|
979 |
|
|
977 | 980 |
$form['cdm_dataportal_show_back_to_search_results'] = array( |
978 | 981 |
'#type' => 'checkbox', |
979 | 982 |
'#title' => t('Show <em>Back to search results</em> link at the taxon site.'), |
... | ... | |
1061 | 1064 |
'#description' => t('The maximum extend in either dimension, width or height, of the profil picture in pixels.') |
1062 | 1065 |
); |
1063 | 1066 |
|
1067 |
$form['taxon_profile']['picture'][CDM_DEFAULT_REPLACEMENT_IMAGE] = array( |
|
1068 |
'#type' => 'managed_file', |
|
1069 |
'#name' => CDM_DEFAULT_REPLACEMENT_IMAGE, |
|
1070 |
'#title' => t('Default image replcement'), |
|
1071 |
'#size' => 40, |
|
1072 |
'#description' => t("This image is shown as replacement if no image of the taxon is available."), |
|
1073 |
'#upload_location' => 'public://' |
|
1074 |
); |
|
1075 |
|
|
1064 | 1076 |
$options = cdm_rankVocabulary_as_option(); |
1065 | 1077 |
array_unshift($options, '-- DISABLED --'); |
1066 | 1078 |
$form['taxon_profile']['picture']['image_hide_rank'] = array( |
... | ... | |
1833 | 1845 |
return $out; |
1834 | 1846 |
} |
1835 | 1847 |
|
1848 |
|
|
1849 |
function cdm_settings_layout_taxon_submit($form, &$form_state){ |
|
1850 |
if (isset($form_state['values'][CDM_DEFAULT_REPLACEMENT_IMAGE])) { |
|
1851 |
$file = file_load($form_state['values'][CDM_DEFAULT_REPLACEMENT_IMAGE]); |
|
1852 |
|
|
1853 |
$file->status = FILE_STATUS_PERMANENT; |
|
1854 |
|
|
1855 |
file_save($file); |
|
1856 |
} |
|
1857 |
} |
|
1858 |
|
|
1836 | 1859 |
/** |
1837 | 1860 |
* Form validation handler for ? |
1838 | 1861 |
* |
Also available in: Unified diff
restoring lost function