afaqurk/linux-dash — pull request #214 by prawnsalad (2014-06-26 18:03:43+00:00)
Title: 'sh' files turned into modules; Requests going through module.php; Consi...

A large structure change here, but it makes module data requests a lot easier to manage and work with further down the line.

**Changes**
* Data requests are now all routed through a `module.php?module=` URL.
* `sh/*.php` files have now been turned into modules `libs/modules/` with more structure.
* All returned data from these modules are JSON, using `json_encode()` throughout instead of self-building JSON strings.
* The client side loading of data now goes through a single function, `moduleData(module_name);`. Much less code repetition and the code for loading data across modules is now more consistent.

With the requests all going through `module.php`, any future modifications to how modules request data can now be handled in a single place. Eg. authentication, batch requests, throttling, etc.

The idea with modules is that third party modules can be added easily while still being accessed the same way as all other built in modules. The next logical step would be to separate the client-side module handlers into a re-usable module object so that modules can be easily created and removed at will. If this PR is accepted that's my next step :)