mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
Remove file & folder count
Remove build up of vars, data, functions and triggering the update of this on load
This commit is contained in:
@@ -36,7 +36,7 @@ $activeLineBG = array_search($ICEcoder["theme"],array("eclipse","elegant","neat"
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onLoad="top.ICEcoder.updateFileFolderCount()" style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||
<body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||
|
||||
<?php if ($ICEcoder['demoMode']) {?>
|
||||
<div style="position: absolute; display: inline-block; width: 99px; height: 50px; top: 0; right: 30px; background: url('images/big-arrow.gif') 0 -10px no-repeat; text-align: center; font-family: arial; font-size: 10px; padding-top: 60px"><b>Click logo<br>for help &<br>usage info</b></div>
|
||||
@@ -75,8 +75,6 @@ $activeLineBG = array_search($ICEcoder["theme"],array("eclipse","elegant","neat"
|
||||
}
|
||||
}
|
||||
;?>
|
||||
<span style="color:#888">File & folder count:</span><br>
|
||||
<div id="fileFolderCounts"></div><br><br><br>
|
||||
</div>
|
||||
|
||||
<div style="clear: both">
|
||||
|
||||
12
files.php
12
files.php
@@ -20,18 +20,6 @@ include("lib/get-branch.php");
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
// Output the JS vars
|
||||
echo "<script>\n";
|
||||
echo "top.ICEcoder.dirCount=";
|
||||
echo $dirCount ? $dirCount : "0";
|
||||
echo ";\ntop.ICEcoder.fileCount=";
|
||||
echo $fileCount ? $fileCount : "0";
|
||||
echo ";\ntop.ICEcoder.fileBytes=";
|
||||
echo $fileBytes ? $fileBytes : "0";
|
||||
echo ";\n</script>";
|
||||
?>
|
||||
|
||||
<iframe name="fileControl" style="display: none"></iframe>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -6,9 +6,6 @@ if (!isset($ICEcoder['root'])) {
|
||||
if (!$_SESSION['loggedIn']) {
|
||||
header("Location: ../");
|
||||
}
|
||||
$fileCount=0;
|
||||
$fileBytes=0;
|
||||
$dirCount=0;
|
||||
|
||||
// If we're just getting a branch, get that and set as the finalArray
|
||||
$scanDir = $docRoot.$iceRoot;
|
||||
@@ -38,9 +35,7 @@ $finalArray = array_merge($dirArray,$filesArray);
|
||||
for ($i=0;$i<count($finalArray);$i++) {
|
||||
$fileFolderName = str_replace("\\","/",$finalArray[$i]);
|
||||
$type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file";
|
||||
$type=="folder" ? $dirCount++ : $fileCount++;
|
||||
if ($type=="file") {
|
||||
$fileBytes+=filesize($docRoot.$iceRoot.$fileFolderName);
|
||||
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
|
||||
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
|
||||
}
|
||||
|
||||
@@ -1419,27 +1419,6 @@ var ICEcoder = {
|
||||
document.getElementById('results').style.display = showHide=="show" ? 'inline-block' : 'none';
|
||||
},
|
||||
|
||||
// Show file & folder count in server info screen
|
||||
updateFileFolderCount: function() {
|
||||
var fileText, dirText, unitSize, unitText, dContainer;
|
||||
|
||||
dirText = top.ICEcoder.dirCount > 1 ? "folders" : "folder";
|
||||
fileText = top.ICEcoder.fileCount > 1 ? "files" : "file";
|
||||
// Change into kilobytes
|
||||
unitSize = Math.ceil(top.ICEcoder.fileBytes/1024);
|
||||
unitText = "kb";
|
||||
// Maybe we should show in megabytes?
|
||||
if (unitSize >= 1024) {
|
||||
unitSize = (unitSize / 1024).toFixed(2);
|
||||
unitText = "mb";
|
||||
}
|
||||
// Update the display
|
||||
dContainer = top.ICEcoder.content.contentWindow.document.getElementById('fileFolderCounts');
|
||||
if (dContainer) {
|
||||
dContainer.innerHTML = top.ICEcoder.fileCount+" "+fileText+", "+top.ICEcoder.dirCount+" "+dirText+"<br>~ "+unitSize+" "+unitText;
|
||||
}
|
||||
},
|
||||
|
||||
// Toggle full screen on/off
|
||||
fullScreenSwitcher: function() {
|
||||
// Future use
|
||||
|
||||
Reference in New Issue
Block a user