Modern Theme Development

Posted by: mstauber Category: General

This is a small and long overdue status report on the development of a modern theme for BlueOnyx.

A few months ago at the end of September 2012 we started a fund raiser to collect money to allow us to equip BlueOnyx with an up to date and modern theme. It's certainly a bit overdue that some news are posted about how that went, what the status is and what kind of progress has been made.

First of all: A very big THANK YOU to all the people who have donated money to this cause. It was a really humbling and elevating experience to see the community come forward in such numbers to make small and big donations towards this lofty goal. I'm honored by the trust that you place into this project. Thank you!

Yes, the financial target to purchase the Adminica theme has been met. As soon as that goal was met, I went ahead and purchased the theme.

The next step was to roll up the sleeves and to analyze the code of the new theme. To see how it works and how its individual bits and pieces come together. How they can be integrated into BlueOnyx. The new theme covers about 85% of the functionality that we need for a modernized BlueOnyx GUI. A few bits and pieces need to be modified to create other (more or less unique) GUI elements that we also require. But beyond that there are also some interesting features in the new theme that I'd like to use in the new BlueOnyx GUI as well. Especially where it comes to reporting information or generating graphs and tables of information.

Next was the nuts 'n bolts stuff: How to strap the new GUI elements to the old code?

This is where it gets a bit technical, but I will try to keep the explanation as simple as possible:

There are a few dozend PHP classes in the BlueOnyx GUI, which render certain GUI elements. For example: When some page needs a pulldown menu, then a certain PHP class is used to insert the actual HTML code to display that pulldown menu into the rendered GUI page.

One possible approach to switch BlueOnyx to the new Adminica theme would be to edit all the existing PHP classes that handle these elements and to replace the old HTML code within them with the new HTML code that we'd need to use the Adminica theme.

However, this only goes so far. After all, we also want to get rid of the frames. And the frameset and the various pages within it are generated by other PHP scripts. Which also need to be modified to do what we want.

I did a thorough code analysis of the existing mechanisms that currently generate the GUI pages. Which is stuff that none of us BlueOnyx developers usually touches during our day to day maintenance of the BlueOnyx sources. That code itself is pretty old and the age really shows. The design philosophy was good back in the days and the methodology the initial developers followed was sound. Back then. Nowadays we'd do things a hell of a lot different, more efficiently and also with future versions of PHP in mind. The original GUI was written for PHP-4.1 and during the years that followed it has only been hotwired to (barely) run on modern PHP versions. During the last PHP-5.2 to PHP-5.3 transition of the GUI the effort to make it work again was considerable. The current code (as it is now!) will not run on PHP-6. That I can already say. So does it make sense to "do a quick hack" to "strap on" Adminica? Where would that leave us when RHEL7 comes out? Probably with a hell of a lot of a mess.

So I took a step back and chose another approach, which will leave us with a much more robust and future-proof solution:

There are GUI frameworks available, which already have all the nuts and bolts in place. User management, authentication, input validation, prevention of Cross-Site-Scripting-Attacks, session management, right management for various privilege levels of users and all these kind of things. The larger frameworks are also well maintained, supported and regularly updated. So future PHP versions will be less of a problem for them to handle.

I looked at a few of these frameworks and after some testing I chose CodeIgniter as potential new GUI framework for BlueOnyx.

So there we are now. Imagine we're building a brand new house. The foundation has been laid - in the form of CodeIgniter. The roof is also already constructed - in the form of the Adminica theme.

What's left is to place the walls, do the plumbing, set the windows and doors and get the electrical system and the heating installed. Which is basically what makes BlueOnyx tick: The CCE interface. The CODB database. Classes to display certain GUI elements, the classes to display the GUI texts in various languages via i18n methods, classes to render the menu structure - just to name a few.

So I started to splice these "loose ends" together on a test box. First I made CodeIgniter "CCE-aware" and coded libraries that allow CodeIgniter to talk to CODB via CCE. Then I started to code the basic mechanisms for user authentication. When that was about half way done, I realized that I also needed to port the libraries for the security model (and a few other bits and pices). I got that to a point where a basic login was (almost) working. I say almost, because as far as CCE is concerned the login goes through, but the library for the XML parser of the menu structure that this user is entitled to see isn't yet compatible with a frameless GUI. So the actual loading of anything past the login isn't happening.

What I have there now is basically a "design prototype". It's not yet a working new BlueOnyx GUI, but instead it's a feasibility study to see if this approach is viable and can be done with reasonable effort.

That's the progress that was made between end of September and mid November.

As some of you might now: End of November I moved from Germany to Colombia (yes, South-America). So from mid November on I had to focuss all my time and energy onto closing down my old company, cleaning out the office and the old apartment, getting my belongings either packed and stored away, or shipped to Colombia. Once I arrived here, the same happened in reverse: I had to set up household here, had to unpack, set up, get a new fast internet connection installed, had to register a new company and what not.

It's now end of December and none of my computers that I shipped from Germany has arrived yet. They're probably still stuck in customs and they're trying to figure out how much import tax I'll have to pay on them <sigh>. This is now the fifth week that I'm without my usual desktops and it's driving me up the walls. The old clunker of a laptop only gets me so far that I can't really do serious coding with it. It's like trying to get a screw driven in with a hammer. I'm missing three screens, a good keyboard and a work environment that has been optimized for quickly hammering out new code in a manageable fashion.

I'm somewhat optimistic that my gear will arrive sometime within the next two weeks and that's when the coding for the next generation of BlueOnyx will continue in earnest. I can't say how long it will take to finish. It's too early for that. Right now I expect the minimum coding effort to be three to five months. Yes, it is that big. But the result will be worth it.

Expect some more regular updates about the progress of this endeavour from this time onwards.

Thank you very much. All of you. The appreciation and the generosity of the BlueOnyx users has been overwhelming and I'll do my best to deliver what you have been asking for.

With best regards,

Michael Stauber

Dec 28, 2012 Category: General Posted by: mstauber
Previous page: Development Next page: Mailing List