Beispiel #1
0
$path_items_filtred = array();
foreach ($path_items as $folder) {
    if ($folder == ".." || $folder == "." || $folder == "") {
        continue;
    }
    $current_path .= $folder . "/";
    $path_items_filtred[$current_path] = htmlspecialchars($folder);
}
$smarty->assign("path_items_filtred", $path_items_filtred);
$smarty->assign("search", $search);
// file table
$smarty->assign("getOrderLink_KEY_NAME", getOrderLink(File_List::KEY_NAME));
$smarty->assign("getOrderLink_KEY_DATE", getOrderLink(File_List::KEY_DATE));
$smarty->assign("getOrderLink_KEY_SIZE", getOrderLink(File_List::KEY_SIZE));
// Iterate over the items in this folder
if ($file_list->getLastItemCount()) {
    $real_path = str_replace("../", "", $path);
    $xx = 0;
    $listing_filtred = array();
    foreach ($listing as $item) {
        $xx++;
        $datas = array();
        if ($item[File_List::KEY_TYPE] == File_List::TYPE_FILE) {
            // si c'est un fichier
            if (!in_array($item[File_List::KEY_EXT], $extensionsAuthorized)) {
                continue;
            }
            if ($search != "" && strpos(strtolower($item[File_List::KEY_NAME]), strtolower($search)) === false) {
                continue;
            }
        }
Beispiel #2
0
// Get started looking for files
$file_list = new File_List();
$listing = $file_list->getListing($path, File_List::TYPE_BOTH, $order_by, $order_dir, $start, $limit);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<meta http-equiv="Content-Type" content="text/html;">
    	<title>File List Class Full Example</title>
        <link rel="stylesheet" type="text/css" href="outils/filelistclass/stylex.css" />
    </head>
    <body>

        <?php 
// Show a messge when there are no items in the top folder
if (!$file_list->getLastItemCount() && !$file_list->getLastError() && !$path) {
    ?>
            <p align="center">This example requires that you add files to the subdirectory "files". Once you've done that, they will be listed<br />
            below and you can play with the example. Add more than <?php 
    print $limit;
    ?>
 files to see some pagination.</p>
            <?php 
}
?>

        <!-- Begin Breadcrumbs -->
        <div id="breadcrumbs">
            <?php 
if ($file_list->getLastError()) {
    print '<p align="center" style="color:#f00;">' . $file_list->getLastError() . '</p>';