Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove compound bookreader items. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
41 changes: 0 additions & 41 deletions template.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,47 +106,6 @@ function barnard_theme_preprocess_islandora_book_page(&$vars) {
$vars['dl_links'] = _barnard_islandora_dl_links($object, ['JPG']);
}

/**
* Implements hook_preprocess_islandora_compound_prev_next().
*
* This makes the compound navigation block behave in this way:
* the first object inside of me will always be the PARENT object.
* rationale: because compound_objects are a contentType, not a true archival
* object, ever. I simply handle how archival objects get processed.
*
* Allowing anything to be a "compound object" is NOT ADVISED. It is nice
* as an option but is included for capability, most likely.
*
* We'll use a predictable set of classes for our inclusions as they relate to
* the parent and each other.
*
* @TODO some of the variables we kick back are:
* @TODO list vars.
*/
function barnard_theme_preprocess_islandora_compound_prev_next(array &$variables) {
// We always create a compound obj and the first object is the parent obj.
$variables['themed_siblings'][0]['class'][] = 'parent';

// This simply parses the label of the object into their matched parts.
foreach ($variables['themed_siblings'] as $key => &$vars) {
if (preg_match("/(page.(\d{1,3})).*(inclusion.(\d{1,3}))/i", $vars['label'], $matches)) {
$classes = [
'inclusion-object',
"inclusion-page-{$matches[2]}",
"inclusion_page-{$matches[2]}-sequence-{$matches[4]}",
];
$vars['class'] = array_merge($vars['class'], $classes);
$vars['label'] = ucfirst($matches[0]);
$vars['inclusion_page'] = $matches[2];
}

if ($variables['sequence'] > 1 && isset($vars['class'][0]) && $vars['class'][0] === 'active') {
$variables['current_inclusion'] = $vars['inclusion_page'];
$variables['themed_siblings'][0]['return_page'] = $vars['inclusion_page'];
}
}
}

/**
* Implements hook_preprocess_islandora_large_image().
*/
Expand Down