Merge pull request #534 from openclassify/dia

#1387 [arabam-theme] error on new version
This commit is contained in:
Fatih Alp 2020-05-05 15:31:12 +03:00 committed by GitHub
commit b3f9041293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()