renderDataCellContent() защищенный Метод

protected renderDataCellContent ( $model, $key, $index )
Пример #1
0
 protected function renderDataCellContent($model, $key, $index)
 {
     $dropdownId = $this->grid->getId() . '-dropdown2-menu-' . $index;
     $this->template = implode(' ', array_keys(array_filter(['<li>{view}</li>' => ModelHelper::canRead($model), '<li>{update}</li>' => ModelHelper::canUpdate($model), '<li>{delete}</li>' => ModelHelper::canDelete($model)])));
     $fix = ['~(glyphicon\\-eye\\-open"\\>\\</span\\>)(\\</a\\>)~i' => '$1 ' . Yii::t('mozayka', 'View') . '$2', '~(glyphicon\\-pencil"\\>\\</span\\>)(\\</a\\>)~i' => '$1 ' . Yii::t('mozayka', 'Update') . '$2', '~(glyphicon\\-trash"\\>\\</span\\>)(\\</a\\>)~i' => '$1 ' . Yii::t('mozayka', 'Delete') . '$2', '~\\s+title\\="[^"]*"~i' => '', '~\\s+data\\-confirm\\="[^"]*"~i' => '', '~\\s+data\\-method\\="[^"]*"~i' => ''];
     $cellContent = preg_replace(array_keys($fix), array_values($fix), parent::renderDataCellContent($model, $key, $index));
     // dropdown2-menu
     if ($cellContent && $cellContent != $this->grid->emptyCell) {
         $cellContent = Html::button('<span class="glyphicon glyphicon-cog"></span>', ['title' => Yii::t('mozayka', 'Actions'), 'class' => 'btn btn-default btn-xs', 'data-dropdown2' => '#' . $dropdownId]) . Html::tag('div', Html::tag('ul', $cellContent, ['class' => 'dropdown2-menu']), ['id' => $dropdownId, 'class' => 'dropdown2 dropdown2-tip' . (array_search($this, $this->grid->columns) + 1 > count($this->grid->columns) / 2 ? ' dropdown2-anchor-right' : '')]);
     }
     return $cellContent;
 }
Пример #2
0
 /**
  * Renders the data cell.
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     $content = parent::renderDataCellContent($model, $key, $index);
     $options = $this->dropdownButton;
     if ($this->_isDropdown) {
         $label = ArrayHelper::remove($options, 'label', Yii::t('kvgrid', 'Actions'));
         $caret = ArrayHelper::remove($options, 'caret', ' <span class="caret"></span>');
         $options = ArrayHelper::merge($options, ['type' => 'button', 'data-toggle' => 'dropdown']);
         Html::addCssClass($options, 'dropdown-toggle');
         $button = Html::button($label . $caret, $options);
         Html::addCssClass($this->dropdownMenu, 'dropdown-menu');
         $dropdown = $button . PHP_EOL . Html::tag('ul', $content, $this->dropdownMenu);
         return Html::tag('div', $dropdown, ['class' => 'dropdown']);
     }
     return $content;
 }
Пример #3
0
 protected function renderDataCellContent($model, $key, $index)
 {
     $renderDataCellContent = parent::renderDataCellContent($model, $key, $index);
     return Html::tag('div', $renderDataCellContent, ['class' => 'bk-elementActions']) . Html::tag('div', '', ['class' => 'clearfix']);
 }
 /**
  * @inheritdoc
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     //update the value of the template string for the current row
     if ($this->templateInternal !== null) {
         $this->template = call_user_func($this->templateInternal, $model, $key, $index);
     }
     return parent::renderDataCellContent($model, $key, $index);
 }