stop decorating an octet stream in code file view

This commit is contained in:
hyung-hwan 2017-01-04 03:24:41 +00:00
parent cc588594a7
commit a1f3400990

View File

@ -11,12 +11,15 @@
$is_special_stream = FALSE; $is_special_stream = FALSE;
if (array_key_exists('properties', $file) && count($file['properties']) > 0) if (array_key_exists('properties', $file) && count($file['properties']) > 0)
{ {
$octet_stream = TRUE;
foreach ($file['properties'] as $pn => $pv) foreach ($file['properties'] as $pn => $pv)
{ {
if ($pn == 'svn:mime-type') if ($pn == 'svn:mime-type')
{ {
if ($pv == 'application/octet-stream') if ($pv == 'application/octet-stream')
{ {
$octet_stream = TRUE;
$lower_fileext = strtolower($fileext); $lower_fileext = strtolower($fileext);
if (in_array ($lower_fileext, array ('png', 'jpg', 'jpeg', 'gif', 'tif', 'bmp', 'ico'))) if (in_array ($lower_fileext, array ('png', 'jpg', 'jpeg', 'gif', 'tif', 'bmp', 'ico')))
{ {
@ -58,6 +61,7 @@
} }
} }
} }
if ($octet_stream) $is_special_stream = TRUE;
} }
?> ?>
@ -904,12 +908,15 @@ if ($login['settings'] != NULL &&
print '</pre>'; print '</pre>';
print '<div id="code_file_loc_info" class="codepot-infobox">'; if (!$is_special_stream)
print '<div class="title">LOC</div>'; {
/* TODO: show this if it's enabled in the user settings */ print '<div id="code_file_loc_info" class="codepot-infobox">';
$graph_url = codepot_merge_path (site_url(), "/code/graph/cloc-file/{$project->id}/{$hex_headpath}{$revreq}"); print '<div class="title">LOC</div>';
print "<img src='{$graph_url}' id='code_file_loc_info_locgraph' />"; /* TODO: show this if it's enabled in the user settings */
print '</div>'; $graph_url = codepot_merge_path (site_url(), "/code/graph/cloc-file/{$project->id}/{$hex_headpath}{$revreq}");
print "<img src='{$graph_url}' id='code_file_loc_info_locgraph' />";
print '</div>';
}
} }
?> ?>