htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Add-Ons:
fix for wei's ImageManager directory/file sorting


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


texastoast
New User

May 10, 2004, 8:47 AM

Post #1 of 1 (10638 views)
Shortcut
fix for wei's ImageManager directory/file sorting Can't Post

I'm using wei's ImageManager plugin for v3, and I noticed the files and directories weren't sorting properly in the "Insert Image" popup. The first time it opened, it sorted correctly, but after using it to upload some images, I noticed that the new images were ALWAYS placed at the end. After looking into it some more, I found that even the original sorting was slightly off. This made finding the proper

I dug around in the code and found the following fix:

in "classes\ImageManager.php" on-or-about line 182-183 you will find the following code:


Code
   ksort($dirs); 
ksort($files);

This SHOULD sort them correctly (alphabetically, though not case-insensitive), but it wasn't.Crazy I changed it to the following:


Code
   uksort($dirs, "strnatcasecmp"); 
uksort($files, "strnatcasecmp");



and the files and directories began sorting properly (alphabetically, case-insensitive). Hope this helps someone out there.

-Toasty Cool

 
 
 


Search for (options)