Customizing HTML output for Reports plugin

Looking to add some file information to the HTML output by editing the ouputHTML() function.

The relevant bit is here:

<?php
		while ($files = loop_files_for_item($item)):
		$files = get_current_file();
		foreach($files as $file):
	    	$title = item_file('Dublin Core', 'Title');
	    	$desc = item_file('Dublin Core', 'Description');
			$mime = item_file('MIME Type');
			echo '<br/><strong>'.$title.'</strong> ('.$mime.')<br/>'.$desc.'<br/>';
		endforeach;
		endwhile;
		?>

And here it is in context....

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Omeka Report</title>
<style type="text/css" media="screen">
    body {background: #ccc; padding:0; margin:0;}
    #report {width: 920px; margin: 0 auto; padding: 20px; background:#fff;}
    .item {border-bottom: 1px solid #ccc;}
    table {border-bottom:1px dotted #ccc; width:100%;}
    th, td {vertical-align:top; padding: 10px;}
    th {text-align:right; font-weight:bold; width:100px}
</style>
</head>
<body>
    <div id="report">
        <h1><?php echo $reportName; ?></h1>
        <p>Generated on <?php echo date('Y-m-d H:i:s O') ?></p>
        <p><?php echo $reportDescription; ?></p>
<?php $page = 1;
    while ($items = get_db()->getTable('Item')->findBy($this->_params, 30, $page)):
        foreach ($items as $item) : ?>
            <div class="item" id="item-<?php echo $item->id; ?>">
                <h2>Item <?php echo $item->id; ?></h2>
<?php       $sets = get_db()->getTable('ElementSet')->findByRecordType('Item');
            // Output all the metadata for all the element sets
            foreach($sets as $set) :
                $this->_outputSetElements($item, $set->name);
            endforeach;
            $tags = $item->getTags();
            if (count($tags)): ?>
                <h3>Tags</h3>
                <table class="element-texts" cellpadding="0" cellspacing="0">
                    <tr class="element">
                        <td class="element-value"><?php echo implode($tags, ', '); ?></td>
                    </tr>
                </table>
<?php       endif; ?>
<!-- hacking the output here -->
		<?php
		while ($files = loop_files_for_item($item)):
		$files = get_current_file();
		foreach($files as $file):
	    	$title = item_file('Dublin Core', 'Title');
	    	$desc = item_file('Dublin Core', 'Description');
			$mime = item_file('MIME Type');
			echo '<br/><strong>'.$title.'</strong> ('.$mime.')<br/>'.$desc.'<br/>';
		endforeach;
		endwhile;
		?>
<!-- end hack -->
            </div>
<?php       release_object($item);
        endforeach;
        $page++;
    endwhile; ?>
    </div>
</body>
</html>

Returns errors. I've tried a few other variations with no luck. Anyone want to let me know what I'm doing wrong here?

Can you post the specific errors you're getting?

An immediate problem would seem to be:

$files = get_current_file();

The outer loop_files_for_item loop is already iterating over the files for $item, so you probably don't need that inner for loop at all.

Without any testing, what you want should look more like this:

<?php
while ($file = loop_files_for_item($item)):
    $title = item_file('Dublin Core', 'Title');
    $desc = item_file('Dublin Core', 'Description');
    $mime = item_file('MIME Type');
    echo '<br/><strong>'.$title.'</strong> ('.$mime.')<br/>'.$desc.'<br/>';
endwhile;
?>