Hey there
MochaUI is really a gread UI framework, perhaps one of the best!
But like it is used on the demo pages included in the package I think it is a little bit too static for dynamic web applications. The full application is defined by just one static init script.
So I started in coding some PHP classes to generate this init script dynamically.
This is my first release of MochaPHPControl. (Download at MochaUI google group files)
Please don't use it in productive systems, this first release is just for testing, code review and feedback what I could / should change.
Demo MochaUI Application with MochaPHPControl: http://test.divepage.net/mpc/
Editor to look at the code: http://test.divepage.net/editor/
Explination:
The classes are located in inc/classes.
The full application is controlled by the static classes sLayout and sLayoutCollection.
Instead of the old js/mocha-init.js my application loads /mochaInit.php. In this file all the columns, panels and windows are defined using the php classes. The file data/json-windows-data.js is also replaced by a php file.
Output is a collection of windows, colums and panels in a global JS object called 'muiC'.
Columns and panels will be initialized automatically.
Windows can be opened in several ways:
by using there function defined in muiC.w.[windowID]()
by setting the state to open (php side, look at parametrics window for example)
by using the action attribute of links
By the way, I modified the handling of links.
If you want to open a link in a specific panel, just use the ID of the panel inside the 'target' attribute. The URL defined in 'href' will be loaded into the panel by XHR.
Much more power gives the handling of the action-attribute. Expected content of 'action' is a JSON string.
open: opens the window with the given ID from the collection muiC.w
example: action="{open: 'about'}"
update: update an element using MochaUI.updateContent. Expects a JSON object containing the parameters required by updateContent.
content: Load predefined content from collection (used for splitPanel)
notify: just give a notify to the user, expects the string to notify
exec: execute a MUI function like tileWindow or simmilar
If there is no target and no action defined links will allways be opened in a new window.
To ensure that this new link handling is used for all links, included recently loaded from XHR, I added a small piece of code to js/source/Core/Core.js on line 252.
OK,
I hope you like it and I hope to get some feedback for my further development on this classes.
Greetings from germany, Michael
PS: demo installation on webserver will come in the next days


