symphonycms/symphony-2 — pull request #831 by eKoeS (2011-10-16 22:37:18+00:00)
Title: EDUI pages, finally!

This commit brings three new index pages for respectively: _Datasources_, _Events_ and _Utilities_. The old _Components_ page has been removed in favor of the new ones.

### Features

Currently supported features (from my EDUI extension):

* Sorting by _Name_, _Source_, _Release date_ and _Author_ for both Datasources and Events.
* Page attaching/detaching for both Datasources and Events.

Missing (to be added in future releases):

* Filtering (will probably come with @nickdunn's Publish Filtering as soon as we complete the UI/code specs)

### Technicalities

#### `Sortable` class

The `Sortable` class is responsible for handling all the sortable objects. Upon istantiation, it populates two variables to store inside them the sorting axis (`$sort`) and the order (`$order`). Then, it retrieves the context (e.g. `/blueprints/datasources`) and call a method that sorts the objects (e.g. `blueprints_datasources()`).

For more info see: [class.Sortable.php](https://github.com/eKoeS/symphony-2/blob/edui/symphony/content/class.sortable.php)

#### `ResourceManager` class

Introduced by @brendo, this class includes some utility methods for both Datasources and Events. The most important ones are:

1. `fetch`: List all resources (datasources or events) and sorts them by one axis if requested.
2. `getAttachedPages`: Given a resource handle, return an array of pages that are attached to that resource.
3. `attach`: Attach a resource to a given page.
4. `detach` Detach a resource from a given page.

For more info see: [class.ResourceManager.php](https://github.com/eKoeS/symphony-2/blob/edui/symphony/lib/toolkit/class.resourcemanager.php)

#### `ResourcesPage` class

An abstract class inside the `content/` directory that has been created to avoid code repetition and displays the table view for both Datasource and Event index pages.

For more info see: [class.ResourcesPage.php](https://github.com/eKoeS/symphony-2/blob/edui/symphony/content/class.resourcespage.php)

#### Miscellanea

* `PageManager::fetch` now accepts a new boolean parameter `$hierarchical`: if set true, the method returns a multidimensional array of Page information that reflects the pages hierarchy.
* If a Datasource or an Event is provided by an Extension, you'll see the Extension's name inside the `Source` column of the table view. This was suggested and first implemented by @nilshoerrmann.
* This pull request contains a fix for EDUI bug [#16](https://github.com/eKoeS/edui/issues/16) and Symphony bug #818