/** * Affiche la liste des fichiers sur index.php * @param $treestructure L'array contenant la hiérarchie de fichiers * @param $filter Le filtre à utiliser (all ou video) * @param $editmode Prendre en compte l'editmode dans l'affichage * @param $father Un paramètre récursif qui permet de connaître le(s) parent(s) d'un dossier */ function print_tree_structure($treestructure, $editmode = FALSE, $father = "") { global $lang; if (empty($treestructure)) { echo '<div style="margin-bottom:5px;" class="onefile" id="div-' . htmlspecialchars($file) . '">'; echo $lang[LOCAL_LANG]['empty_dir']; echo '</div>'; return; } foreach ($treestructure as $key => $file) { // Si on est sur un dossier if (is_array($file)) { $fullkey = $key; $key = addslashes(basename($key)); echo '<div class="onedir">'; if ($editmode) { echo '<input name="Files[]" id="Files" type="checkbox" value="' . $father . htmlspecialchars($key) . '" onclick="CheckLikes(this);" />'; } echo ' <img src="ressources/' . showLastAddFolder($fullkey) . '" class="pointerLink imgfolder" onclick="showhidedir(\'' . $key . '\'); return false;" /> <span class="pointerLink" onclick="showhidedir(\'' . $key . '\'); return false;">' . stripslashes($key) . '</span></div> <div id="' . stripslashes($key) . '" class="dirInList" style="display:none;"> '; print_tree_structure($file, $editmode, $father . htmlspecialchars($key) . "/"); echo '</div>'; } else { $pathInfo = pathinfo($file); echo '<div style="margin-bottom:5px;" class="onefile" id="div-' . htmlspecialchars($file) . '">'; // La checkbox de l'editmode if ($editmode) { echo '<input name="Files[]" id="Files" type="checkbox" value="' . htmlspecialchars($file) . '"/>'; } // Affichage des images à gauche du titre (Direct Download + Watch) echo '<a href="' . DOWNLOAD_LINK . $file . '" download="' . $pathInfo['basename'] . '">'; echo '<img src="ressources/download.png" title="Download this file" /> '; echo '</a>'; echo '<a href="watch.php?file=' . urlencode($file) . '">'; echo '<img src="' . get_file_icon($file) . '" title="Stream or download this file" /> '; echo '</a>'; showLastAdd($file); if (SEEN_MODE_ENABLE && file_exists("data/" . $pathInfo['basename'])) { // Affichage du titre (soulignement si marqué comme vu) echo SEEN_SPAN; echo basename(htmlspecialchars($file)); echo '</span>'; } else { echo basename(htmlspecialchars($file)); } // Création de l'infobulle echo '<a href="#" class="tooltip"> (?) <span> ' . $lang[LOCAL_LANG]['size'] . ' : ' . getFilesize($file) . '<br/> ' . $lang[LOCAL_LANG]['last_update'] . ' : ' . date("d F Y, H:i", filemtime($file)) . '<br/> ' . $lang[LOCAL_LANG]['last_access'] . ' : ' . date("d F Y, H:i", fileatime($file)) . '<br/> </span> </a>'; echo '</div>'; } } }
echo lang('TICKET_file_list'); ?> :</strong></small></center> </div> <div class="col-md-9"> <table class="table table-hover"> <tbody> <?php foreach ($res1 as $r) { ?> <tr> <td style="width:20px;"><small><?php echo get_file_icon($r['file_hash']); ?> </small></td> <td><small><a href='<?php echo $CONF['hostname']; ?> sys/download.php?<?php echo $r['file_hash']; ?> '><?php echo $r['original_name']; ?> </a></small></td> <td><small><?php echo round($r['file_size'] / (1024 * 1024), 2); ?>
<?php } ?> <a title="<?php _e('Direct link'); ?> " href="<?php echo ROOT_URL . (!empty($p) ? '/' . $p : '') . '/' . $f . '/'; ?> " target="_blank"><i class="icon-chain"></i></a> </td></tr> <?php flush(); } foreach ($files as $f) { $img = get_file_icon($path . '/' . $f); $modif = date("d.m.y H:i", filemtime($path . '/' . $f)); $filesize_raw = filesize($path . '/' . $f); $filesize = get_filesize($filesize_raw); $filelink = get_file_link($p, $f); $all_files_size += $filesize_raw; $perms = substr(decoct(fileperms($path . '/' . $f)), -4); ?> <tr> <?php if (!READONLY) { ?> <td><label><input type="checkbox" name="file[]" value="<?php echo encode_html($f); ?> "></label></td><?php