Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleanup

  • Loading branch information...
commit 238ba757c9897dc6abf580f49b353bdead530b5e 1 parent 3d56ac6
@krispypen krispypen authored
Showing with 49 additions and 360 deletions.
  1. +2 −4 Controller/AviaryController.php
  2. +0 −1  Controller/ChooserController.php
  3. +0 −57 Controller/FolderController.php
  4. +0 −18 Controller/MediaController.php
  5. +0 −8 DataFixtures/ORM/FolderFixtures.php
  6. +0 −1  DependencyInjection/Configuration.php
  7. +0 −2  DependencyInjection/KunstmaanMediaExtension.php
  8. +0 −5 Entity/Folder.php
  9. +0 −1  Entity/Media.php
  10. +0 −1  Form/FolderType.php
  11. +4 −8 Form/Type/MediaType.php
  12. +0 −3  Helper/BulkUploadHelper.php
  13. +4 −32 Helper/File/FileHandler.php
  14. +1 −30 Helper/Image/ImageHandler.php
  15. +0 −23 Helper/Manipulator/ImageManipulatorInterface.php
  16. +0 −77 Helper/Manipulator/ImagineImageManipulator.php
  17. +14 −15 Helper/Media/AbstractMediaHandler.php
  18. +1 −5 Helper/MediaManager.php
  19. +0 −4 Helper/Menu/MediaMenuAdaptor.php
  20. +4 −21 Helper/RemoteSlide/RemoteSlideHandler.php
  21. +3 −11 Helper/RemoteSlide/RemoteSlideHelper.php
  22. +3 −15 Helper/RemoteVideo/RemoteVideoHandler.php
  23. +5 −6 Repository/FolderRepository.php
  24. +0 −2  Repository/MediaRepository.php
  25. +1 −6 Resources/config/handlers.yml
  26. +3 −1 Resources/docs/aviaryImageEditor.md
  27. +2 −1  Resources/docs/mediaField.md
  28. +2 −2 composer.json
