10 Yii::import(
'booster.widgets.TbButtonColumn');
50 if ($this->viewButtonContext !==
false && !isset($this->buttons[
'view'][
'context'])) {
53 if ($this->updateButtonContext !==
false && !isset($this->buttons[
'update'][
'context'])) {
56 if ($this->deleteButtonContext !==
false && !isset($this->buttons[
'delete'][
'context'])) {
74 if (isset($button[
'visible']) && !$this->evaluateExpression(
76 array(
'row' => $row,
'data' =>
$data)
82 $label = isset($button[
'label']) ? $button[
'label'] : $id;
83 $url = isset($button[
'url']) ? $this->evaluateExpression($button[
'url'], array(
'data' =>
$data,
'row' => $row))
85 $options = isset($button[
'options']) ? $button[
'options'] : array();
87 if (!isset($options[
'title'])) {
88 $options[
'title'] =
$label;
91 if (!isset($options[
'data-toggle'])) {
92 $options[
'data-toggle'] =
'tooltip';
95 if (!isset($options[
'class'])) {
96 $options[
'class'] =
'';
99 if (isset($button[
'context'])) {
100 $options[
'class'] .=
' btn-' . $button[
'context'];
103 if (isset($button[
'icon'])) {
104 if (strpos($button[
'icon'],
'icon') ===
false && strpos($button[
'icon'],
'fa') ===
false) {
105 $button[
'icon'] =
'icon-' . implode(
' icon-', explode(
' ', $button[
'icon']));
108 echo CHtml::link(
'<i class="' . $button[
'icon'] .
'"></i>',
$url, $options);
109 }
else if (isset($button[
'imageUrl']) && is_string($button[
'imageUrl'])) {
110 echo CHtml::link(CHtml::image($button[
'imageUrl'],
$label),
$url, $options);
129 foreach ($this->buttons as $id => $button) {
131 $tr[
'{' . $id .
'}'] = ob_get_contents();
135 echo
"<div class='btn-group'>" . strtr($this->
template, $tr) .
"</div>";