Ejemplo n.º 1
0
 public function getFormattedValue(AbstractColumn $column)
 {
     $row = $this->getRowData();
     $rowValue = $row[$column->getUniqueId()];
     if ($rowValue != '') {
         //estract
         $value = explode(self::paramsSeparator, $rowValue);
     }
     if ($this->getAttribute('href') !== null) {
         $href = $this->getAttribute('href');
     } else {
         $href = $value;
     }
     if ($this->getAttribute('path') !== null) {
         $path = $this->getAttribute('path') . "/";
     } else {
         $path = '?op=f&file=';
     }
     if ($this->getAttribute('title') !== null) {
         $title = "title={$this->getAttribute('title')}";
     } else {
         $title = '';
     }
     if ($this->getAttribute('target') !== null) {
         $target = "target={$this->getAttribute('target')}";
     } else {
         $target = '';
     }
     $linkFile = "<a href=\"{$path}{$rowValue}\"  {$title}  {$target} > {$value[1]} </a>";
     return $linkFile;
 }
Ejemplo n.º 2
0
 public function getFormattedValue(AbstractColumn $column)
 {
     $row = $this->getRowData();
     $value = $row[$column->getUniqueId()];
     $prefix = $this->getPrefix();
     if (is_array($value)) {
         $thumb = $value[0];
         if (isset($value[1])) {
             $original = $value[1];
         } else {
             $original = $thumb;
         }
     } else {
         $thumb = $value;
         $original = $value;
     }
     $linkAttributes = array();
     foreach ($this->getLinkAttributes() as $key => $value) {
         $linkAttributes[] = $key . '="' . $value . '"';
     }
     $attributes = array();
     foreach ($this->getAttributes() as $key => $value) {
         $attributes[] = $key . '="' . $value . '"';
     }
     return '<a href="' . $prefix . $original . '" ' . implode(' ', $linkAttributes) . '><img src="' . $prefix . $thumb . '" ' . implode(' ', $attributes) . ' /></a>';
 }
Ejemplo n.º 3
0
 /**
  * The value should be in bytes
  *
  * @see \Zf2datatable\Column\Formatter\AbstractFormatter::getFormattedValue()
  */
 public function getFormattedValue(AbstractColumn $column)
 {
     $row = $this->getRowData();
     $value = $row[$column->getUniqueId()];
     if ($value == '') {
         return $value;
     }
     $index = 0;
     while ($value >= 1024 && $index < count(self::$prefixes)) {
         $value = $value / 1024;
         $index++;
     }
     return sprintf('%1.2f %sB', $value, self::$prefixes[$index]);
 }
Ejemplo n.º 4
0
 public function getFormattedValue(AbstractColumn $column)
 {
     $row = $this->getRowData();
     $value = $row[$column->getUniqueId()];
     //\Zend\Debug\Debug::dump($row);
     if ($this->getAttribute('href') !== null) {
         $href = $this->getAttribute('href');
     } else {
         $href = $value;
     }
     foreach ($this->getParamFromGet() as $key => $val) {
         if (array_key_exists($key, $row)) {
             if ($val['overwriteKey'] != '') {
                 $param = $val['overwriteKey'];
             } else {
                 $param = $key;
             }
             if (preg_match('/\\?/', $href)) {
                 $href .= "&{$param}={$row[$key]}";
             } else {
                 $href .= "?{$param}={$row[$key]}";
             }
         } else {
             if (preg_match('/\\?/', $href)) {
                 $href .= "&{$param}={$val}";
             } else {
                 $href .= "?{$param}={$val}";
             }
         }
     }
     if ($this->getAttribute('title') !== null) {
         $title = "title={$this->getAttribute('title')}";
     } else {
         $title = '';
     }
     if ($this->getAttribute('target') !== null) {
         $target = "target={$this->getAttribute('target')}";
     } else {
         $target = '';
     }
     return '<a href="' . $href . '"  ' . $title . '  ' . $target . ' >' . $value . '</a>';
 }
 /**
  * Get the column row value placeholder
  * $action->setLink('/myLink/something/id/'.$action->getRowIdPlaceholder().'/something/'.$action->getColumnRowPlaceholder($myCol));
  *
  * @param  AbstractColumn $col
  * @return string
  */
 public function getColumnValuePlaceholder(AbstractColumn $col)
 {
     $this->linkColumnPlaceholders[] = $col;
     return ':' . $col->getUniqueId() . ':';
 }
Ejemplo n.º 6
0
 public function getFormattedValue(AbstractColumn $column)
 {
     $row = $this->getRowData();
     return '<a href="mailto:' . $row[$column->getUniqueId()] . '">' . $row[$column->getUniqueId()] . '</a>';
 }
Ejemplo n.º 7
0
 public function getFormattedValue(AbstractColumn $column)
 {
     $row = $this->getRowData();
     return call_user_func_array($this->getCallBack(), array($row, $column->getUniqueId()));
     //return '<a href="mailto:' . $row[$column->getUniqueId()] . '">' . $row[$column->getUniqueId()] . '</a>';
 }