10 Yii::import(
'zii.widgets.grid.CButtonColumn');
31 if (isset($button[
'visible']) && !$this->evaluateExpression(
33 array(
'row' => $row,
'data' =>
$data)
39 $label = isset($button[
'label']) ? $button[
'label'] : $id;
40 $url = isset($button[
'url']) ? $this->evaluateExpression($button[
'url'], array(
'data' =>
$data,
'row' => $row))
42 $options = isset($button[
'options']) ? $button[
'options'] : array();
44 if (!isset($options[
'title'])) {
45 $options[
'title'] =
$label;
49 if (!isset($options[
'class'])) {
50 $options[
'class'] =
'btn';
51 }
else if (!preg_match(
'/[^A-z\-]btn[^A-z\-]/', $options[
'class'])) {
52 $options[
'class'] =
'btn ' . $options[
'class'];
55 if (isset($button[
'icon'])) {
56 if (strpos($button[
'icon'],
'icon') ===
false && strpos($button[
'icon'],
'fa') ===
false) {
57 $button[
'icon'] =
'icon-' . implode(
' icon-', explode(
' ', $button[
'icon']));
60 echo CHtml::link(
'<i class="' . $button[
'icon'] .
'"></i>',
$url, $options);
77 foreach ($this->buttons as $id => $button) {
79 $tr[
'{' . $id .
'}'] = ob_get_contents();
84 echo
'<div class="btn-group">';
85 echo strtr($this->
template, $tr);