Permalink
Browse files

media rework

  • Loading branch information...
1 parent 6f90612 commit 04ba226a8992d6f213a906d7efcc191e6dbf118a @krispypen krispypen committed Sep 27, 2012
Showing with 2,035 additions and 4,663 deletions.
  1. +2 −2 AdminList/FileListConfigurator.php
  2. +6 −6 AdminList/MediaListConfigurator.php
  3. +0 −140 AdminList/SlideListConfigurator.php
  4. +0 −138 AdminList/VideoListConfigurator.php
  5. +5 −5 Controller/AviaryController.php
  6. +5 −5 Controller/ChooserController.php
  7. +19 −19 Controller/FolderController.php
  8. +74 −264 Controller/MediaController.php
  9. +0 −108 Controller/MediaMetadataController.php
  10. +0 −117 Controller/SlideController.php
  11. +0 −116 Controller/VideoController.php
  12. +41 −13 DataFixtures/ORM/FolderFixtures.php
  13. +31 −0 DependencyInjection/Compiler/MediaHandlerCompilerPass.php
  14. +5 −6 DependencyInjection/Configuration.php
  15. +4 −4 DependencyInjection/KunstmaanMediaExtension.php
  16. +0 −48 Entity/AbstractMediaMetadata.php
  17. +0 −31 Entity/File.php
  18. +0 −26 Entity/FileGallery.php
  19. +8 −191 Entity/Folder.php
  20. +0 −122 Entity/Image.php
  21. +0 −26 Entity/ImageGallery.php
  22. +62 −25 Entity/Media.php
  23. +0 −143 Entity/MediaContext.php
  24. +0 −78 Entity/Slide.php
  25. +0 −26 Entity/SlideGallery.php
  26. +0 −79 Entity/Video.php
  27. +0 −26 Entity/VideoGallery.php
  28. +0 −29 Event/Events.php
  29. +0 −79 Event/MediaEvent.php
  30. +6 −5 Form/{MediaType.php → File/FileType.php}
  31. +32 −34 Form/FolderType.php
  32. +28 −16 Form/{SlideType.php → RemoteSlide/RemoteSlideType.php}
  33. +4 −4 Form/{VideoType.php → RemoteVideo/RemoteVideoType.php}
  34. +0 −40 Form/SubFolderType.php
  35. +0 −29 Helper/Cdn/CdnInterface.php
  36. +0 −45 Helper/Cdn/RemoteServerCdn.php
  37. +219 −0 Helper/File/FileHandler.php
  38. +47 −9 Helper/{MediaHelper.php → File/FileHelper.php}
  39. +0 −93 Helper/FileGalleryStrategy.php
  40. +0 −45 Helper/FolderFactory.php
  41. +0 −91 Helper/FolderStrategy.php
  42. +0 −66 Helper/GalleryStrategyInterface.php
  43. +0 −23 Helper/Generator/DefaultPathGenerator.php
  44. +0 −21 Helper/Generator/DefaultUuidGenerator.php
  45. +0 −453 Helper/Generator/ExtensionGuesser.php
  46. +0 −16 Helper/Generator/PathGeneratorInterface.php
  47. +0 −16 Helper/Generator/UuidGeneratorInterface.php
  48. +96 −0 Helper/Image/ImageHandler.php
  49. +0 −91 Helper/ImageGalleryStrategy.php
  50. +1 −1 Helper/Manipulator/ImagineImageManipulator.php
  51. +84 −0 Helper/Media/AbstractMediaHandler.php
  52. +41 −250 Helper/MediaManager.php
  53. +22 −22 Helper/Menu/MediaMenuAdaptor.php
  54. +0 −204 Helper/Provider/AbstractProvider.php
  55. +0 −71 Helper/Provider/AbstractVideoProvider.php
  56. +0 −52 Helper/Provider/CodeProvider.php
  57. +0 −128 Helper/Provider/FileProvider.php
  58. +0 −73 Helper/Provider/ImageProvider.php
  59. +0 −116 Helper/Provider/ProviderInterface.php
  60. +163 −0 Helper/RemoteSlide/RemoteSlideHandler.php
  61. +92 −0 Helper/RemoteSlide/RemoteSlideHelper.php
  62. +179 −0 Helper/RemoteVideo/RemoteVideoHandler.php
  63. +82 −0 Helper/RemoteVideo/RemoteVideoHelper.php
  64. +0 −94 Helper/SlideGalleryStrategy.php
  65. +0 −92 Helper/VideoGalleryStrategy.php
  66. +14 −0 KunstmaanMediaBundle.php
  67. +1 −20 Repository/FolderRepository.php
  68. +0 −7 Resources/config/cdn.yml
  69. +21 −39 Resources/config/config.yml
  70. +0 −12 Resources/config/filesystem.yml
  71. +0 −9 Resources/config/generator.yml
  72. +25 −0 Resources/config/handlers.yml
  73. +3 −3 Resources/config/manager.yml
  74. +0 −13 Resources/config/orm.yml
  75. +0 −22 Resources/config/provider.yml
  76. +0 −14 Resources/config/routing.yml
  77. +11 −2 Resources/config/services.yml
  78. +1 −1 Resources/docs/addmedia.md
  79. +315 −0 Resources/public/js/jquery.filedrop.js
  80. +18 −72 Resources/translations/messages.en.yml
  81. +6 −6 Resources/views/File/bulkupload.html.twig
  82. +5 −10 Resources/views/Folder/addsub-modal.html.twig
  83. +0 −16 Resources/views/Folder/create.html.twig
  84. +3 −26 Resources/views/Folder/delete-modal.html.twig
  85. +0 −21 Resources/views/Folder/editform.html.twig
  86. +0 −23 Resources/views/Folder/form.html.twig
  87. +145 −60 Resources/views/Folder/show.html.twig
  88. +0 −21 Resources/views/Folder/showgallery.html.twig
  89. +0 −16 Resources/views/Folder/shownode.html.twig
  90. +0 −21 Resources/views/Folder/subcreate.html.twig
  91. +0 −16 Resources/views/Folder/subform.html.twig
  92. +0 −1 Resources/views/Folder/tableview.html.twig
  93. +0 −5 Resources/views/Image/show.html.twig
  94. +1 −1 Resources/views/Image/tableview.html.twig
  95. +5 −0 Resources/views/Media/Image/show.html.twig
  96. +1 −2 Resources/views/Media/{sure-modal.html.twig → delete-modal.html.twig}
  97. +102 −0 Resources/views/Media/show.html.twig
  98. +0 −44 Tests/Helper/Generator/DefaultPathGeneratorTest.php
  99. +0 −44 Tests/Helper/Generator/DefaultUuidGeneratorTest.php
  100. +0 −44 Tests/Helper/Generator/ExtensionGuesserTest.php
