:</option><?php } // end foreach ?> </select> <?php } // end if ?> <input name="author_ID[]" type="hidden" value="<?php echo $author_record->ID; ?> " size="4" readonly> </td><td> <input type="text" name="section_author[]" class="edit_record_link" value="<?php echo htmlspecialchars(build_author_name($author_record)); ?> " size="23" readonly> </td><td> <input type="text" name="section_title[]" value="<?php echo htmlspecialchars($author_record->section_title); ?> " size="27" autocomplete="off" onkeyup="section_start_move(<?php echo $author_counter; ?> , 2);"> </td><td> <input type="text" name="section_start[]" value="<?php echo htmlspecialchars($author_record->section_start > 0 ? $author_record->section_start : ""); ?> " size="2" style="text-align:center;" autocomplete="off" onkeyup="section_start_move(<?php
function output_compilation_titles_and_authors($record, $output_type = "detail", $show_pages = TRUE, $search_words = array()) { global $db; $author_list = array(); $main_author_records = lookup_author($record->ID, FALSE, TRUE); //$hide_main_author_ID = (count($main_author_records) == 1 ? $main_author_records[0]->ID : 0); $hide_main_author_ID = $main_author_records[0]->ID; if (count($author_records = lookup_author($record->ID, TRUE, TRUE))) { $last_section_title = ""; $last_section_start = -1; $last_author_type = 0; $hold_section_start = -1; $output_title = FALSE; $delayed_author_html = ""; foreach ($author_records as $author_record) { $this_section_title = $author_record->section_title; $this_section_start = $author_record->section_start; $this_by_text = $author_record->by_text; if ($hold_section_start == -1) { $last_section_title = $this_section_title; $hold_section_title = $this_section_title; $hold_section_start = $this_section_start; } // end if $this_author_type = $author_record->type; if ($output_title) { $output_pages = $last_section_start - $hold_section_start; ?> <div class="<?php echo $output_type; ?> _compilation_title"><?php echo highlight_search_query($output_title_text, $search_words); if ($show_pages && $author_record->section_start > 0) { ?> <span class="<?php echo $output_type; ?> _compilation_pages">(<?php echo $output_pages == 0 ? "1" : $output_pages; ?> page<?php echo $output_pages > 1 ? "s" : ""; ?> )</span><?php } // end if ?> </div> <?php if ($delayed_author_html != "") { echo $delayed_author_html; $delayed_author_html = ""; } // end if $output_title = FALSE; $hold_section_start = $last_section_start; } // end if if ($this_section_title != $last_section_title) { if (count($author_list) > 0) { $delayed_author_html .= '<div class="' . $output_type . '_compilation_author">' . $last_by_text . ' ' . implode("; ", $author_list) . '</div>'; } // end if $author_list = array(); if ($author_record->ID != $hide_main_author_ID) { $author_list[] = '<a href="' . $db->url_root . '/search.php/author/' . $author_record->ID . '">' . highlight_search_query(build_author_name($author_record), $search_words) . '</a>'; } // end if $output_title_text = $last_section_title; $output_title = TRUE; } else { if ($this_author_type != $last_author_type && $last_author_type != 0) { if (count($author_list) > 0) { $delayed_author_html .= '<div class="' . $output_type . '_compilation_author">' . $last_by_text . ' ' . implode("; ", $author_list) . '</div>'; } // end if $author_list = array(); } // end if if ($author_record->ID != $hide_main_author_ID) { $author_list[] = '<a href="' . $db->url_root . '/search.php/author/' . $author_record->ID . '">' . highlight_search_query(build_author_name($author_record), $search_words) . '</a>'; } // end if } // end if $last_section_start = $this_section_start; $last_section_title = $this_section_title; $last_by_text = $this_by_text; $last_author_type = $this_author_type; } // end foreach if ($output_title) { $output_pages = $last_section_start - $hold_section_start; ?> <div class="<?php echo $output_type; ?> _compilation_title"><?php echo highlight_search_query($output_title_text, $search_words); if ($show_pages && $author_record->section_start > 0) { ?> <span class="<?php echo $output_type; ?> _compilation_pages">(<?php echo $output_pages == 0 ? "1" : $output_pages; ?> page<?php echo $output_pages > 1 ? "s" : ""; ?> )</span><?php } // end if ?> </div> <?php if ($delayed_author_html != "") { echo $delayed_author_html; $delayed_author_html = ""; } // end if $output_title = FALSE; $hold_section_start = $last_section_start; } // end if $output_pages = $record->length - $last_section_start + 1; ?> <div class="<?php echo $output_type; ?> _compilation_title"><?php echo highlight_search_query($this_section_title, $search_words); if ($show_pages && $author_record->section_start > 0) { ?> <span class="<?php echo $output_type; ?> _compilation_pages">(<?php echo $output_pages == 0 ? "1" : $output_pages; ?> page<?php echo $output_pages > 1 ? "s" : ""; ?> )</span><?php } // end if ?> </div> <?php if (count($author_list) > 0) { if ($delayed_author_html != "") { echo $delayed_author_html; } // end if ?> <div class="<?php echo $output_type; ?> _compilation_author"><?php echo $author_record->by_text; ?> <?php echo implode("; ", $author_list); ?> </div> <?php } // end if } // end if }
?> : '');update_author_actions(this);"> </td> <?php } // end if ?> <td valign="top" width="100%"> <a href="<?php echo $db->url_root; ?> /search.php/author/<?php echo $author_record->ID; ?> "><b><?php echo highlight_search_query(build_author_name($author_record, TRUE, FALSE), $search_words); ?> </b></a> </td> </tr> </table> </div> <?php } // end while ?> <div id="author_tools" class="search_actions"><button onclick="merge_selected_authors();">Merge Selected Authors</button></div> </div> <?php if ($db->is_librarian_account) { ?>
$this_by_text = $author_record->by_text; $this_author_type = $author_record->type; if ($this_author_type != $last_author_type && $last_author_type != 0) { ?> <div class="detail_authors"><?php echo $last_by_text; ?> <?php echo implode("; ", $author_list); ?> </div> <?php $author_list = array(); } // end if $author_list[] = '<a href="' . $db->url_root . '/search.php/author/' . $author_record->ID . '">' . build_author_name($author_record) . '</a>'; $last_by_text = $this_by_text; $last_author_type = $this_author_type; } // end foreach } // end if if (count($author_list) > 0) { ?> <div class="detail_authors"><?php echo $author_record->by_text; ?> <?php echo implode("; ", $author_list); ?> </div>