function getFixedFormat($result, $full_dir)
{
$util = new Util();
if (!empty($result)) {
$structure = '
<table class="table table-bordered table-striped" style="font-size:12px;">
<thead>
<tr>
<th>File name</th>
<th>Permissions</th>
<th>Owner</th>
<th>Group</th>
<th>Size</th>
<th>Last modified</th>
</tr>
</thead>
<tbody>
';
for ($i = 1; $i < count($result); $i++) {
$structure .= '<tr>';
$result_array = explode(" ", preg_replace('[\\s+]', ' ', $result[$i]));
$structure .= '<td>';
if ($result_array[0][0] == 'd') {
$structure .= '<img title="Dir" src="data:image/gif;base64,' . $util->images('directory') . '" /> <a href="#" onclick="doFormPost(\'browser\',\'execute\',\'' . $full_dir . '/' . $result_array[8] . '\');">' . htmlentities(wordwrap($result_array[8], 50, " ", TRUE), ENT_QUOTES) . '</a>';
} else {
$structure .= '<img title="Dir" src="data:image/gif;base64,' . $util->images('file') . '" /> <a href="#" onclick="doFormPost(\'browser\',\'show\',\'' . $full_dir . '/' . $result_array[8] . '\');">' . htmlentities(wordwrap($result_array[8], 50, " ", TRUE), ENT_QUOTES) . '</a>';
}
$structure .= '</td>';
$structure .= '<td>' . htmlentities(wordwrap($result_array[0], 50, " ", TRUE), ENT_QUOTES) . '</td>';
$structure .= '<td>' . htmlentities(wordwrap($result_array[2], 50, " ", TRUE), ENT_QUOTES) . '</td>';
$structure .= '<td>' . htmlentities(wordwrap($result_array[3], 50, " ", TRUE), ENT_QUOTES) . '</td>';
$structure .= '<td>' . htmlentities(wordwrap($result_array[4], 50, " ", TRUE), ENT_QUOTES) . '</td>';
$structure .= '<td>' . htmlentities(wordwrap($result_array[5], 50, " ", TRUE), ENT_QUOTES) . ' ' . htmlentities(wordwrap($result_array[6], 50, " ", TRUE), ENT_QUOTES) . ' ' . htmlentities(wordwrap($result_array[7], 50, " ", TRUE), ENT_QUOTES) . '</td>';
$structure .= '</tr>';
}
$structure .= '
</tbody>
</table>
';
return $structure;
}
}