MochaPHPControl (for MochaUI)

12 views
Skip to first unread message

Quest

unread,
Nov 20, 2009, 1:51:58 AM11/20/09
to MooTools Users
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. (Uploaded to group files
on http://groups.google.com/group/mocha-ui/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.

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

Quest

unread,
Nov 20, 2009, 2:39:13 AM11/20/09
to MooTools Users
Problem in IE8
scripts/onloadScript.js has an error on line 34: .get does not work.
can anyone help me to get the funktion updateLinks() working in IE?

Łukasz Wojciechowski

unread,
Nov 20, 2009, 8:27:29 AM11/20/09
to MooTools Users
This all sounds just great.

I also like to use MochaUI.
I will try to play with Your code and give feedback.

--
Best regards
Lukasz Wojciechowski

On 20 Lis, 07:51, Quest <gugelwu...@divepage.net> wrote:
> 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. (Uploaded to group files
> onhttp://groups.google.com/group/mocha-ui/files)

Quest

unread,
Nov 20, 2009, 2:30:37 PM11/20/09
to MooTools Users
Thank you in advance.
I installed a demo.
MochaUI Application with MochaPHPControl: http://test.divepage.net/mpc/
Editor to look at the code: http://test.divepage.net/editor/
Reply all
Reply to author
Forward
0 new messages