Remove triggering fileManager() onLoad, this is the only place it's used
Set the class, style and onClick events to replicate what that function
was doing
When sorting folders into order, special chars such as $, -, _ etc were
causing sorting issues while other chars such as _ worked OK. This is
all due to the char's ref in relation to a-z, 0-9 and A-Z chars in the
char table. By replacing these URL special chars (defined in RFC 1738
specification) with a \ (the only char not allowed in a file/folder
name), we are levelling these chars out, so we can safely focus on
alphanum sorting only.
Title tag text changed to match other files
Decided to drop setting bannedFiles in the ICEcoder array to match
session based version
Checking against the session based version now
Ternary formatting just for ease of reading
Root list item now created mostly without PHP echos
Just echoing now rather than building up a var to echo
You cannot get access to ICEcoder unless you have logged in, so
restrictedFiles is not needed anymore
Removed it and all instances of it's usage
Only updating pluginsContainer if it's a DOM elem
Change title tag of login/set password screen conditionally
Moving away from the idea of multiple user levels, users will either
have full access or no access
Swapped all userLevel session vars to a loggedIn var, which is a bool
Makes things simpler and paves the way towards the new login screen
(before you see any files, code etc)
Instead of just finding our dirname within the finalArray using strstr,
now using strpos and detecting if it's pos 0, which is much more
appropriate & reliable.
Example: Looking for /bob/t1.txt for may potentially return a false
positive for finding '/bob' in '/another/bob1/abc' and files therefore
t1.txt ends up in the wrong folder. This false positive only occurs when
the write order of hard drive storage has stored another/bob1/abc before
/bob and therefore retrieval load order can cause this odd, occasional
issue.
Checking for /bob being the start of our finalArray item through
strpos===0 eliminates this possibility.
Inclusion of settings.php moved to start to be like other PHP files
docRoot replaces $_SERVER equivalent
$path now gone in favour of specifying the file path chunks we need
Simplification in a few areas that previously used $path
Other areas of code also simplified for clarity
All file refs (links, ids etc) now relaitive to doc root. This means
less code and doesn't expose full server paths which is a good security
tweak.
Couple of ternary conditions shortened
$path equals a new ICEcoder setting which defines the FM tree root
(Means you can set your own tree root now!)
Broke long echo statement into seperate lines
Shows root name or [ROOT] if it's the server root
All server variables such as codeMirrorDir, visibleTabs etc now in
$ICEcoder array
This is so we have a single object to contain all settings, just like
the JS equivalent
Setting up mouseDown value as bool on down & up events
Mouse move now gets X & Y pos along with determining area event
triggered in
Also then determins if we can resize file manager width & show w-resize
icon
All of this applied to HTML tag so at hightest DOM level
Previous dir tree was working via the usual recursive method of scandir
The code was problematic as it was creating 3 dir trees and had an
incorrect UL structure
This now works in a completely different way, using PHPs inbuilt
iterators
Performance results are visibly noticable as file manager loads much
quicker
Tests show around a 100% increase in efficiency on servers with 1000's
of files & folders
There is also much less code, less repitition and it's much cleaner to
work with
The incorrect UL & LI structure has now been fixed and is valid
Loads of junk and redundant code removed also
alert calls now routed to message function
confirm calls now routed to ask function
prompt calls now routed to getInput function
This is so you can replace how these are handled if you wish
(Useful if you want to get away from browser chrome & UA dialogs)
Conditional IE hack removed as it needs to apply to Firefox too
Now a CSS margin-top hack relating to Chrome only in CSS file
Moved updating of file, folder, bytes container to editor.php file
(This means it shows correctly on load)
Count of files & folders are running as files & folders are found
Bytes of files also totalled
onLoad, a new function is called to update the server info display
Hex codes shortened if poss (ie, #888888 becomes #888 and #ff0000
becomes #f00)
Swapped text colour on tabs, selected now has black text, others white
text
Pointing mouse over file manager icons now shows a CSS pointer cursor
On click of the HTML tag, selectFileFolder function is called, rather than just hide context menu
Calling this from HTML rather than body tag now
This in turn means the whole line for a file isn't clickable, just the name
$ownerInfo var previous available, based on posix_getpwuid
However, this isn't available on all servers, so removed
File attributes now no longer show as lock, just CHMOD info next to filename
If you're not logged in though, you see lock with alert message via onClick
$restrictedFiles now covers folders too
Removed redundant code for files when you're restricted no need for if clause