@@ -68,7 +68,7 @@ public function getAddUrlFor(array $params = array())
return array(
'file' => array(
'path' => 'KunstmaanMediaBundle_folder_filecreate',
- 'params' => array('gallery_id' => $params['gallery_id'])
+ 'params' => array('folderIid' => $params['folderId'])
)
);
}
@@ -109,7 +109,7 @@ public function getRepositoryName()
public function adaptQueryBuilder(QueryBuilder $querybuilder, array $params = array())
{
parent::adaptQueryBuilder($querybuilder, $params);
- $querybuilder->andwhere($querybuilder->expr()->eq("b.gallery", $params['gallery']));
+ $querybuilder->andwhere($querybuilder->expr()->eq("b.folder", $params['folder']));
$querybuilder->andwhere("b.deleted != true");
}
@@ -53,7 +53,7 @@ public function buildFields()
*/
public function canAdd()
{
- return false;
+ return true;
}
/**
@@ -67,25 +67,25 @@ public function getAddUrlFor(array $params = array())
'image' => array(
'path' => 'KunstmaanMediaBundle_folder_imagecreate',
'params' => array(
- 'gallery_id' => $params['gallery_id']
+ 'folderId' => $params['folderId']
)
),
'file' => array(
'path' => 'KunstmaanMediaBundle_folder_filecreate',
'params' => array(
- 'gallery_id' => $params['gallery_id']
+ 'folderId' => $params['folderId']
)
),
'slide' => array(
'path' => 'KunstmaanMediaBundle_folder_slidecreate',
'params' => array(
- 'gallery_id' => $params['gallery_id']
+ 'folderId' => $params['folderId']
)
),
'video' => array(
'path' => 'KunstmaanMediaBundle_folder_videocreate',
'params' => array(
- 'gallery_id' => $params['gallery_id']
+ 'folderId' => $params['folderId']
)
)
);
@@ -129,7 +129,7 @@ public function getRepositoryName()
public function adaptQueryBuilder(QueryBuilder $queryBuilder, array $params = array())
{
parent::adaptQueryBuilder($queryBuilder, $params);
- $queryBuilder->andwhere($queryBuilder->expr()->eq("b.gallery", $params['gallery']));
+ $queryBuilder->andwhere($queryBuilder->expr()->eq("b.folder", $params['folder']));
$queryBuilder->andwhere("b.deleted != true");
}
@@ -1,140 +0,0 @@
-<?php
-
-namespace Kunstmaan\MediaBundle\AdminList;
-
-use Kunstmaan\AdminListBundle\AdminList\Filters\DateFilter;
-
-use Doctrine\ORM\QueryBuilder;
-
-use Kunstmaan\MediaBundle\Entity\Slide;
-
-use Kunstmaan\MediaBundle\Entity\Folder;
-
-use Kunstmaan\AdminListBundle\AdminList\FilterDefinitions\DateFilterType;
-use Kunstmaan\AdminListBundle\AdminList\AbstractAdminListConfigurator;
-use Kunstmaan\AdminListBundle\AdminList\AdminListFilter;
-use Kunstmaan\AdminListBundle\AdminList\Filters\StringFilter;
-
-/**
- * SlideListConfigurator
- */
-class SlideListConfigurator extends AbstractAdminListConfigurator
-{
-
- /**
- * @var Folder
- */
- private $folder;
-
- /**
- * @param Folder $folder
- */
- public function __construct(Folder $folder)
- {
- $this->folder = $folder;
- }
-
- /**
- * @param AdminListFilter $filters
- */
- public function buildFilters(AdminListFilter $filters)
- {
- $filters->add('name', new StringFilter("name"), "form.name");
- $filters->add('type', new StringFilter("type"), "form.type");
- $filters->add('createdAt', new DateFilter("createdAt"), "form.createdat");
- $filters->add('updatedAt', new DateFilter("updatedAt"), "form.updatedat");
- }
-
- /**
- * Configure the visible columns
- */
- public function buildFields()
- {
- $this->addField("name", "form.name", true);
- $this->addField("type", "form.type", true);
- $this->addField("createdAt", "form.createdat", true);
- $this->addField("updatedAt", "form.updatedat", true);
- }
-
- /**
- * @return bool
- */
- public function canAdd()
- {
- return false;
- }
-
- /**
- * @param array $params
- *
- * @return array
- */
- public function getAddUrlFor(array $params = array())
- {
- return array(
- 'slide' => array(
- 'path' => 'KunstmaanMediaBundle_folder_slidecreate',
- 'params' => array(
- 'gallery_id' => $params['gallery_id']
- )
- )
- );
- }
-
- /**
- * @param Slide $item
- *
- * @return array
- */
- public function getEditUrlFor($item)
- {
- return array(
- 'path' => 'KunstmaanMediaBundle_media_show',
- 'params' => array(
- 'mediaId' => $item->getId()
- )
- );
- }
-
- /**
- * @return array
- */
- public function getIndexUrlFor()
- {
- return array('path' => 'KunstmaanMediaBundle_folder_show', 'params' => array('id' => $this->folder->getId()));
- }
-
- /**
- * @return string
- */
- public function getRepositoryName()
- {
- return 'KunstmaanMediaBundle:Slide';
- }
-
- /**
- * @param QueryBuilder $queryBuilder The query builder
- * @param array $params Custom parameters
- */
- public function adaptQueryBuilder(QueryBuilder $queryBuilder, array $params = array())
- {
- parent::adaptQueryBuilder($queryBuilder);
- $queryBuilder->andwhere($queryBuilder->expr()->eq("b.gallery", $params['gallery']));
- $queryBuilder->andwhere("b.deleted != true");
- }
-
- /**
- * @param Slide $item
- *
- * @return array
- */
- public function getDeleteUrlFor($item)
- {
- return array(
- 'path' => 'KunstmaanMediaBundle_media_delete',
- 'params' => array(
- 'mediaId' => $item->getId()
- )
- );
- }
-}
@@ -1,138 +0,0 @@
-<?php
-
-namespace Kunstmaan\MediaBundle\AdminList;
-
-use Kunstmaan\AdminListBundle\AdminList\Filters\DateFilter;
-
-use Doctrine\ORM\QueryBuilder;
-
-use Kunstmaan\MediaBundle\Entity\Video;
-
-use Kunstmaan\MediaBundle\Entity\Folder;
-
-use Kunstmaan\AdminListBundle\AdminList\FilterDefinitions\DateFilterType;
-use Kunstmaan\AdminListBundle\AdminList\AbstractAdminListConfigurator;
-use Kunstmaan\AdminListBundle\AdminList\AdminListFilter;
-use Kunstmaan\AdminListBundle\AdminList\Filters\StringFilter;
-
-/**
- * VideoListConfigurator
- */
-class VideoListConfigurator extends AbstractAdminListConfigurator
-{
-
- /**
- * @var Folder
- */
- private $folder;
-
- /**
- * @param Folder $folder
- */
- public function __construct(Folder $folder)
- {
- $this->folder = $folder;
- }
-
- /**
- * @param AdminListFilter $filters
- */
- public function buildFilters(AdminListFilter $filters)
- {
- $filters->add('name', new StringFilter("name"), "form.name");
- $filters->add('type', new StringFilter("type"), "form.type");
- $filters->add('createdAt', new DateFilter("createdAt"), "form.createdat");
- $filters->add('updatedAt', new DateFilter("updatedAt"), "form.updatedat");
- }
-
- /**
- * Configure the visible columns
- */
- public function buildFields()
- {
- $this->addField("name", "form.name", true);
- $this->addField("type", "form.type", true);
- $this->addField("createdAt", "form.createdat", true);
- $this->addField("updatedAt", "form.updatedat", true);
- }
-
- /**
- * @return bool
- */
- public function canAdd()
- {
- return false;
- }
-
- /**
- * @param array $params
- *
- * @return array
- */
- public function getAddUrlFor(array $params = array())
- {
- return array(
- 'video' => array(
- 'path' => 'KunstmaanMediaBundle_folder_videocreate',
- 'params' => array(
- 'gallery_id' => $params['gallery_id']
- )
- )
- );
- }
-
- /**
- * @param Video $item
- *
- * @return array
- */
- public function getEditUrlFor($item)
- {
- return array('path' => 'KunstmaanMediaBundle_media_show',
- 'params' => array('mediaId' => $item->getId())
- );
- }
-
- /**
- * @return array
- */
- public function getIndexUrlFor()
- {
- return array('path' => 'KunstmaanMediaBundle_folder_show', 'params' => array('id' => $this->folder->getId()));
- }
-
- /**
- * @return string
- */
- public function getRepositoryName()
- {
- return 'KunstmaanMediaBundle:Video';
- }
-
-
- /**
- * @param QueryBuilder $queryBuilder The query builder
- * @param array $params Custom parameters
- */
- public function adaptQueryBuilder(QueryBuilder $queryBuilder, array $params = array())
- {
- parent::adaptQueryBuilder($queryBuilder);
- $queryBuilder->andwhere($queryBuilder->expr()->eq("b.gallery", $params['gallery']));
- $queryBuilder->andwhere("b.deleted != true");
- }
-
- /**
- * @param Video $item
- *
- * @return array
- */
- public function getDeleteUrlFor($item)
- {
- return array(
- 'path' => 'KunstmaanMediaBundle_media_delete',
- 'params' => array(
- 'mediaId' => $item->getId()
- )
- );
- }
-}
@@ -6,7 +6,7 @@
use Kunstmaan\MediaBundle\Entity\Image;
use Kunstmaan\MediaBundle\Entity\Folder;
use Kunstmaan\MediaBundle\Helper\MediaHelper;
-use Symfony\Component\HttpFoundation\File\File;
+use Kunstmaan\MediaBundle\Entity\File;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -19,12 +19,12 @@ class AviaryController extends Controller
/**
* @param int $folderId The id of the Folder
- * @param int $imageId The id of the image
+ * @param int $mediaId The id of the image
*
- * @Route("/aviary/{folderId}/{imageId}", requirements={"folderId" = "\d+", "imageId" = "\d+"}, name="KunstmaanMediaBundle_aviary")
+ * @Route("/aviary/{folderId}/{mediaId}", requirements={"folderId" = "\d+", "mediaId" = "\d+"}, name="KunstmaanMediaBundle_aviary")
* @return RedirectResponse
*/
- public function indexAction($folderId, $imageId)
+ public function indexAction($folderId, $mediaId)
{
$em = $this->getDoctrine()->getManager();
@@ -36,7 +36,7 @@ public function indexAction($folderId, $imageId)
/* @var Image $media */
$media = $em->getRepository('KunstmaanMediaBundle:Media')->getMedia($imageId);
- $picture = new Image();
+ $picture = new File();
$picture->setOriginal($media);
$picture->setName($media->getName()."-edited");
$picture->setContent($helper->getMedia());
Oops, something went wrong.

0 comments on commit 04ba226

Please sign in to comment.