예제 #1
0
/**
 * Links the files and wraps them into a <li> list items.
 *
 * @param $files An array of files to link and wrap
 * @param $descs Array containing descriptions of each file
 * @param $args The arguments with which the function was called
 *        see ad_parseFunDefinition
 * @return String containing all the linked files
 */
function ad__filesListTable($files, $args)
{
    $args = $args['old'];
    $outStr = '<table style="' . $args[2] . '">';
    $length = sizeof($files);
    for ($i = 0; $i < $length; $i++) {
        $outStr .= sprintf('<tr><td style="%s">%s</td><td style="%s">%s</td></tr>', $args[3], linkToFile($files[$i]), $args[4], $files[$i]['description']);
    }
    $outStr .= "</table>";
    return $outStr;
}
예제 #2
0
/**
 * Generates a html table given the input files.
 *
 * @param $files List of file arrays as returned by ad_listFiles
 * @param $args Associative array with the arguments -> ad_parseArgDef
 * @return HTML
 */
function ad_makeTable($files, $args)
{
    $length = sizeof($files);
    for ($i = 0; $i < $length; $i++) {
        $str .= sprintf('<tr><td class="ad_td_left" style="padding-left:5px;">%s</td><td class="ad_td_right" style="font-style:italic;">%s</td></tr>', linkToFile($files[$i]), $files[$i]['description']);
    }
    $openTag = 'table';
    if (!empty($args['title'])) {
        $str = sprintf('<tr><th colspan="2">%s</td></tr>', $args['title']) . $str;
    }
    $outStr .= sprintf("<%s %s>%s</%s>", $args['wrap'], $args['wrap_attributes'], $str, $args['wrap']);
    return $outStr;
}
예제 #3
0
            switch ($col) {
                case 'size':
                    $table .= '<td>' . formatBytes($file[$col]) . '</td>';
                    break;
                case 'mtime':
                case 'ctime':
                    $table .= '<td>' . ($file[$col] ? date($date_format, $file[$col]) : '') . '</td>';
                    break;
                case 'mode':
                    $table .= '<td>' . base_convert($file[$col], 10, 8) . '</td>';
                    break;
                case 'state':
                    $table .= '<td>' . stateFormat($file[$col]) . '</td>';
                    break;
                case 'path':
                    $table .= '<td>' . ($download ? linkToFile($file[$col]) : $file[$col]) . '</td>';
                    break;
                default:
                    $table .= '<td>' . $file[$col] . '</td>';
                    break;
            }
        }
        $table .= '</tr>';
    }
    $table .= '</tbody>';
} else {
    $table .= '<tbody>
	<tr>
		<td colspan="' . count($table_head) . '">
			<p>No filemap found. Please click <a href="?' . buildUrlQuery(array('scan' => true, 'hashcompare' => ''), true) . '" title="click for scan">"Scan"</a></p>
		</td>