Ejemplo n.º 1
0
 protected function renderDataCellContent($row, $data)
 {
     $checked = ZurmoHtml::value($data, $this->name);
     $iconClass = $checked ? $this->checkedIcon : $this->uncheckedIcon;
     $icon = ZurmoHtml::tag('span', array('class' => 'toggle-column'), ZurmoHtml::tag('i', array('class' => $iconClass), ''));
     if (isset($this->visible) && !$this->evaluateExpression($this->visible, array('row' => $row, 'data' => $data))) {
         echo $icon;
     } else {
         echo ZurmoHtml::link($icon, $this->getUrl($data), $this->getHtmlOptions());
     }
 }
Ejemplo n.º 2
0
 /**
  * Override to add in offset information
  * (non-PHPdoc)
  * @see CDataColumn::renderDataCellContent()
  */
 protected function renderDataCellContent($row, $data)
 {
     if ($this->value !== null) {
         $pagination = $this->grid->dataProvider->getPagination();
         if (isset($pagination)) {
             $offset = $pagination->getOffset();
         } else {
             $offset = 0;
         }
         $value = $this->evaluateExpression($this->value, array('data' => $data, 'row' => $row, 'offset' => $offset + $row));
     } elseif ($this->name !== null) {
         $value = ZurmoHtml::value($data, $this->name);
     }
     if ($value === null) {
         echo $this->grid->nullDisplay;
     } else {
         echo $this->grid->getFormatter()->format($value, $this->type);
     }
 }
Ejemplo n.º 3
0
 /**
  * Override to support adding the label wrapper on the checkbox
  * (non-PHPdoc)
  * @see CCheckBoxColumn::renderDataCellContent()
  */
 protected function renderDataCellContent($row, $data)
 {
     if ($this->value !== null) {
         $value = $this->evaluateExpression($this->value, array('data' => $data, 'row' => $row));
     } elseif ($this->name !== null) {
         $value = ZurmoHtml::value($data, $this->name);
     } else {
         $value = $this->grid->dataProvider->keys[$row];
     }
     $checked = false;
     if ($this->checked !== null) {
         $checked = $this->evaluateExpression($this->checked, array('data' => $data, 'row' => $row));
     }
     $options = $this->checkBoxHtmlOptions;
     $name = $options['name'];
     unset($options['name']);
     $options['value'] = $value;
     $options['id'] = $this->id . '_' . $row;
     echo ZurmoHtml::checkBox($name, $checked, $options);
 }