RyanThompson/AIWS — pull request #15 by obrignoni (2013-06-19 00:27:03+00:00)
Title: Button attributes support and extra goodies

Adresses #5.

Added buttons_group.php view.
Supports:
* Attributes
* pass row data and uri segment replacements
* button dropdowns
* button groups
* icons

## Examples

### Example - Attributes

There is a number of reserved keys: `label`, `uri`, `href`, `icon`, `dropdown_buttons`, `group_buttons`, `dropdown_class`.

Everything else becomes an attribute. I did it this way instead of putting a sub array of attributes because it didn't look developer friendly. This way we keep the array looking simple and not to much multidimensional.

```php
$buttons = array(
array(
'label' => 'lang:global:add', // the standard is label it is passed through lang_label()
'uri' => 'admin/monkeys/add', // example uri
'href' => '#add', // you can use href instead of uri to pass a hash.
'icon' => 'plus', // this will prepend to the button label.
'class' => 'btn-primary',
'data-toggle' => 'modal', // everything else becomes a attribute.
'dropdown_buttons' => array(
... same array as the parent button, except no additional dropdown levels
)
),
button array 2 ...,
button array 3 ...
);
```

### Example - Row data and uri segment replacements

```php
$data['row'] = $monkey;

$data['uri_replacements'] = array('-entry_id-' => 'id');

$data['buttons'] = array(
array(
'label' => 'lang:global:delete',
'uri' => 'admin/monkeys/delete/-entry_id-', // example uri
'icon' => 'minus',
'class' => 'btn-danger',
)
);

$this->load->view('admin/partials/buttons_group', $data);
```