<?php
// prepare data
$email = sfConfig::get('app_contact_email');
$emailAt = str_replace('@', '[at]', sfConfig::get('app_contact_email'));
?>
<script type="text/javascript">
//<![CDATA[
$(function(){
SyntaxHighlighter.all();
});
//]]>
</script>
<div class="fl">
<h3 class="pageDesc"><?php echo get_response_meta('description') ?></h3>
<div class="sources">
<?php foreach ($sourceFiles as $file): ?>
<h3><?php echo $file ?></h3>
<?php
// for SyntaxHighlighter
$ext = substr(strrchr($file, '.'), 1);
$ext = (in_array($ext, array('php', 'js', 'yml', 'sql', 'css', 'png')) ? $ext : 'plain');
$htmlScript = strstr($file, 'templates') ? 'true' : 'false';
?>
<div class="bottom">
<?php if ('png' == $ext): ?>
<div class="clear10"></div>
<img src="<?php echo $file ?>" alt="<?php basename($file) ?>" />
<?php else: ?>
<?php
// get content of the file and prepare it for output
$fileContent = file_get_contents(sfConfig::get('sf_root_dir').$file);
$fileContent = htmlspecialchars(str_replace($email, $emailAt, $fileContent));
?>
<pre class="brush: <?php echo $ext ?>; html-script: <?php echo $htmlScript ?>; gutter: false; auto-links: false;">
<?php echo $fileContent ?>
</pre>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
</div>