Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ In `charlie`, we have three logical containers:

Do note that the code tries not to make any assumptions about the numbering of boxes or folders. Folders could either be numbered sequentially across boxes (in which case specifying a range of folders could make sense when specifying a range of boxes) or specific to a box. Additionally, pluralization of types is largely ignored.

### Q. What does the EAD caching feature do?

A. When enabled, the EAD HTML caching will perform the XSLT transform of the EAD to HTML and then cache the resulting HTML to a temporary file, for later reuse. This file will be written into Drupal's Temporary directory, and the last modification time will be used to gauge whether the cache expiration has been exceeded. If Islandora Solr Search is enabled, Drupal's cron wil pre-cache any EADs.

## Maintainers/Sponsors
Current maintainers:

Expand Down
22 changes: 22 additions & 0 deletions includes/admin.form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ function islandora_manuscript_admin_settings_form(array $form, array &$form_stat
'#default_value' => variable_get('islandora_manuscript_metadata_display', FALSE),
),
),
'islandora_manuscript_ead_caching' => array(
'#type' => 'textfield',
'#title' => t('Cache HTML rendering of EAD'),
'#description' => t("The length of time to cache the HTML rendering of EAD, e.g. \"+90 minutes\"."),
'#default_value' => variable_get('islandora_manuscript_ead_caching', ''),
'#element_validate' => array('islandora_manuscript_validate_strtotime'),
'#size' => 30,
),
);

// Solr field containing the parent book PID.
Expand Down Expand Up @@ -96,6 +104,20 @@ function islandora_manuscript_admin_settings_form(array $form, array &$form_stat
return system_settings_form($form);
}

/**
* Check if the form element is parseable by strtotime
*
* @param array $element
* The element to check.
* @param array $form_state
* The Drupal form state.
*/
function islandora_manuscript_validate_strtotime($element, &$form_state) {
if (!empty($element['#value']) && (!is_numeric(strtotime($element['#value'])) || strtotime($element['#value']) < 0)) {
form_error($element, t('The "!name" option must contain a valid value. You may either leave the text field empty or enter a string like "+30 minutes", "+4 hours", or "+1 week 2 days 4 hours 2 seconds".', array('!name' => t($element['#title']))));
}
}

/**
* Check if the required resources are enabled.
*
Expand Down
Loading