Esempio n. 1
0
 /**
  * @param Parameter $parameter
  * @param null|Image $value
  * @return string
  */
 public function render(Parameter $parameter, $value)
 {
     return $this->renderImagePreservation($parameter, $value ? $value->getFile() : null) . new Element('div', ['class' => 'image-cropper'], [new Element('label', [], [new Element('span', ['class' => 'btn btn-success'], ['Choose Image']), new Element("input", array_merge(['class' => 'sr-only image-input', "type" => "file"], $parameter->isRequired() && is_null($value) ? ['required' => 'required'] : []))]), new Element('span', ['class' => 'btn btn-success take-photo'], ['Take Photo']), new Element('div', ['class' => 'photo-preview-container', 'style' => 'display: none; text-align: center;'], [new Element('p', [], ['Click on the preview to take a photo.']), new Element('div', ['class' => 'photo-preview', 'style' => 'margin: auto;'])]), new Element("input", ['type' => 'hidden', 'class' => "image-data", 'name' => $parameter->getName() . '[encoded]']), new Element('div', ['class' => 'image-container', 'style' => 'display: none;'], [new Element('div', ['class' => 'form-group image-controls'], $this->renderControls()), new Element('img', ['class' => 'image-placeholder'])])]);
 }
Esempio n. 2
0
 /**
  * @param Image $value
  * @return string
  */
 public function render($value)
 {
     return parent::render($value->getFile());
 }
Esempio n. 3
0
 /**
  * @param Author-ID $email
  * @param Image $picture
  */
 public function changePicture($email, Image $picture)
 {
     $author = $this->authors->read($email);
     $author->setPicture($picture->getFile());
     $this->authors->update($author);
 }