From ec28de40c95824d7b7d54fdf326faa6c7b971bbd Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 13 Jan 2013 12:47:48 +0000 Subject: [PATCH] Checkerboard BG behind image popups Show checkerboard image behind image popups so you can see transparent areas on images. Needed black BG as a fallback too. --- images/checkerboard.png | Bin 0 -> 231 bytes lib/file-control.php | 612 ++++++++++++++++++++-------------------- 2 files changed, 306 insertions(+), 306 deletions(-) create mode 100644 images/checkerboard.png diff --git a/images/checkerboard.png b/images/checkerboard.png new file mode 100644 index 0000000000000000000000000000000000000000..31364c46862d9fa252d8dca9f72bfafb372c8d69 GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XIz3$+Ln>~)xp9z}L4b!f;E2$(4gYP9t>Cq|e0}woPnVW` z%62(Zw63&LUjO^{Nqc}gfVMn)wg3Ll=>4K#9>dB1jPds?D;uEPPYl8kafTDjK2Vkd rzX2nJ*_d9 literal 0 HcmV?d00001 diff --git a/lib/file-control.php b/lib/file-control.php index 2cda660..bec474d 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -1,307 +1,307 @@ - -action="load";'; - - if (file_exists($file)) { - // Determine what to do based on mime type - $finfo = finfo_open(FILEINFO_MIME_TYPE); - if (strpos(finfo_file($finfo, $file),"text")===0) { - echo ''; - $loadedFile = file_get_contents($file); - echo '","",htmlentities($loadedFile)).''; - } else if (strpos(finfo_file($finfo, $file),"image")===0) { - echo ''; - } else { - echo ''; - }; - } else { - echo ''; - } - finfo_close($finfo); -}; - -// If we're due to add a new folder... -if ($_GET['action']=="newFolder") { - if (!$demoMode && is_writable($docRoot.$fileLoc)) { - mkdir($file, 0705); - // Reload file manager - echo ''; - } else { - echo ""; - } - echo ''; -} - -// If we're due to paste a new file... -if ($_GET['action']=="paste") { - $source = $file; - $dest = $docRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source); - if (!$demoMode && is_writable(dirname($dest))) { - if (is_dir($source)) { - if (!is_dir($dest)) { - mkdir($dest, 0705); - } - foreach ($iterator = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS), - RecursiveIteratorIterator::SELF_FIRST) as $item - ) { - if ($item->isDir()) { - mkdir($dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName(), 0705); - } else { - copy($item, $dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); - } - } - } else { - copy($source, $dest); - } - // Reload file manager - echo ''; - } else { - echo ""; - } - echo ''; -} - -// If we're due to rename a file/folder... -if ($_GET['action']=="rename") { - if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) { - rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName); - // Reload file manager - echo ''; - } else { - echo ""; - } - echo ''; -} - -// If we're due to replace text in a file... -if ($_GET['action']=="replaceText") { - if (!$demoMode && is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) { - $file = str_replace("|","/",strClean($_GET['fileRef'])); - $loadedFile = file_get_contents($file); - $newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile); - $fh = fopen($file, 'w') or die("Sorry, cannot save"); - fwrite($fh, $newContent); - fclose($fh); - echo ''; - } else { - echo ""; - } - echo ''; -} - -// If we're due to change permissions on a file/folder... -if ($_GET['action']=="perms") { - if (!$demoMode && is_writable($file)) { - chmod($file,octdec(numClean($_GET['perms']))); - // Reload file manager - echo ''; - } else { - echo ""; - } - echo ''; -} - -// If we're due to delete a file... -if ($_GET['action']=="delete") { - $filesArray = explode(";",$file); // May contain more than one file here - for ($i=0;$i<=count($filesArray)-1;$i++) { - if (!$demoMode && is_writable($iceRoot.$filesArray[$i])) { - is_dir($iceRoot.$filesArray[$i]) - ? rrmdir($iceRoot.$filesArray[$i]) - : unlink($iceRoot.$filesArray[$i]); - // Reload file manager - echo ''; - } else { - echo ""; - } - echo ''; - } - echo ''; -} - -// The function to recursively remove folders & files -function rrmdir($dir) { - if (is_dir($dir)) { - $objects = scandir($dir); - foreach ($objects as $object) { - if ($object != "." && $object != "..") { - filetype($dir."/".$object) == "dir" - ? rrmdir($dir."/".$object) - : unlink($dir."/".$object); - } - } - reset($objects); - rmdir($dir); - } -} - -if ($_GET['action']=="save") { - echo ''; - // on the form posting via a reload, save the file - if (isset($_POST['contents'])) { - if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="")) { - if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) { - $fh = fopen($file, 'w') or die("Sorry, cannot save"); - fwrite($fh, $_POST['contents']); - fclose($fh); - clearstatcache(); - echo ''; - // Reload file manager & rename tab if it was a new file - if (isset($_POST['newFileName']) && $_POST['newFileName']!="") { - echo ''; - } - // Reload stickytab window - echo ''; - } else { - $loadedFile = file_get_contents($file); - echo '","",htmlentities($loadedFile)).''; - echo ''; - ?> - - action='nothing';top.ICEcoder.message('Sorry, cannot write\\n".$file."')"; - } - echo ''; - } -}; -?> - - -
- - -
- - - -'; + + if (file_exists($file)) { + // Determine what to do based on mime type + $finfo = finfo_open(FILEINFO_MIME_TYPE); + if (strpos(finfo_file($finfo, $file),"text")===0) { + echo ''; + $loadedFile = file_get_contents($file); + echo '","",htmlentities($loadedFile)).''; + } else if (strpos(finfo_file($finfo, $file),"image")===0) { + echo ''; + } else { + echo ''; + }; + } else { + echo ''; + } + finfo_close($finfo); +}; + +// If we're due to add a new folder... +if ($_GET['action']=="newFolder") { + if (!$demoMode && is_writable($docRoot.$fileLoc)) { + mkdir($file, 0705); + // Reload file manager + echo ''; + } else { + echo ""; + } + echo ''; +} + +// If we're due to paste a new file... +if ($_GET['action']=="paste") { + $source = $file; + $dest = $docRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source); + if (!$demoMode && is_writable(dirname($dest))) { + if (is_dir($source)) { + if (!is_dir($dest)) { + mkdir($dest, 0705); + } + foreach ($iterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS), + RecursiveIteratorIterator::SELF_FIRST) as $item + ) { + if ($item->isDir()) { + mkdir($dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName(), 0705); + } else { + copy($item, $dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); + } + } + } else { + copy($source, $dest); + } + // Reload file manager + echo ''; + } else { + echo ""; + } + echo ''; +} + +// If we're due to rename a file/folder... +if ($_GET['action']=="rename") { + if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) { + rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName); + // Reload file manager + echo ''; + } else { + echo ""; + } + echo ''; +} + +// If we're due to replace text in a file... +if ($_GET['action']=="replaceText") { + if (!$demoMode && is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) { + $file = str_replace("|","/",strClean($_GET['fileRef'])); + $loadedFile = file_get_contents($file); + $newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile); + $fh = fopen($file, 'w') or die("Sorry, cannot save"); + fwrite($fh, $newContent); + fclose($fh); + echo ''; + } else { + echo ""; + } + echo ''; +} + +// If we're due to change permissions on a file/folder... +if ($_GET['action']=="perms") { + if (!$demoMode && is_writable($file)) { + chmod($file,octdec(numClean($_GET['perms']))); + // Reload file manager + echo ''; + } else { + echo ""; + } + echo ''; +} + +// If we're due to delete a file... +if ($_GET['action']=="delete") { + $filesArray = explode(";",$file); // May contain more than one file here + for ($i=0;$i<=count($filesArray)-1;$i++) { + if (!$demoMode && is_writable($iceRoot.$filesArray[$i])) { + is_dir($iceRoot.$filesArray[$i]) + ? rrmdir($iceRoot.$filesArray[$i]) + : unlink($iceRoot.$filesArray[$i]); + // Reload file manager + echo ''; + } else { + echo ""; + } + echo ''; + } + echo ''; +} + +// The function to recursively remove folders & files +function rrmdir($dir) { + if (is_dir($dir)) { + $objects = scandir($dir); + foreach ($objects as $object) { + if ($object != "." && $object != "..") { + filetype($dir."/".$object) == "dir" + ? rrmdir($dir."/".$object) + : unlink($dir."/".$object); + } + } + reset($objects); + rmdir($dir); + } +} + +if ($_GET['action']=="save") { + echo ''; + // on the form posting via a reload, save the file + if (isset($_POST['contents'])) { + if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="")) { + if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) { + $fh = fopen($file, 'w') or die("Sorry, cannot save"); + fwrite($fh, $_POST['contents']); + fclose($fh); + clearstatcache(); + echo ''; + // Reload file manager & rename tab if it was a new file + if (isset($_POST['newFileName']) && $_POST['newFileName']!="") { + echo ''; + } + // Reload stickytab window + echo ''; + } else { + $loadedFile = file_get_contents($file); + echo '","",htmlentities($loadedFile)).''; + echo ''; + ?> + + action='nothing';top.ICEcoder.message('Sorry, cannot write\\n".$file."')"; + } + echo ''; + } +}; +?> + + +
+ + +
+ + + + \ No newline at end of file