29 parent::__construct($id, $instance);
42 $structure = parent::structure($id);
44 $structure[
'type'] =
new hiddenField(array(
47 'label'=>$this->_fields_label[
'type'],
51 $base_path = $this->_controller->getBaseAbsPath(
'image');
54 'name'=>
'img_filename',
55 'value'=>$this->img_filename,
56 'label'=>$this->_fields_label[
'img_filename'],
58 'extensions'=>array(
'jpg',
'png'),
60 'apply_on_thumb' =>
true,
61 'width' => $this->_controller->getImageMaxWidth(),
62 'side_dimension'=>$this->_controller->getThumbDimension()
77 return $controller->getBasePath(
'thumb').
'/'.$this->thumb;
79 elseif($this->img_filename) {
80 return $controller->getBasePath(
'image').
'/thumb_'.$this->img_filename;
83 return $controller->defaultImageThumbPath();
97 $name =
"<a href=\"".$media_base_url.
'/'.$this->
id.
"\">".$this->name.
"</a>";
99 $description = $this->description;
101 $description .=
"<p>"._(
'Tag:').
' '.$this->tags.
"</p>";
104 $credits = $this->credits;
107 $credits .=
"<br />"._(
"Licenza: ").
"<a href=\"".$license->url.
"\" target=\"_blank\">".$license->name.
"</a>";
111 thumb: '".$this->thumbPath($controller).
"',
112 img: '".$controller->getBasePath(
'image').
"/".$this->img_filename.
"',
113 title: '".jsVar($name).
"',
114 description: '".jsVar($description).
"',
115 credits: '".jsVar($credits).
"'
128 public function show($controller) {
130 $buffer =
"<img src=\"".$controller->getBasePath(
'image').
"/".$this->img_filename.
"\" alt=\"".jsVar($this->name).
"\" title=\"".jsVar($this->name).
"\"/>";