View
6 Controller/AviaryController.php
@@ -2,15 +2,13 @@
namespace Kunstmaan\MediaBundle\Controller;
-use Kunstmaan\MediaBundle\Helper\File\FileHelper;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-use Kunstmaan\MediaBundle\Entity\Image;
use Kunstmaan\MediaBundle\Entity\Folder;
-use Kunstmaan\MediaBundle\Helper\MediaHelper;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\RedirectResponse;
+use Kunstmaan\MediaBundle\Entity\Media;
+use Kunstmaan\MediaBundle\Helper\MediaManager;
/**
* controllerclass which Aviary can use to upload the edited image and add it to the database
View
1  Controller/ChooserController.php
@@ -3,7 +3,6 @@
namespace Kunstmaan\MediaBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-use Kunstmaan\MediaBundle\Form\FolderType;
use Kunstmaan\MediaBundle\Entity\Folder;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
View
57 Controller/FolderController.php
@@ -2,20 +2,11 @@
namespace Kunstmaan\MediaBundle\Controller;
-use Kunstmaan\MediaBundle\AdminList\MediaListConfigurator;
-
use Symfony\Component\HttpFoundation\Response;
-use Kunstmaan\AdminListBundle\AdminList\AdminList;
-use Kunstmaan\MediaBundle\Helper\FolderFactory;
-use Kunstmaan\MediaBundle\Entity\Video;
-use Kunstmaan\MediaBundle\Entity\Slide;
-use Kunstmaan\MediaBundle\Entity\Image;
-use Kunstmaan\MediaBundle\Entity\File;
use Kunstmaan\MediaBundle\Entity\Folder;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Kunstmaan\MediaBundle\Form\FolderType;
-use Kunstmaan\MediaBundle\Form\SubFolderType;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
@@ -115,52 +106,4 @@ public function subCreateAction($folderId)
));
}
- /**
- * @Route("/movenodes", name="KunstmaanMediaBundle_folder_movenodes")
- * @Method({"GET", "POST"})
- *
- * @return array
- */
- public function moveNodesAction()
- {
- $request = $this->getRequest();
- $em = $this->getDoctrine()->getManager();
-
- /* @var string $parentid */
- $parentid = $request->get('parentid');
- /* @var Folder $parent */
- $parent = $em->getRepository('KunstmaanMediaBundle:Folder')->getFolder($parentid);
-
- /* @var int $fromposition */
- $fromposition = $request->get('fromposition');
- /* @var int $afterposition */
- $afterposition = $request->get('afterposition');
-
- foreach ($parent->getChildren() as $child) {
- if ($child->getSequencenumber() == $fromposition) {
- if ($child->getSequencenumber() > $afterposition) {
- $child->setSequencenumber($afterposition + 1);
- $em->persist($child);
- } else {
- $child->setSequencenumber($afterposition);
- $em->persist($child);
- }
- } else {
- if ($child->getSequencenumber() > $fromposition && $child->getSequencenumber() <= $afterposition) {
- $newpos = $child->getSequencenumber()-1;
- $child->setSequencenumber($newpos);
- $em->persist($child);
- } else {
- if ($child->getSequencenumber() < $fromposition && $child->getSequencenumber() > $afterposition) {
- $newpos = $child->getSequencenumber()+1;
- $child->setSequencenumber($newpos);
- $em->persist($child);
- }
- }
- }
- $em->flush();
- }
-
- return array("success" => true);
- }
}
View
18 Controller/MediaController.php
@@ -4,25 +4,10 @@
use Symfony\Component\HttpFoundation\Response;
-use Kunstmaan\MediaBundle\Entity\AbstractMediaMetadata;
-use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
-
-use Kunstmaan\AdminBundle\Helper\ClassLookup;
-use Kunstmaan\MediaBundle\Event\MediaEvent;
-use Kunstmaan\MediaBundle\Event\Events;
use Kunstmaan\MediaBundle\Form\BulkUploadType;
-use Doctrine\ORM\EntityRepository;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Kunstmaan\MediaBundle\Entity\Media;
-use Kunstmaan\MediaBundle\Form\VideoType;
-use Kunstmaan\MediaBundle\Entity\Video;
-use Kunstmaan\MediaBundle\Form\SlideType;
-use Kunstmaan\MediaBundle\Entity\Slide;
-use Kunstmaan\MediaBundle\Entity\Image;
-use Kunstmaan\MediaBundle\Entity\File;
-use Kunstmaan\MediaBundle\Form\MediaType;
-use Kunstmaan\MediaBundle\Helper\MediaHelper;
use Kunstmaan\MediaBundle\Helper\BulkUploadHelper;
use Kunstmaan\MediaBundle\Entity\Folder;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
@@ -164,11 +149,8 @@ public function dropAction($folderId)
/* @var Folder $folder */
$folder = $em->getRepository('KunstmaanMediaBundle:Folder')->getFolder($folderId);
- $request = $this->getRequest();
-
$drop = null;
if (array_key_exists('files', $_FILES) && $_FILES['files']['error'] == 0 ) {
- $pic = $_FILES['files'];
$drop = $this->getRequest()->files->get('files');
} else {
$drop = $this->getRequest()->get('text');
View
8 DataFixtures/ORM/FolderFixtures.php
@@ -2,14 +2,6 @@
namespace Kunstmaan\MediaBundle\DataFixtures\ORM;
-use Kunstmaan\MediaBundle\Helper\RemoteVideo\RemoteVideoHelper;
-
-use Kunstmaan\MediaBundle\Entity\Media;
-
-use Kunstmaan\MediaBundle\Entity\FileGallery;
-use Kunstmaan\MediaBundle\Entity\SlideGallery;
-use Kunstmaan\MediaBundle\Entity\VideoGallery;
-use Kunstmaan\MediaBundle\Entity\ImageGallery;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Kunstmaan\MediaBundle\Entity\Folder;
View
1  DependencyInjection/Configuration.php
@@ -3,7 +3,6 @@
namespace Kunstmaan\MediaBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
-use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
View
2  DependencyInjection/KunstmaanMediaExtension.php
@@ -3,9 +3,7 @@
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader;
-use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
View
5 Entity/Folder.php
@@ -3,14 +3,9 @@
namespace Kunstmaan\MediaBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
-
-use Doctrine\ORM\EntityManager;
use Kunstmaan\AdminBundle\Entity\AbstractEntity;
-use Kunstmaan\MediaBundle\Form\FolderType;
-use Kunstmaan\MediaBundle\Helper\FolderStrategy;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
-use Gedmo\Translatable\Translatable;
/**
* Class that defines a folder from the MediaBundle in the database
View
1  Entity/Media.php
@@ -5,7 +5,6 @@
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser;
use Kunstmaan\AdminBundle\Entity\AbstractEntity;
-use Assetic\Asset\FileAsset;
/**
* Media
View
1  Form/FolderType.php
@@ -9,7 +9,6 @@
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\AbstractType;
-use Kunstmaan\MediaBundle\Entity\File;
/**
* FolderType
View
12 Form/Type/MediaType.php
@@ -3,16 +3,12 @@
namespace Kunstmaan\MediaBundle\Form\Type;
use Symfony\Component\Form\FormView;
-
use Symfony\Component\Form\FormInterface;
-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
-
use Symfony\Component\Form\FormBuilderInterface;
-
use Symfony\Component\Form\AbstractType;
-
use Doctrine\Common\Persistence\ObjectManager;
+use Kunstmaan\MediaBundle\Helper\MediaManager;
/**
* MediaType
@@ -96,8 +92,8 @@ public function getName()
*/
public function buildView(FormView $view, FormInterface $form, array $options)
{
- $view->set('chooser', $form->getAttribute('chooser'));
- $view->set('mediatype', $form->getAttribute('mediatype'));
- $view->set('mediamanager', $this->mediaManager);
+ $view->vars['chooser'] = $form->getAttribute('chooser');
+ $view->vars['mediatype'] = $form->getAttribute('mediatype');
+ $view->vars['mediamanager'] = $this->mediaManager;
}
}
View
3  Helper/BulkUploadHelper.php
@@ -2,10 +2,7 @@
namespace Kunstmaan\MediaBundle\Helper;
-use Kunstmaan\MediaBundle\Entity\Media;
-
use Symfony\Component\HttpFoundation\File\UploadedFile;
-use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException;
/**
* BulkUploadHelper
View
36 Helper/File/FileHandler.php
@@ -3,30 +3,14 @@
namespace Kunstmaan\MediaBundle\Helper\File;
use Kunstmaan\MediaBundle\Helper\Media\AbstractMediaHandler;
-
use Kunstmaan\MediaBundle\Form\File\FileType;
-
use Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser;
-
use Gaufrette\Filesystem;
-
use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser;
-
use Gaufrette\Adapter\Local;
-
use Symfony\Component\HttpFoundation\File\File;
-
use Kunstmaan\MediaBundle\Entity\Media;
-
-use Kunstmaan\MediaBundle\Helper\StrategyInterface;
-
-use Kunstmaan\MediaBundle\Entity\Folder;
-
-use Doctrine\ORM\EntityManager;
-use Kunstmaan\MediaBundle\Entity\VideoGallery;
-use Kunstmaan\MediaBundle\Form\VideoType;
-use Kunstmaan\MediaBundle\AdminList\VideoListConfigurator;
-use Kunstmaan\MediaBundle\Entity\Video;
+use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
/**
* FileHandler
@@ -75,7 +59,7 @@ public function getType()
}
/**
- * @return \Kunstmaan\MediaBundle\Form\VideoType
+ * @return FileType
*/
public function getFormType()
{
@@ -99,7 +83,7 @@ public function canHandle(Media $media)
/**
* @param Media $media
*
- * @return Video
+ * @return FileHelper
*/
public function getFormHelper(Media $media)
{
@@ -171,18 +155,6 @@ public function getOriginalFile(Media $media)
*/
public function removeMedia(Media $media)
{
- foreach ($this->formats as $format => $options) {
- $path = $this->generateRelativePath($media, $format);
- if ($this->getFilesystem()->has($path)) {
- $this->getFilesystem()->delete($path);
- }
- }
-
- // Original
- $path = $this->getOriginalFilePath($media);
- if ($this->getFilesystem()->has($path)) {
- $this->getFilesystem()->delete($path);
- }
}
/**
@@ -220,7 +192,7 @@ public function getShowTemplate(Media $media)
}
/**
- * @return multitype:string
+ * @return array
*/
public function getAddFolderActions()
{
View
31 Helper/Image/ImageHandler.php
@@ -2,55 +2,26 @@
namespace Kunstmaan\MediaBundle\Helper\Image;
-use Kunstmaan\MediaBundle\Helper\Manipulator\ImageManipulatorInterface;
-
use Kunstmaan\MediaBundle\Helper\File\FileHandler;
-
-use Kunstmaan\MediaBundle\Form\File\FileType;
-
use Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser;
-
-use Gaufrette\Filesystem;
-
use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser;
-
-use Gaufrette\Adapter\Local;
-
-use Symfony\Component\HttpFoundation\File\File;
-
use Kunstmaan\MediaBundle\Entity\Media;
-use Kunstmaan\MediaBundle\Helper\StrategyInterface;
-
-use Kunstmaan\MediaBundle\Entity\Folder;
-
-use Doctrine\ORM\EntityManager;
-use Kunstmaan\MediaBundle\Entity\VideoGallery;
-use Kunstmaan\MediaBundle\Form\VideoType;
-use Kunstmaan\MediaBundle\AdminList\VideoListConfigurator;
-use Kunstmaan\MediaBundle\Entity\Video;
-
/**
* FileHandler
*/
class ImageHandler extends FileHandler
{
- /**
- * @var ImageManipulatorInterface
- */
- protected $imageManipulator;
-
protected $aviaryApiKey;
/**
* @param ImageManipulatorInterface $imageManipulator The image manipulator
* @param string $aviaryApiKey The aviary key
*/
- public function __construct(ImageManipulatorInterface $imageManipulator, $aviaryApiKey)
+ public function __construct($aviaryApiKey)
{
parent::__construct();
- $this->imageManipulator = $imageManipulator;
$this->aviaryApiKey = $aviaryApiKey;
}
View
23 Helper/Manipulator/ImageManipulatorInterface.php
@@ -1,23 +0,0 @@
-<?php
-
-namespace Kunstmaan\MediaBundle\Helper\Manipulator;
-
-use Kunstmaan\MediaBundle\Entity\Media;
-use Gaufrette\File;
-
-/**
- * ImageManipulatorInterface
- */
-interface ImageManipulatorInterface
-{
- const RESIZE_MODE_OUTBOUND = 'outbound';
- const RESIZE_MODE_INSET = 'inset';
-
- /**
- * @param Media $media Media
- * @param File $fromFile From file
- * @param File $toFile To file
- * @param array $options Options
- */
- public function resize(Media $media, File $fromFile, File $toFile, $options = array());
-}
View
77 Helper/Manipulator/ImagineImageManipulator.php
@@ -1,77 +0,0 @@
-<?php
-
-namespace Kunstmaan\MediaBundle\Helper\Manipulator;
-use Kunstmaan\MediaBundle\Entity\Media;
-use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser;
-use Imagine\Image\ImagineInterface;
-use Imagine\Image\ImageInterface;
-use Imagine\Image\Box;
-use Gaufrette\File;
-
-/**
- * ImagineImageManipulator
- */
-class ImagineImageManipulator implements ImageManipulatorInterface
-{
- /**
- * @var ImagineInterface
- */
- protected $imagine;
-
- /**
- * @param ImagineInterface $imagine
- */
- public function __construct(ImagineInterface $imagine)
- {
- $this->imagine = $imagine;
- }
-
- /**
- * {@inheritDoc}
- */
- public function resize(Media $media, File $fromFile, File $toFile, $options = array())
- {
- if (!array_key_exists('quality', $options)) {
- $options['quality'] = 100;
- }
-
- $mode = isset($options['mode']) ? $options['mode'] : self::RESIZE_MODE_OUTBOUND;
- $width = isset($options['width']) ? (int) $options['width'] : null;
- $height = isset($options['height']) ? (int) $options['height'] : null;
-
- if (!is_numeric($width) && !is_numeric($height)) {
- throw new \InvalidArgumentException('You must specify at least a width and/or an height value');
- }
-
- $metadata = $media->getMetadata();
- if (null !== $width && null == $height) {
- $height = (int) ($width * $metadata['height'] / $metadata['width']);
- } else if (null == $width) {
- $width = (int) ($height * $metadata['width'] / $metadata['height']);
- }
-
- if ($metadata['width'] < $width && $metadata['height'] < $height) {
- $width = (int) $metadata['width'];
- $height = (int) $metadata['height'];
- }
-
- switch ($mode) {
- case self::RESIZE_MODE_OUTBOUND:
- $mode = ImageInterface::THUMBNAIL_OUTBOUND;
- break;
-
- case self::RESIZE_MODE_INSET:
- $mode = ImageInterface::THUMBNAIL_INSET;
- break;
-
- default:
- $mode = ImageInterface::THUMBNAIL_OUTBOUND;
- }
-
- $image = $this->imagine->load($fromFile->getContent());
- $manipulatorInterface = $image->thumbnail(new Box($width, $height), $mode);
- $output = $manipulatorInterface->get(ExtensionGuesser::guess($media->getContentType()), $options);
-
- $toFile->setContent($output);
- }
-}
View
29 Helper/Media/AbstractMediaHandler.php
@@ -3,15 +3,9 @@
namespace Kunstmaan\MediaBundle\Helper\Media;
-use Kunstmaan\AdminListBundle\AdminList\AbstractAdminListConfigurator;
-
use Kunstmaan\MediaBundle\Entity\Media;
-use Kunstmaan\MediaBundle\Entity\Folder;
-
use Symfony\Component\Form\AbstractType;
-use Doctrine\ORM\EntityManager;
-
/**
* AbstractMediaHandler
*/
@@ -81,15 +75,20 @@ public function getShowTemplate(Media $media)
return 'KunstmaanMediaBundle:Media:show.html.twig';
}
- /**
- * @param Media $media The media entity
- * @param string $basepath The base path
- *
- * @return string
- */
- public function getImageUrl(Media $media, $basepath)
- {
- return null;
+ /**
+ * @param Media $media The media entity
+ * @param string $basepath The base path
+ *
+ * @return string
+ */
+ public function getImageUrl(Media $media, $basepath)
+ {
+ return null;
}
+ /**
+ * @return array
+ */
+ public abstract function getAddFolderActions();
+
}
View
6 Helper/MediaManager.php
@@ -5,10 +5,6 @@
use Kunstmaan\MediaBundle\Helper\Media\AbstractMediaHandler;
use Kunstmaan\MediaBundle\Entity\Media;
-use Kunstmaan\MediaBundle\Entity\MediaContext;
-use Kunstmaan\MediaBundle\Helper\Cdn\CdnInterface;
-use Kunstmaan\MediaBundle\Helper\Provider\ProviderInterface;
-use Gaufrette\Filesystem;
/**
* MediaManager
@@ -16,7 +12,7 @@
class MediaManager
{
/**
- * @var array
+ * @var AbstractMediaHandler[]
*/
protected $handlers = array();
View
4 Helper/Menu/MediaMenuAdaptor.php
@@ -8,10 +8,6 @@
use Kunstmaan\AdminBundle\Helper\Menu\MenuAdaptorInterface;
use Kunstmaan\AdminBundle\Helper\Menu\MenuBuilder;
use Kunstmaan\AdminBundle\Helper\Menu\TopMenuItem;
-use Symfony\Component\Translation\Translator;
-use Knp\Menu\FactoryInterface;
-use Symfony\Component\DependencyInjection\ContainerAware;
-use Knp\Menu\ItemInterface as KnpMenu;
use Kunstmaan\MediaBundle\Entity\Media;
use Kunstmaan\MediaBundle\Entity\Folder;
View
25 Helper/RemoteSlide/RemoteSlideHandler.php
@@ -3,21 +3,9 @@
namespace Kunstmaan\MediaBundle\Helper\RemoteSlide;
use Kunstmaan\MediaBundle\Form\RemoteSlide\RemoteSlideType;
-
use Kunstmaan\MediaBundle\Helper\Media\AbstractMediaHandler;
-
use Kunstmaan\MediaBundle\Entity\Media;
-use Kunstmaan\MediaBundle\Helper\StrategyInterface;
-
-use Kunstmaan\MediaBundle\Entity\Folder;
-
-use Doctrine\ORM\EntityManager;
-use Kunstmaan\MediaBundle\Entity\VideoGallery;
-use Kunstmaan\MediaBundle\Form\VideoType;
-use Kunstmaan\MediaBundle\AdminList\VideoListConfigurator;
-use Kunstmaan\MediaBundle\Entity\Video;
-
/**
* RemoteSlideStrategy
*/
@@ -48,7 +36,7 @@ public function getType()
}
/**
- * @return \Kunstmaan\MediaBundle\Form\VideoType
+ * @return RemoteSlideType
*/
public function getFormType()
{
@@ -72,7 +60,7 @@ public function canHandle(Media $media)
/**
* @param Media $media
*
- * @return Video
+ * @return RemoteSlideHelper
*/
public function getFormHelper(Media $media)
{
@@ -97,12 +85,7 @@ public function prepareMedia(Media $media)
case 'slideshare':
try {
$json = json_decode(file_get_contents('http://www.slideshare.net/api/oembed/2?url=http://www.slideshare.net/slideshow/embed_code/'.$code.'&format=json'));
- $thumbnailUrl = 'http:'.$json->thumbnail;
- /* dirty hack to fix urls for imagine */
- if (!endsWith($thumbnailUrl, '.jpg') && !endsWith($thumbnailUrl, '.png')) {
- $thumbnailUrl = $thumbnailUrl.'&ext=.jpg';
- }
- $slide->setThumbnailUrl($thumbnailUrl);
+ $slide->setThumbnailUrl('http:'.$json->thumbnail);
} catch (\ErrorException $e) {
}
break;
@@ -200,7 +183,7 @@ public function getImageUrl(Media $media, $basepath)
}
/**
- * @return multitype:string
+ * @return array
*/
public function getAddFolderActions()
{
View
14 Helper/RemoteSlide/RemoteSlideHelper.php
@@ -66,7 +66,7 @@ public function getCode()
* Set code
* @param string $code
*
- * @return RemoteVideoHelper
+ * @return RemoteSlideHelper
*/
public function setCode($code)
{
@@ -91,7 +91,7 @@ public function getThumbnailUrl()
* Set thumbnail url
* @param string $url
*
- * @return RemoteVideoHelper
+ * @return RemoteSlideHelper
*/
public function setThumbnailUrl($url)
{
@@ -114,7 +114,7 @@ public function getType()
* Set type
* @param string $type
*
- * @return RemoteVideoHelper
+ * @return RemoteSlideHelper
*/
public function setType($type)
{
@@ -123,12 +123,4 @@ public function setType($type)
return $this;
}
- /**
- * {@inheritDoc}
- */
- public function updateMedia(Media $media)
- {
- $this->saveMedia($media);
- }
-
}
View
18 Helper/RemoteVideo/RemoteVideoHandler.php
@@ -3,21 +3,9 @@
namespace Kunstmaan\MediaBundle\Helper\RemoteVideo;
use Kunstmaan\MediaBundle\Form\RemoteVideo\RemoteVideoType;
-
use Kunstmaan\MediaBundle\Helper\Media\AbstractMediaHandler;
-
use Kunstmaan\MediaBundle\Entity\Media;
-use Kunstmaan\MediaBundle\Helper\StrategyInterface;
-
-use Kunstmaan\MediaBundle\Entity\Folder;
-
-use Doctrine\ORM\EntityManager;
-use Kunstmaan\MediaBundle\Entity\VideoGallery;
-use Kunstmaan\MediaBundle\Form\VideoType;
-use Kunstmaan\MediaBundle\AdminList\VideoListConfigurator;
-use Kunstmaan\MediaBundle\Entity\Video;
-
/**
* RemoteVideoStrategy
*/
@@ -51,7 +39,7 @@ public function getType()
}
/**
- * @return \Kunstmaan\MediaBundle\Form\VideoType
+ * @return RemoteVideoType
*/
public function getFormType()
{
@@ -75,7 +63,7 @@ public function canHandle(Media $media)
/**
* @param Media $media
*
- * @return Video
+ * @return RemoteVideoHelper
*/
public function getFormHelper(Media $media)
{
@@ -241,7 +229,7 @@ public function getImageUrl(Media $media, $basepath)
}
/**
- * @return multitype:string
+ * @return array
*/
public function getAddFolderActions()
{
View
11 Repository/FolderRepository.php
@@ -3,7 +3,6 @@
namespace Kunstmaan\MediaBundle\Repository;
use Kunstmaan\MediaBundle\Entity\Folder;
-use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\EntityNotFoundException;
@@ -30,7 +29,7 @@ public function delete(Folder $folder)
{
$em = $this->getEntityManager();
- $this->deleteFiles($folder, $em);
+ $this->deleteMedia($folder, $em);
$this->deleteChildren($folder, $em);
$folder->setDeleted(true);
$em->persist($folder);
@@ -40,11 +39,11 @@ public function delete(Folder $folder)
/**
* @param Folder $folder
*/
- public function deleteFiles(Folder $folder)
+ public function deleteMedia(Folder $folder)
{
$em = $this->getEntityManager();
- foreach ($folder->getFiles() as $item) {
+ foreach ($folder->getMedia() as $item) {
$item->setDeleted(true);
$em->persist($item);
$em->remove($item);
@@ -59,7 +58,7 @@ public function deleteChildren(Folder $folder)
$em = $this->getEntityManager();
foreach ($folder->getChildren() as $child) {
- $this->deleteFiles($child, $em);
+ $this->deleteMedia($child, $em);
$this->deleteChildren($child, $em);
$child->setDeleted(true);
$em->persist($child);
@@ -67,7 +66,7 @@ public function deleteChildren(Folder $folder)
}
/**
- * @param null $limit
+ * @param int $limit
*
* @return array
*/
View
2  Repository/MediaRepository.php
@@ -2,9 +2,7 @@
namespace Kunstmaan\MediaBundle\Repository;
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Kunstmaan\MediaBundle\Entity\Media;
-use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\EntityNotFoundException;
View
7 Resources/config/handlers.yml
@@ -4,15 +4,10 @@ parameters:
kunstmaan_media.media_handler.remote_video.class: 'Kunstmaan\MediaBundle\Helper\RemoteVideo\RemoteVideoHandler'
kunstmaan_media.media_handler.image.class: 'Kunstmaan\MediaBundle\Helper\Image\ImageHandler'
kunstmaan_media.media_handler.file.class: 'Kunstmaan\MediaBundle\Helper\File\FileHandler'
- kunstmaan_media.image.manipulator.imagine.class: 'Kunstmaan\MediaBundle\Helper\Manipulator\ImagineImageManipulator'
aviary_api_key: null
services:
- kunstmaan_media.image.manipulator.imagine:
- class: "%kunstmaan_media.image.manipulator.imagine.class%"
- arguments: ["@liip_imagine"]
-
kunstmaan_media.media_handlers.remote_slide:
class: "%kunstmaan_media.media_handler.remote_slide.class%"
tags:
@@ -25,7 +20,7 @@ services:
kunstmaan_media.media_handlers.image:
class: "%kunstmaan_media.media_handler.image.class%"
- arguments: ["@kunstmaan_media.image.manipulator.imagine", "%aviary_api_key%"]
+ arguments: ["%aviary_api_key%"]
tags:
- { name: 'kunstmaan_media.media_handler' }
View
4 Resources/docs/aviaryImageEditor.md
@@ -1,4 +1,4 @@
-# Add media handler to the [KunstmaanMediaBundle][KunstmaanMediaBundle]
+# Add Aviary image editor to the [KunstmaanMediaBundle][KunstmaanMediaBundle]
This document describes how you can enable the Aviary image editor to the [KunstmaanMediaBundle][KunstmaanMediaBundle].
@@ -13,4 +13,6 @@ Register and get your Api Key on [http://www.aviary.com/](http://www.aviary.com/
```
+Now you will get an "edit" button when you view an image.
+
[KunstmaanMediaBundle]: https://github.com/Kunstmaan/KunstmaanMediaBundle "KunstmaanMediaBundle"
View
3  Resources/docs/mediaField.md
@@ -17,7 +17,8 @@ mediatype:
type: string
default: null
description:
- You can specify a specific mediahandler by its name, when this is null all media items are possible.
+ You can specify a specific mediahandler by its name, when this is null all media items are possible.
+ Knows possible values are: image|file|remotevideo|remoteslide
## Parent type:
View
4 composer.json
@@ -17,12 +17,12 @@
"php": ">=5.3.3",
"symfony/symfony": "2.1.*",
"doctrine/doctrine-fixtures-bundle": "2.1.*",
- "kunstmaan/adminlist-bundle": "dev-master",
"kunstmaan/admin-bundle": "dev-master",
"stof/doctrine-extensions-bundle": "dev-master",
"liip/imagine-bundle": "*",
"knplabs/knp-gaufrette-bundle": "*",
- "gedmo/doctrine-extensions": "*"
+ "gedmo/doctrine-extensions": "*",
+ "sensio/framework-extra-bundle": "*"
},
"autoload": {
"psr-0": { "Kunstmaan\\MediaBundle": "" }
Please sign in to comment.
Something went wrong with that request. Please try again.