Commit 3755385d authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '5815-several-imageattribute-on-the-same-page-does-not-work' into '1.3-dev'

Resolve "Several ImageAttribute on the same page does not work"

See merge request fusiondirectory/fd!220
Showing with 4 additions and 3 deletions
+4 -3
...@@ -354,9 +354,10 @@ class ImageAttribute extends FileAttribute ...@@ -354,9 +354,10 @@ class ImageAttribute extends FileAttribute
$id = $this->getHtmlId(); $id = $this->getHtmlId();
// Just to be sure the image is not cached // Just to be sure the image is not cached
srand((double)microtime() * 1000000); srand((double)microtime() * 1000000);
$key = $this->getLdapName().rand(0, 10000);
$display = '<img id="'.$id.'_img"'. $display = '<img id="'.$id.'_img"'.
($this->disabled ? 'disabled="disabled"' : ''). ($this->disabled ? 'disabled="disabled"' : '').
' src="getbin.php?rand='.rand(0, 10000).'"'. ' src="getbin.php?key='.$key.'"'.
' style="border:1px solid black;"'. ' style="border:1px solid black;"'.
' alt="'.$this->getDescription().'"'. ' alt="'.$this->getDescription().'"'.
' title="'.$this->getDescription().'"'. ' title="'.$this->getDescription().'"'.
...@@ -383,9 +384,9 @@ class ImageAttribute extends FileAttribute ...@@ -383,9 +384,9 @@ class ImageAttribute extends FileAttribute
); );
} }
if (($this->getValue() == '') && ($this->placeholder != '')) { if (($this->getValue() == '') && ($this->placeholder != '')) {
session::set('binary', $this->placeholder); session::set('binary'.$key, $this->placeholder);
} else { } else {
session::set('binary', $this->getValue()); session::set('binary'.$key, $this->getValue());
} }
session::set('binarytype', 'image/'.$this->format); session::set('binarytype', 'image/'.$this->format);
return $this->renderAcl($display); return $this->renderAcl($display);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment