The Modes plugin framework consists of a number of WordPress shortcodes. These work together to deliver the required content to the current page. The control framework is Ajax-based.
On first loading the page, each Modes data source will use the active page parameters to frame an HTTP request, and will get back an XML response. The response handler will in turn trigger each shortcode which uses that data source, passing the XML response DOM as a parameter. Each shortcode will use the information in the XML response to update its HTML contents, typically by applying an XSLT transform to it.
Thus, when the page is first loaded, each Modes shortcode function will simply write an empty named <div> element to the page, to act as the root for the content which will eventually be placed there.
The approach adopted will be based on the Culture Grid explorer (cg-search.htm), and it should be possible to put much of the functionality into Javascript libraries. This will limit the amount of “Javascript written by PHP” code which is required.
Modes datasource
Every page requires a Modes datasource. This is a “non-visual” shortcode, whose purpose is to define the interface to a Modes data file. When the datasource is initialised, it will build an array of the Modes components which make use of it.
Modes summary/data
A paged view of a set of Modes records. If there is no query specified, this can default to a Modes browser control, which displays a fixed set of records/searches.
Modes detail
Like Modes summary (maybe not a separate component?); shows a single record, with controls to navigate forward and backwards through the result set.
Modes navigator
A component which allows the user to move through a Modes summary/data result set. Needs to specify the name of the control which it applies to.
Modes facets
A component which displays terms which are relevant to the current search result, relating to one or more facets. Selecting a term will add that term to the current search, thus refining it.
Modes search terms
This control displays each active search term, and provides a means to deselect any term.
Modes lightbox
Displays a result set as a grid of images, using a simple XPath expression to get the image filenames.
Modes map
Displays a (Google) map, with selected items marked.
Modes timeline
Displays a (Simile) timeline, with selected items marked.