HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
TbJsonGridColumn.php
Go to the documentation of this file.
1 <?php
10 Yii::import('booster.widgets.TbDataColumn');
11 
23 {
24 
28  public function renderHeaderCell()
29  {
30  if ($this->grid->json) {
31  $header = array('id' => $this->id);
32  $content = array();
33  if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
34  $sort = $this->grid->dataProvider->getSort();
35  $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);
36 
37  if ($sort->resolveAttribute($this->name) !== false) {
38  $label .= '<span class="caret"></span>';
39  }
40  $content['content'] = $sort->link($this->name, $label, array('class' => 'sort-link'));
41  } else {
42  if ($this->name !== null && $this->header === null) {
43  if ($this->grid->dataProvider instanceof CActiveDataProvider) {
44  $content['content'] = CHtml::encode(
45  $this->grid->dataProvider->model->getAttributeLabel($this->name)
46  );
47  } else {
48  $content['content'] = CHtml::encode($this->name);
49  }
50  } else {
51  $content['content'] = trim($this->header) !== '' ? $this->header
52  : $this->grid->blankDisplay;
53  }
54  }
55  return CMap::mergeArray($header, $content);
56  }
58  }
59 }