mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-08 22:36:06 -06:00
Merge pull request #534 from openclassify/dia
#1387 [arabam-theme] error on new version
This commit is contained in:
commit
b3f9041293
@ -1,13 +1,19 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule\Adv;
|
<?php namespace Visiosoft\AdvsModule\Adv;
|
||||||
|
|
||||||
|
use Anomaly\FilesModule\File\Contract\FileRepositoryInterface;
|
||||||
use Anomaly\Streams\Platform\Entry\EntryPresenter;
|
use Anomaly\Streams\Platform\Entry\EntryPresenter;
|
||||||
use Anomaly\Streams\Platform\Model\Cloudinary\CloudinaryVideoEntryModel;
|
use Anomaly\Streams\Platform\Model\Cloudinary\CloudinaryVideoEntryModel;
|
||||||
use Anomaly\Streams\Platform\Model\Users\UsersUsersEntryModel;
|
|
||||||
use Illuminate\Routing\Route;
|
|
||||||
|
|
||||||
class AdvPresenter extends EntryPresenter
|
class AdvPresenter extends EntryPresenter
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private $fileRepository;
|
||||||
|
|
||||||
|
public function __construct($object, FileRepositoryInterface $fileRepository)
|
||||||
|
{
|
||||||
|
parent::__construct($object);
|
||||||
|
$this->fileRepository = $fileRepository;
|
||||||
|
}
|
||||||
|
|
||||||
public function getViewPhotoUrl()
|
public function getViewPhotoUrl()
|
||||||
{
|
{
|
||||||
@ -22,7 +28,12 @@ class AdvPresenter extends EntryPresenter
|
|||||||
public function getMediumPhotoUrl($fullPhotoUrl)
|
public function getMediumPhotoUrl($fullPhotoUrl)
|
||||||
{
|
{
|
||||||
$mediumPhotoUrl = pathinfo($fullPhotoUrl);
|
$mediumPhotoUrl = pathinfo($fullPhotoUrl);
|
||||||
return $mediumPhotoUrl['dirname'] . '/md-' . $mediumPhotoUrl['basename'];
|
$mediumPhotoName = 'md-' . $mediumPhotoUrl['basename'];
|
||||||
|
if ($this->fileRepository->findBy('name', $mediumPhotoName)) {
|
||||||
|
return $mediumPhotoUrl['dirname'] . '/' . $mediumPhotoName;
|
||||||
|
} else {
|
||||||
|
return $fullPhotoUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isAdVideo()
|
public function isAdVideo()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user