echo "<table class='table table-hover'>\n <thead><th>Nome</th><th>Dimensione</th><th>Ultima modifica</th></thead>"; $file_array = array_diff(scandir($path), array('..', '.', '.DS_Store')); foreach ($file_array as $file) { $url = $path . "/" . $file; if (!is_dir($url)) { $finfo = finfo_open(FILEINFO_MIME_TYPE); $content_type = finfo_file($finfo, $url); $file_icon = getFileTypeIcon($content_type, $file); $size = formatBytes(filesize($url), 1); $date = date("d/m/Y", filemtime($url)); echo "<tr><td><i class='fa {$file_icon}'></i> <a href=\"{$url}\" target='_blank'>{$file}</a>"; /*$preview=canPreview($content_type); if($preview=="no"){ echo"<tr><td><i class='fa $file_icon'></i> <a href=\"$url\" target='_blank'>$file</a>"; }else{ echo"<tr><td><i class='fa $file_icon'></i> <a href='#' data-path=\"$url\" data-preview_mode='$preview' class='file-list-previewable'>$file</a>"; }*/ echo "</td><td><span class='text-muted'>{$size}</span></td><td><span class='text-muted'>{$date}</span></td></tr>"; } } echo "</table>"; } } else { //Richiama il gestore di modifica (file seprato <nome-modulo>.php e <nome-modulo>.js che si interfaccia con content.php if (file_exists("../core/modules/edit-modules/file-lister.php")) { include "../core/modules/edit-modules/file-lister.php"; $GLOBALS["addjs_edit_modules"] = "file-lister.js"; } else { ModuleEditNotExistingError("file-lister"); } }
echo "</div>\n"; $aux_class = ""; } echo "</div>\n"; break; case "modal": if ($line["element-type"] != "modal") { ModuleLoadError("modal", $id); break; } $json = $line["settings"]; $json_decoded = json_decode($json); $title = htmlspecialchars($line["displayname"]); $content = $line["content"]; $id2 = $id . "Label"; echo "<button class='btn {$json_decoded->trigger_class}' data-toggle='modal' data-target='#{$id}'>{$title}</button>\n <div class='modal fade' id='{$id}' tabindex='-1' role='dialog' aria-labelledby='{$id2}' aria-hidden='true'>\n <div class='modal-dialog'><div class='modal-content'>\n <div class='modal-header'>"; if ($json_decoded->close == true) { echo "<button type='button' class='close' data-dismiss='modal'><span aria-hidden='true'>×</span><span class='sr-only'>Chiudi</span></button>"; } echo "<h4 class='modal-title' id='{$id2}'>{$title}</h4>\n </div><div class='modal-body'>\n{$content}\n</div></div></div></div>\n"; break; } } else { //Richiama il gestore di modifica (file seprato <nome-modulo>.php e <nome-modulo>.js che si interfaccia con content.php if (file_exists("../core/modules/edit-modules/" . $module["type"] . ".php")) { include "../core/modules/edit-modules/" . $module["type"] . ".php"; $GLOBALS["addjs_edit_modules"] = $module["type"] . ".js"; } else { ModuleEditNotExistingError($module["type"]); } }