mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-29 06:25:18 -04:00
Refactor PHP. Switch to explicit string literals where possible.
This commit is contained in:
parent
cb9b8c6244
commit
d07850b6ef
2 changed files with 23 additions and 23 deletions
|
@ -33,36 +33,36 @@ class Fallback {
|
|||
$items = $folder->get_content($cache);
|
||||
uasort($items, ['Item', 'cmp']);
|
||||
|
||||
$html = "<table>";
|
||||
$html = '<table>';
|
||||
|
||||
$html .= "<tr>";
|
||||
$html .= "<th class='fb-i'></th>";
|
||||
$html .= "<th class='fb-n'><span>Name</span></th>";
|
||||
$html .= "<th class='fb-d'><span>Last modified</span></th>";
|
||||
$html .= "<th class='fb-s'><span>Size</span></th>";
|
||||
$html .= "</tr>";
|
||||
$html .= '<tr>';
|
||||
$html .= '<th class="fb-i"></th>';
|
||||
$html .= '<th class="fb-n"><span>Name</span></th>';
|
||||
$html .= '<th class="fb-d"><span>Last modified</span></th>';
|
||||
$html .= '<th class="fb-s"><span>Size</span></th>';
|
||||
$html .= '</tr>';
|
||||
|
||||
if ($folder->get_parent($cache)) {
|
||||
$html .= "<tr>";
|
||||
$html .= "<td class='fb-i'><img src='${app_href}client/images/fallback/folder-parent.png' alt='folder-parent'/></td>";
|
||||
$html .= "<td class='fb-n'><a href='..'>Parent Directory</a></td>";
|
||||
$html .= "<td class='fb-d'></td>";
|
||||
$html .= "<td class='fb-s'></td>";
|
||||
$html .= "</tr>";
|
||||
$html .= '<tr>';
|
||||
$html .= '<td class="fb-i"><img src="' . $app_href . 'client/images/fallback/folder-parent.png" alt="folder-parent"/></td>';
|
||||
$html .= '<td class="fb-n"><a href="..">Parent Directory</a></td>';
|
||||
$html .= '<td class="fb-d"></td>';
|
||||
$html .= '<td class="fb-s"></td>';
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
||||
foreach ($items as $item) {
|
||||
$type = $item->is_folder ? 'folder' : 'file';
|
||||
|
||||
$html .= "<tr>";
|
||||
$html .= "<td class='fb-i'><img src='${app_href}client/images/fallback/${type}.png' alt='${type}'/></td>";
|
||||
$html .= "<td class='fb-n'><a href='" . $item->href . "'>" . basename($item->path) . "</a></td>";
|
||||
$html .= "<td class='fb-d'>" . date('Y-m-d H:i', $item->date) . "</td>";
|
||||
$html .= "<td class='fb-s'>" . ($item->size !== null ? intval($item->size / 1000) . ' KB' : '' ) . "</td>";
|
||||
$html .= "</tr>";
|
||||
$html .= '<tr>';
|
||||
$html .= '<td class="fb-i"><img src="' . $app_href . 'client/images/fallback/' . $type . '.png" alt="' . $type . '"/></td>';
|
||||
$html .= '<td class="fb-n"><a href="' . $item->href . '">' . basename($item->path) . '</a></td>';
|
||||
$html .= '<td class="fb-d">' . date('Y-m-d H:i', $item->date) . '</td>';
|
||||
$html .= '<td class="fb-s">' . ($item->size !== null ? intval($item->size / 1000) . ' KB' : '' ) . '</td>';
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
||||
$html .= "</table>";
|
||||
$html .= '</table>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
- var app_href = "<?= APP_HREF; ?>"
|
||||
- var fallback = "<?= FALLBACK; ?>"
|
||||
- var app_href = '<?= APP_HREF; ?>'
|
||||
- var fallback = '<?= FALLBACK; ?>'
|
||||
|
||||
<?php header("Content-type: text/html;charset=utf-8"); ?>
|
||||
<?php header('Content-type: text/html;charset=utf-8'); ?>
|
||||
doctype html
|
||||
<!--[if lt IE 10]><html class="no-js no-browser" lang="en"><![endif]-->
|
||||
<!--[if gt IE 9]><!--><html class="no-js browser" lang="en"><!--<![endif]-->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue