Revision 102f8c26
Added by Andreas Kohlbecker almost 7 years ago
modules/cdm_dataportal/settings.php | ||
---|---|---|
172 | 172 |
|
173 | 173 |
define('CDM_PART_DEFINITIONS', 'cdm-part-definitions'); |
174 | 174 |
define('CDM_PART_DEFINITIONS_DEFAULT', serialize( |
175 |
array( |
|
176 |
'TaxonName'=> array( |
|
177 |
'namePart' => array('name' => TRUE), |
|
178 |
'nameAuthorPart' => array('name' => TRUE, 'authors' => TRUE), |
|
179 |
'referencePart' => array('reference' => TRUE, 'microreference' => TRUE), |
|
180 |
'microreferencePart' => array('microreference' => TRUE), |
|
181 |
'secReferencePart' => array('secReference' => TRUE,), |
|
182 |
'referenceYearPart' => array('reference.year' => TRUE), |
|
183 |
'statusPart' => array('status' => TRUE), |
|
184 |
'descriptionPart' => array('description' => TRUE) |
|
185 |
) |
|
186 |
) |
|
187 |
) |
|
188 |
); |
|
189 |
define('CDM_PART_DEFINITIONS_DEFAULT_PRE_480', serialize( |
|
175 | 190 |
array( |
176 | 191 |
'ZoologicalName' => array( |
177 | 192 |
'namePart' => array('name' => TRUE), |
... | ... | |
218 | 233 |
) |
219 | 234 |
) |
220 | 235 |
); |
221 |
define('CDM_PART_DEFINITIONS_DEFAULT_PRE_380', serialize(
|
|
236 |
define('CDM_PART_DEFINITIONS_DEFAULT_PRE_380', serialize( |
|
222 | 237 |
array( |
223 | 238 |
'ZoologicalName' => array( |
224 | 239 |
'namePart' => array('name' => TRUE), |
... | ... | |
1575 | 1590 |
|
1576 | 1591 |
$default_part_definitions = unserialize(CDM_PART_DEFINITIONS_DEFAULT); |
1577 | 1592 |
$default_part_definitions_pre_380_json = json_encode(unserialize(CDM_PART_DEFINITIONS_DEFAULT_PRE_380), JSON_PRETTY_PRINT); |
1593 |
$default_part_definitions_pre_480_json = json_encode(unserialize(CDM_PART_DEFINITIONS_DEFAULT_PRE_480), JSON_PRETTY_PRINT); |
|
1578 | 1594 |
$default_part_definition_json = json_encode($default_part_definitions, JSON_PRETTY_PRINT); |
1579 | 1595 |
$current_part_definition_json = json_encode(variable_get(CDM_PART_DEFINITIONS, $default_part_definitions), JSON_PRETTY_PRINT); |
1580 | 1596 |
|
1581 | 1597 |
$is_custom_part_definition = $default_part_definition_json != $current_part_definition_json; |
1582 | 1598 |
if($default_part_definitions_pre_380_json == $current_part_definition_json){ |
1583 | 1599 |
$which_version_message = '(These are the old default part definition from before EDIT platform release 3.8.0, you may want to reset these by clearing the text area and and submitting the form.)'; |
1600 |
} if($default_part_definitions_pre_480_json == $current_part_definition_json){ |
|
1601 |
$which_version_message = '(These are the old default part definition from before EDIT platform release 4.8.0, you may want to reset these by clearing the text area and and submitting the form.)'; |
|
1584 | 1602 |
} else if($is_custom_part_definition){ |
1585 |
$which_version_message = '(This are custom part definitions, clearing the text area and and submitting the form will reset it to the default)'; |
|
1603 |
if(isset($current_part_definition['ZoologicalName']) || isset($current_part_definition['BotanicalName']) || isset($current_part_definition['#DEFAULT'])){ |
|
1604 |
// see also cdm_dataportal_requirements($phase) |
|
1605 |
$which_version_message = '(This are invalid custom part definitions from before EDIT platform release 4.8.0. Please use the diff function to review the changes and update the definition. |
|
1606 |
Clearing the text area and and submitting the form will reset it to the default)'; |
|
1607 |
} else { |
|
1608 |
$which_version_message = '(This are custom part definitions, clearing the text area and and submitting the form will reset it to the default)'; |
|
1609 |
} |
|
1586 | 1610 |
} else { |
1587 | 1611 |
$which_version_message = '(These are the default part definition.)'; |
1588 | 1612 |
} |
Also available in: Unified diff
ref #6700 updating default name render part definitions and adding status checks