Automagiczne uzupełnianie katalogów'; } function admin_dir_fill() { global $content; global $config; global $script; $path = $config['basedir']; $dir_handle = @opendir($path) or die('Błąd otwarcia basedir'); $dirlist = []; while ($file = readdir($dir_handle)) { if(!is_dir($path.$file)) continue; if (in_array($file, array('miniatury', '.', '..'))) continue; $dirlist[] = array('name' => $file, 'date' => filemtime($path.$file)); } usort($dirlist, 'dir_compare'); $content .= '
'; // $content = '' . print_r($dirlist, true) . ''; $dirlist_json = json_encode($dirlist); $script = 'const dirlist = ' . $dirlist_json . ';'; } function dir_compare($a, $b){ return $b['date']-$a['date']; } ?>