1515//* Check permissions for module
1616$ app ->auth ->check_module_permissions ('sites ' );
1717
18+ $ app ->uses ('functions ' );
19+
1820$ app ->load ('listform_actions ' );
1921
2022// $tmp_rec = $app->db->queryOneRecord("SELECT data from monitor_data WHERE type = 'harddisk_quota' ORDER BY created DESC");
@@ -57,7 +59,12 @@ function prepareDataRow($rec)
5759 if (!is_numeric ($ rec ['soft ' ])) $ rec ['soft ' ]=$ rec ['soft ' ][1 ];
5860 if (!is_numeric ($ rec ['hard ' ])) $ rec ['hard ' ]=$ rec ['hard ' ][1 ];
5961 if (!is_numeric ($ rec ['files ' ])) $ rec ['files ' ]=$ rec ['files ' ][1 ];
60-
62+ $ rec ['used ' ]=$ app ->functions ->formatBytes ($ rec ['used ' ]*1024 );
63+ $ rec ['soft ' ]=$ app ->functions ->formatBytes ($ rec ['soft ' ]*1024 );
64+ $ rec ['hard ' ]=$ app ->functions ->formatBytes ($ rec ['hard ' ]*1024 );
65+ if ($ rec ['soft ' ] == "NAN " ) $ rec ['soft ' ] = $ app ->lng ('unlimited ' );
66+ if ($ rec ['hard ' ] == "NAN " ) $ rec ['hard ' ] = $ app ->lng ('unlimited ' );
67+ /*
6168 if($rec['used'] > 1024) {
6269 $rec['used'] = round($rec['used'] / 1024, 2).' MB';
6370 } else {
@@ -78,17 +85,17 @@ function prepareDataRow($rec)
7885
7986 if($rec['soft'] == " KB") $rec['soft'] = $app->lng('unlimited');
8087 if($rec['hard'] == " KB") $rec['hard'] = $app->lng('unlimited');
81-
88+ */
8289
8390 /*
8491 if(!strstr($rec['used'],'M') && !strstr($rec['used'],'K')) $rec['used'].= ' B';
8592 if(!strstr($rec['soft'],'M') && !strstr($rec['soft'],'K')) $rec['soft'].= ' B';
8693 if(!strstr($rec['hard'],'M') && !strstr($rec['hard'],'K')) $rec['hard'].= ' B';
8794 */
88-
95+ /*
8996 if($rec['soft'] == '0 B' || $rec['soft'] == '0 KB' || $rec['soft'] == '0') $rec['soft'] = $app->lng('unlimited');
9097 if($rec['hard'] == '0 B' || $rec['hard'] == '0 KB' || $rec['hard'] == '0') $rec['hard'] = $app->lng('unlimited');
91-
98+ */
9299 //* The variable "id" contains always the index variable
93100 $ rec ['id ' ] = $ rec [$ this ->idx_key ];
94101 return $ rec ;
0 commit comments