foreach (scandir("workshops") as $workshop) { if (!file_exists("workshops/{$workshop}/title.txt")) { continue; } if (!file_exists("workshops/{$workshop}/editors.txt")) { continue; } $contents = array(); $contents['shortname'] = $workshop; $contents['title'] = rtrim(file_get_contents("workshops/{$workshop}/title.txt")); $contents['editors'] = trim_all(file("workshops/{$workshop}/editors.txt")); $papers = array(); foreach (scandir("workshops/{$workshop}/papers") as $paper) { if (!file_exists("workshops/{$workshop}/papers/{$paper}/title.txt")) { continue; } if (!file_exists("workshops/{$workshop}/papers/{$paper}/authors.txt")) { continue; } $paper_info = array(); $paper_info['number'] = $paper; $paper_info['title'] = rtrim(file_get_contents("workshops/{$workshop}/papers/{$paper}/title.txt")); $paper_info['authors'] = trim_all(file("workshops/{$workshop}/papers/{$paper}/authors.txt")); $paper_info['length'] = pdf_length("workshops/{$workshop}/papers/{$paper}/paper.pdf"); $papers[$paper] = $paper_info; } $contents['papers'] = $papers; $workshops[$workshop] = $contents; } $current_page = 1; $current_paper = 1;
} ?> <hr> <br><br><br> <div class="CEURTOC"> <h2> Table of Contents </h2> <ul> <li id="frontmatter"> <a href="frontmatter.pdf">Front Matter</a><br><br> <span class="CEURPAGES"><?php echo get_pages_string(pdf_length("{$target}/frontmatter.pdf")); ?> </span> </li> </ul> <?php foreach ($workshops as $workshop) { skip_preface_pages(); ?> <h3><a href="<?php echo $workshop['shortname']; ?> _proc.pdf"><span class="CEURSESSION"><?php
?> \bigskip \subsection*{<?php echo $workshop['title']; ?> } \tocTitle{Preface}{<?php echo $current_page + ($current_page % 2 == 0 ? 3 : 2); ?> } \tocAuthors{<?php echo format_names($workshop['editors']); ?> } <?php $current_page += ($current_page % 2 == 0 ? 1 : 0) + pdf_length('workshops/' . $workshop['shortname'] . '/frontmatter/preface-stamped.pdf'); foreach ($workshop['papers'] as $paper) { ?> \tocTitle{<?php echo $paper['title']; ?> }{<?php echo $current_page; ?> } \tocAuthors{<?php echo format_names($paper['authors']); ?> } <?php $current_paper++;