|
|
@@ -299,14 +299,14 @@ function toggle(source) {
|
|
|
<?php
|
|
|
array_walk($reports, function ($report) use ($url) {
|
|
|
echo "<div class=\"col-sm-2\"><h4>{$report['label']}</h4>";
|
|
|
- $hrefs = array_diff(array_map(function ($path) use ($url, $report) {
|
|
|
- if (!is_file($path)) return null;
|
|
|
+ $hrefs = array_filter(array_map(function ($path) use ($url, $report) {
|
|
|
+ if (!is_file($path)) return false;
|
|
|
$file = basename($path);
|
|
|
if (preg_match($report['regex'], $file, $matches)) $i = " (" . ltrim($matches[1], '0') . ")";
|
|
|
else $i = '';
|
|
|
if ($report['parentDir']) $file = basename(dirname($path)) . "/" . $file;
|
|
|
return "<a href=\"{$url}/{$file}\" target=\"_blank\" class=\"btn btn-primary\">{$report['button']}{$i}</a>";
|
|
|
- }, $report['files']), [null]);
|
|
|
+ }, $report['files']));
|
|
|
if ($hrefs) echo implode('<br/><br/>', $hrefs);
|
|
|
else echo "<h5>Nie znaleziono</h5>";
|
|
|
echo "</div>\n";
|