HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
TbPopoverColumn.php
Go to the documentation of this file.
1 <?php
10 Yii::import('booster.widgets.TbDataColumn');
11 
28 
37  public $options = array();
38 
45  public function renderDataCellContent($row, $data) {
46 
47  $value = '';
48  if ($this->value !== null) {
49  $value = $this->evaluateExpression($this->value, array('data' => $data, 'row' => $row));
50  } else if ($this->name !== null) {
51  $value = CHtml::value($data, $this->name);
52  }
53 
54  $htmlOptions = array('data-toggle' => 'popover');
55  foreach ($this->options as $key => $val) {
56  if($this->isAValidOption($key)) {
57  if ((!$val instanceof CJavaScriptExpression) && strpos($val, 'js:') === 0)
58  $val = new CJavaScriptExpression($val);
59  $htmlOptions['data-'.$key] = $val;
60  }
61  }
62 
63  echo CHtml::link($value, "#", $htmlOptions);
64  }
65 
66  protected function isAValidOption($option) {
67  return in_array($option, array(
68  'animation', 'html', 'placement', 'selector', 'trigger', 'title', 'content', 'delay', 'container'
69  ));
70  }
71 }