Framework

The AW site uses a proprietary framework. This helps to us to

  • seperate code from templates
  • maintain multiple versions of the site (css, hdml, html, … )
  • maintain a common look and feel
  • maintain loose coupling between site elements
  • provide a means of page communication and state maintenence

Framework Configuration

The framework is configured through modification of two files found in ~/code/wh2oconfig. Posted here is an example of my current ConfigInfo.inc file, please modify the .sample file with values that are appropriate to your configuration.

Site Resources

The site is divided into code, control, and static resources. Code is located in ~/code and the rest of the elements are located in ~/www.

Code

The code is PHP code maintained as objects. The objects are named Cobjectname where objectname is the name of the object and stored in ~/code/wh2o/ as objectname.inc. Objects private to the public objects can be defined in the .inc files that use them.

There are three common types of objects designated by thier extensions. They are:

Object NameSuffixExampleDescription
Information ObjectsInfoConfigInfo.incContains information (either static or dynamic) that are consumed by other objects.
Client ObjectsClientLoginClient.incContains information that represents shared state between objects. Only one instance of this Object is instantiaed and it is maintained in session between client requests. The best example of this is that when a user logs in, the user's id and login state is stored in LoginInfo.inc
Gadget ObjectsGadgetAWNewsGadget.incCode represents a public interface to the website capable of exchanging information with the client. These objects derive from CGadget located in Page1.inc.
View ObjectsViewDirectoryView.incMeant to provide a template for the model member of the object. In reality, the object falls into a funny in-between of a Gadget and a template.
Security ObjectsSecuritySecurity.incDoes a security check on an object. Various security systems can be layered on top of each other, assigned to individual states of a gadget or can be used to define permissions and user levels for a functionality.
Form ObjectsFormAccidentSearchFrom.incDefines a form using a standard library of form widgets.

Other players in the object framework are Layout Objects and Page Objects.

Control Objects

These objects were introduced to give the URLs a prettier and indexable look. They consist of phtml and one word files located in ~/www and its children. Please refrain from adding more as they are complicated to maintain. Entry points that do not start with "content/" are depriciated but should be maintained for indexablity.

Static Resources

Static Resources are organized by type. Examples of static resources are images, sylesheets, wiki pages, and javascripts. Currently the prefered location for these resources are as follows:

ResourceLocation
CSS Stylesheets~/www/resources/css/
Images~/www/resources/images/
Wiki Pages (note: use Wiki Editor to change these)~/www/wiki/data/media
Javascript~/www/resources/js/

Forms

Forms in the framework are covered here.

Join AW and support river stewardship nationwide!