function ma_get_image_on_the_fly_cached($asset, $w, $h, $type = 'jpg') { if ($asset != '' && file_exists(ma_get_image_path_from_repository($asset))) { $dataImage = array(); $dataImage['asset'] = $asset; $dataImage['w'] = $w; $dataImage['h'] = $h; $dataImage['type'] = $type; $img = Image::cache(function ($image) use($dataImage) { $image->make(ma_get_image_from_repository($dataImage['asset']))->fit($dataImage['w'], $dataImage['h'])->encode($dataImage['type']); }); return 'data:image/' . $type . ';base64,' . base64_encode($img); } else { return null; } }
function containerMedia($formElement, $cssClass = "", $key) { $html = ''; $html .= "<div class=\"form-group mf0\">"; $html .= '<label for="' . $this->property['label'] . '" class="col-md-2 control-label">' . $this->property['label'] . "</label>\n"; if (isset($this->property['requiredField'])) { $html .= $this->property['requiredField'] . " "; } if (isset($this->property['extraMsg'])) { if (isset($this->property['extraMsgEnabled'])) { $this->extraMsgHandler(); } //$html.= "<span id=\"".$this->formElement."_extraMsg\" class=\"help-inline small\"> (".$this->extraMsg.")</span> "; } $html .= "<div class=\" mediaContent " . $cssClass . "\">\n"; $html .= $formElement; if ($this->model->{$key} != '') { if ($this->property['mediaType'] == 'Img') { $html .= "<div class=\"mt10 mr10 mediaBox\" id=\"box_" . $key . "_" . $this->model->id . "\">\n\t\t\t\t\t\t\t<img class=\"img-responsive imgEditThumb\" src=\"" . ma_get_image_from_repository($this->model->{$key}) . "\">\n\t\t\t\t\t\t\t" . $this->createMediaDeleteBtn($key, $this->model->id) . "</div>\n"; } else { $html .= "<div class=\"mt10 mr10\" id=\"box_" . $key . "_" . $this->model->id . "\">\n\t\t\t\t\t\t<div class=\"btn-group\" role=\"group\" aria-label=\"...\">\n\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-primary\">" . $this->model->{$key} . "</button>\n\t\t\t\t\t\t " . $this->createMediaDeleteBtn($key, $this->model->id) . "</div>\n\t\t\t\t\t\t</div>\n"; } } $html .= "</div>"; $html .= "</div>"; $html .= '<hr/>'; return $html; }
public function setOpenGraphImages() { $this->image = $this->model->image != '' ? ma_get_image_from_repository($this->model->image) : asset('public/website/images/logo.jpg'); SEO::opengraph()->addImage($this->image); }