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,6 +908,8 @@ if ($login['settings'] != NULL &&
print '</pre>'; print '</pre>';
if (!$is_special_stream)
{
print '<div id="code_file_loc_info" class="codepot-infobox">'; print '<div id="code_file_loc_info" class="codepot-infobox">';
print '<div class="title">LOC</div>'; print '<div class="title">LOC</div>';
/* TODO: show this if it's enabled in the user settings */ /* TODO: show this if it's enabled in the user settings */
@ -911,6 +917,7 @@ if ($login['settings'] != NULL &&
print "<img src='{$graph_url}' id='code_file_loc_info_locgraph' />"; print "<img src='{$graph_url}' id='code_file_loc_info_locgraph' />";
print '</div>'; print '</div>';
} }
}
?> ?>