public function getBodyContent($data)
{
if (array_key_exists(self::CALLBACK, $this->option) === FALSE) {
if (isset($data[$this->option[self::ID]]) === FALSE && is_null($data[$this->option[self::ID]]) === FALSE) {
throw new Grid_Exception('Column ' . $this->option[self::ID] . ' does not exists in DataSource.');
}
$src = $data[$this->option[self::ID]];
} else {
$args = array($data);
if (isset($this->option[self::CALLBACK_ARGS])) {
if (!is_array($this->option[self::CALLBACK_ARGS])) {
throw new Grid_Exception(__CLASS__ . '::CALLBACK_ARGS must be an array. ' . gettype($this->option[self::CALLBACK_ARGS]) . ' given.');
}
$args = array_merge($args, $this->option[self::CALLBACK_ARGS]);
}
$src = Callback::invokeArgs($this->option[self::CALLBACK], $args);
}
$img = Html::el('img', array('src' => $src));
if (isset($this->option[self::MAX_WIDTH]) === TRUE) {
$img->style('max-width:' . $this->fixPixels($this->option[self::MAX_WIDTH]), TRUE);
}
if (isset($this->option[self::MAX_HEIGHT]) === TRUE) {
$img->style('max-height:' . $this->fixPixels($this->option[self::MAX_HEIGHT]), TRUE);
}
return $img;
}