After globalling $docRoot and $ICEcodeDir, work out a $localPath for the
file we have a result for
If our results match, we are looking in the ICEcoder dir and should
exclude as a result
Add a context array to all instances of file_get_contents(). This is so
we don't end up with a timeout too early if the system is set to
something short (ie, 15 secs) and we try to open a large file that takes
longer than this short limit.
Windows may use backslahes as it's dir seperator, but under some PHP
installs it uses the Linux forward slash instead. We could use the
directory seperator PHP var, but I've heard mixed opinions on this and
would rather just detect by looking at what $path, which contains
$docRoot, which is from the $_SERVER variable as this would be more
reliable.
It also wasn't showing the replace button due to a PHP_EOL which ended
the JS string with quote termination.
Establish a stringExtra value of a slash or nothing depending on wether
we are considering the root level or not
When comparing the folder against the selectedFile array value, postfix
both with a slash (could be any char though). This is to eliminate path
mismatches.
Remove old echo test message
Added new $foundInSelFile var
Both this and bFile are false to begin with
Testing on not false of bannedFile in strpos
If we find our matching item is one of our selected files, set
$foundInSelFile to true
Only if we don't have a banned file and either we have no selected
files, or we do have some and have a match, push to array etc
PHP_EOL's to make source easier to read
strClean on GET var selectedFiles
Remove 2 x console.logs
Remove commented text
2 x areas need first slash removing and ending with a slash
Need to var thisWidth to avoid global
Get an array of selectedFiles if there is one
Fix by resetting foundInSelected on each loop
targetURL is now lowercase as standard
Only provide results if it's a file
Also only provide results if the beginning of the path matches and
either the targetURL is the same or if it forms the beginning
Set $bFile = true if the file which contains our match doesn't match the
selected file
Checking if we have a $_GET['target'] before use to avoid PHP notices
findText is converted to lowercase
Global case insensitive searching with regex in open documents
Find/replace in filenames now compares in a case insensitive way
Split the resultsDisplay generation onto 3 lines to make it easier to
read
Fixed issue with showing 'replace with xxx' when you're actually just
finding
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)
resultsPane id setup. This then allows us to change the height to fill
more of the popup if we don't have replaceAll button at the bottom.
Establish findText in both PHP and JS (they need different sources for
their values unfortunately)
(JS for encoding simplicity by just using input field value and PHP to
get GET value as it can't pick up the parent input field value)
Use findText in both JS and PHP variations where appropriate
Not refering to a number when calling replaceInFileSingle, instead set
file ref as a string param
replaceInFileSingle simply sends the fileRef and find & replace values
to the new replaceInFile function so it can begin it's process
replaceInFilesAll runs through all files in the foundArray and calls
replaceFileInSingle repeatedly with the fileRef
When it's finished running through all files, it hides the blackMask,
returning to the usual view
Make global ICEcoder var avail to be used in PHPGrep function
If the user isn't logged in, check if the file we're considering showing
is a restricted file and if so set rFile = true
Syntax fixed - swapped strpos params round (needle, haystack)
Now detects if we're finding in filenames, files or otherwise, open docs
Extra else condition to handle finding in files
Uses a Grep like technique to recursively find in files and build up a
string
(Need to get the exclusion of restricted and banned files working)
It then displays the results in the results display DIV once we have a
list build up
File paths are dropped into foundArray
These can then be used by 2 x new functions to replace and replace all
(This final part is to be done)
fullPath is replaced by docRoot in the JS link to open file
(Means it's accessable from any file tree root now as it's a full path)
No need to prefix on fileRef
Minor text tweak
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
Title outside of results DIV, which is now the scrollable container
Rename all/replace all button wording
Handling both cases now, find & documents and filenames
The latter works by scanning IDs and building up array
Find in filenames also handles selected filenames as well as all
filenames
Can rename singularly, rename all or click link to open file
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)