Community-ID Internals Overview and Customization¶
Server side overview¶
Community-ID's architecture follows the MVC pattern, and builds on top of the Zend Framework for most of the functionality. The app's flow is handled through the Zend_Controller component, templates make use of the simple Zend_View approach, and all the OpenID functionality is based on the Zend_Openid component.
Application flow¶
The app is divided in modules (currently "default", "install", "stats", and "users"). Each module contains various controllers, and within each controller there are one or more actions. The URL maps to the current action in the following fashion: /module/controller/action. This is handled through mod_rewrite rules, defined in a .htaccess file in Apache's case. For Lighttpd, we provide a rule set under the utilities directory, that has to be configured manually into the web server's configuration file.
Usually each controller holds an action that renders a view, and if the view contains a form, the same controller holds the action that processes the submission of the form and that immediately redirects to another view. Each form is modeled in a class that inherits from Zend_Form, where validation rules are defined.
Client side overview¶
On the client rendering side, we make heavy use of the YUI library. We use YUI grids for the page's general layout, which allows us to define the layout in a declarative way through CSS, striving always for reserving HTML for semantic purposes and CSS for presentation. This means template customization can usually be achieved by just defining an alternate style sheet (read more about How to add a theme).
All Ajax calls are handled through the YUI connection component, which is in some places used in conjunction with the datatable component to render dynamic tables.
We officially support the following browsers: IE 6, IE 7, FF 3.x, Opera 9.6, Safari 3.x.
IE 8 testing will start soon.
Permissions¶
Users fall into one of three possible roles: guest, registered, and admin.
Admin users inherit privileges from registered users, and register users inherit privileges from guests.
In the Acl.php file each action is mapped to the minimum role needed.
How to add functionality¶
You can go from just adding an action, to adding a whole controller or even an entire module. You just need to follow the directory structure, and not to forget to declare your actions in Acl.php.
If you're gonna create additional configuration directives (accessed through Zend_Registry::get('config')->...), make sure you declare them with their default value in config.default.php, and add them to config.template.php. You also need to add some processing on the _writeConfig() method in modules/install/controllers/CredentialsController.php, as it's done with the other directives.