cakephp/debug_kit — pull request #57 by kamisama (2012-10-02 20:37:55+00:00)
Title: New skin

![New Skin](http://desmond.imageshack.us/Himg29/scaled.php?server=29&filename=debugkitnewskin.png&res=landing)

There's some majors changes besides the visual aspect:

### New priority property

Add `$priority` property to DebugPanel class. Priority defines the importance of the panel :
- 0 means 'minor', panel is put on the left side, with a bland title.
- 1 and greater means 'important', and the panel is on the right side, with a summary title. `$priority` can take any number, and can be used to order the panels. Important panels are ordered from left to right, from priority 1 to n.

It can also be defined from the controller :
```php
public $components = array(
'DebugKit.Toolbar' => array(
'panels' => array('history' => array('priority) => 1)
)
);
```
By default, these panels have a priority greater than
- SqlLog
- Timer
- Variables

### Use Blocks for displaying panels contents

All panels' content are put in a **panelContent** block, and are displayed with an `echo $this->fetch('panelContent')` in *debug_toolbar.ctp*.

Panel can also override the title, by assigning something to **panelTitle** block. The original title is available in the panel's element, via `$title`.

Panel priority is also available inside panel's element with `$priority`.

### Panel title

When pertinent, panels should set the `title` to something else when priority greater than 0.
This can be done inside the Panel class, in `beforeRender()`, or inside the panel's elements, by overiding the **panelTitle** block.

Some panels will always have the same title, regarding of the priority, because there's nothing more to display.
e.g. Request, Session, Environment panels.

Currently, among the panels with priority 0, only the *include* panel has a different title when its priority greater than 0 (display the number of included files). Promoting other panels will just move the panel to the right side.

### Notes

Var panel title doesn't reflect the total number of variables in the views. It does not takes into account the global vars :
- $title_for_layout
- $request->data
- $this->validationErrors
- Loaded helpers

I have also split the variables list inside the panel into 2 blocks.

### Room for improvement

- Panel title can be set in the Panel class and the panel element. Don't know if it's a good practice.
- Maybe just display an icon for the panel on the left side.
- Test new CSS with IE. It works on the last Safari, Firefox and Chrome.

### Known issues

- Panels ordering doesn't keep order for same priority panels