Skip to content

Commit

Permalink
Tweaks and bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Murray-John committed Jan 2, 2011
1 parent 5f5e70b commit f1c6272
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 27 deletions.
4 changes: 2 additions & 2 deletions anthologize.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ function default_export_formats() {

anthologize_register_format_option( 'epub', 'cover', __( 'Cover Image', 'anthologize' ), 'dropdown', $coversArray);


anthologize_register_format_option( 'epub', 'colophon', __( 'Include Anthologize colophon page?', 'anthologize' ), 'checkbox' );
//epub colophon commented out until we get the XSLTs working for it
//anthologize_register_format_option( 'epub', 'colophon', __( 'Include Anthologize colophon page?', 'anthologize' ), 'checkbox' );

// Register HTML

Expand Down
3 changes: 3 additions & 0 deletions includes/class-tei-dom.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class TeiDom {


function __construct($sessionArray, $ops = array()) {
@apply_filters('init');
//the anthologize filter echos content, which clobbers exports
remove_filter('the_content', 'anthologize_filter_post_content');
if(class_exists('Tidy')) {
Expand Down Expand Up @@ -621,6 +622,7 @@ public function sanitizeString($content, $isMultiline = false) {
//TODO: check if this is redundant now that I'm using apply_filters()'
//$content = wpautop($content);
//$content = $this->sanitizeShortCodes($content);

$content = apply_filters('the_content', $content);
if($this->tidy) {
$this->tidy->parseString($content, array(), 'utf8');
Expand Down Expand Up @@ -734,6 +736,7 @@ public function getID($node) {
public function newColophon() {

$colophonNode = $this->dom->createElementNS(TEI, 'div');
$colophonNode->setAttribute('xml:id', 'colophon');
$colophonNode->setAttribute('n', '0');
$colophonNode->setAttribute('type', 'colophon');

Expand Down
Binary file added templates/epub/covers/cover2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions templates/epub/includes/class-epub-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,12 @@ private function localizeLinks() {
foreach($links as $link) {
$guid = $link->getAttribute('href');

$targetGuidNL = $tei->xpath->query("//tei:ident[ . = '$guid']");
$targetGuidNL = $this->tei->xpath->query("//tei:ident[ . = '$guid']");

if($targetGuidNL->length == 0 ) {
//I hate the problem of links and trailing slashes
//if length is zero, see if including the slash produces matches
$targetGuidNL = $tei->xpath->query("//tei:ident[ . = '$guid/']");
$targetGuidNL = $this->tei->xpath->query("//tei:ident[ . = '$guid/']");
}

if($targetGuidNL->length != 0) {
Expand Down
7 changes: 7 additions & 0 deletions templates/epub/tei2html.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
margin-bottom: 2em;
}

div.back
{
page-break-before: always;
}

/* Wordpress styles */

.alignright { float: right }
Expand Down Expand Up @@ -203,6 +208,8 @@
</div>
</div>
</xsl:for-each>


</body>
</html>
</xsl:template>
Expand Down
24 changes: 1 addition & 23 deletions templates/html/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'includeCreatorData' => true, // Include basic data about creators
'includeStructuredCreatorData' => true, //include structured data about creators
'includeOriginalPostData' => true, //include data about the original post (true to use tags and categories and creator data)
'checkImgSrcs' => true, //whether to check availability of image sources
'checkImgSrcs' => false, //whether to check availability of image sources
'linkToEmbeddedObjects' => false,
'indexSubjects' => false,
'indexCategories' => false,
Expand Down Expand Up @@ -125,28 +125,6 @@
}
?>

<div class='anth-index'>
<h1>Author Index</h1>
<?php anth_index('persons'); ?>
<?php while(anth_index_items() ) : ?>
<?php anth_index_item(); ?>
<h3><?php anth_index_the_item_label(); ?></h3>
<?php while(anth_index_item_targets() ): ?>
<?php anth_index_item_target(); ?>
<?php if(anth_index_item_get_the_target('role') == 'originalAuthor'): ?>
<h5><a href="#<?php anth_index_item_the_target('ref') ?>"><?php anth_index_item_the_target(); ?></a></h5>
<?php endif; ?>

<?php endwhile; ?>


<?php endwhile; ?>





</div>


</body>
Expand Down

1 comment on commit f1c6272

@boonebgorges
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Patrick - Not sure if you get email notifications on trac (they're broken for me), but I just opened a ticket related to this commit: http://anthologize.org/trac/ticket/119

Please sign in to comment.