/**
  * @covers \PressBooks\Utility\group_exports
  */
 public function test_group_exports()
 {
     $files = \PressBooks\Utility\group_exports();
     $this->assertTrue(is_array($files));
     $files = \PressBooks\Utility\group_exports(__DIR__);
     $this->assertNotContains('.htaccess', $files);
 }
Example #2
0
<div class="export-page">

<div class="export-left">
	<p><input id="pb-export-button" type="button" class="button button-hero button-primary generate" value="<?php 
esc_attr_e('Export Your Book', 'pressbooks');
?>
" /></p>
	<p id="loader"><img src="<?php 
echo PB_PLUGIN_URL;
?>
assets/images/loader.gif" alt="Exporting..." width="128" height="15" /></p>
	<?php 
$c = 0;
// start counter
$files = \PressBooks\Utility\group_exports();
foreach ($files as $date => $exports) {
    // Echo files to screen
    if ($c == 0) {
        ?>
		<h2><?php 
        _e('Latest Export', 'pressbooks');
        ?>
: <?php 
        echo strftime('%B %e, %Y at %l:%M %p', $date);
        ?>
</h2>
		<div class="export-files latest">
	<?php 
    } elseif ($c > 0) {
        ?>