Modern Theme: More changes
A bit more about the modern theme progress.
During the last week I spent another full swing effort on coding on the re-themed BlueOnyx. While I was having some other things cooking, I added an Italian and Portuguese translation to the GUI:
Same as with the new Spanish and French translation: These need work. They're just a rough draft and were created by a custom script that uses the Google Translate API. But they'll do for now until a native speaker of these languages has the time and leizure to sort them out.
As you can also see: The icons for the menu entries now are more diverse. In the previous screenshots (and the previous demo) I was just using one stock icon for everything. Now the icons are defined in the menu XML files of the individual menus.
Next there was a suggestion from Greg Kuhnert. On pages like "vsiteAdd" we have elements like MySQL, anonymous FTP and what not. They have optional settings, which you only need when these items are active. His question was if we could hide these extra-options unless the item is actually activated. Well, we can:
Needless to say: The "change" happens when you tick the box for "enable" next to such an item. Then it "unfolds" the previously hidden element without having to reload the page. Which is neatly done via jQuery methods.
While I was at it, I also modified the getInteger() method to use jQuery methods to verify is an entered number is within the allowed range:
There are some other cosmetics that happened as well. The appearance of the the getDivider() function changed to render a nicer divider. Which can be seen above in the form of the darker line with the label icon. Also icons for Active Monitor and "Logout" were added to the horizontal menu. To make room the "Remote" tab that calls up the SSH Applet was moved to "Personal Profile" / "Programs", where it is a lot better accomodated:
All in all it was a good weeks worth of troubles. Again with chasing bugs through half a dozen of differen PHP classes. I updated the demo with the current progress and there is soon more to come. Promised.
One thing is for sure: If you let users at something, they'll break it. :-)
Which is good, as the demo helped to find me a bug. Apparently someone set the GUI of the demo to Japanese, which is possible in demo-mode and even encouraged. However, when I tried to login to the demo today, I got past the login screen and instead of seeing the GUI I was greeted by a PHP error message. A line of code that usually works perfectly was now throwing errors. That line had to do with parsing the menus. I fiddled a bit with that line and prevented the error from firing on that line. I got further then, but all the menu texts were missing now. At best the icons were shown (in the horizontal menu), but the vertical menu was entirely blank.
After a bit more bughunting I then discovered a glaring problem: I still had a cookie set from my last visit, which wired user "admin" to the language I had used last: "en_US". The demo visitor had changed the server language and user "admin" to "ja_JP". But on login I just used the cookie values and not the server configured values for the user that was logging in.
At that point the GUI simply got confused and hence the errors. For all other languages it wouldn't have mattered, because they use UTF-8 as charset as well. But "ja_JP" uses the "EUC-JP" charset and using the wrong charset here contributed mightily to the problem.
This has been fixed now (in the demo as well). Upon sucessful login the login page handler checks which language is configured for the user in CODB and then updates the language cookie before forwarding to the toplevel GUI page that the user is privileged to see.