# HG changeset patch # User nanaya # Date 1432459041 -32400 # Node ID 54c13838f8bb581fc34364075181a69d7639c67d # Parent ddb5458658d25baccae943a3d6ca2d9d663a3ea3 Add spacing to before/after hidden data part. And extract the generation to separate function. diff -r ddb5458658d2 -r 54c13838f8bb index.php --- a/index.php Sun May 24 18:03:52 2015 +0900 +++ b/index.php Sun May 24 18:17:21 2015 +0900 @@ -61,6 +61,10 @@ } return sprintf($return_format, $size, $return_unit); } + + function hidden_data($data) { + return " " . $data . " "; + } // END UTILITY function tree_link() { @@ -96,9 +100,9 @@ if ($is_dir) { $file_suffix = "/"; - $list_file_prefix = "0"; + $list_file_prefix = hidden_data(0); } else { - $list_file_prefix = "1"; + $list_file_prefix = hidden_data(1); } foreach($files as $file) { @@ -108,8 +112,8 @@ $file_rows .= "". $list_file_prefix . link_to($file . $file_suffix, $file . $file_suffix).""; $file_rows .= ""; - if ($is_dir) { $file_rows .= "0[dir]"; } - else { $file_rows .= "" . $file_stat["size"] . "" . human_size($file_stat['size']); } + if ($is_dir) { $file_rows .= hidden_data(0) . "[dir]"; } + else { $file_rows .= hidden_data($file_stat["size"]) . human_size($file_stat['size']); } $file_rows .= ""; $file_rows .= "".h(strftime("%Y-%m-%d %H:%M %Z", $file_stat['mtime']))."";