diff --git a/Command/MongoDBMigrateMetadataCommand.php b/Command/MongoDBMigrateMetadataCommand.php index 0295c9c8..b5ade5f5 100644 --- a/Command/MongoDBMigrateMetadataCommand.php +++ b/Command/MongoDBMigrateMetadataCommand.php @@ -1,6 +1,6 @@ * thread.datesOfLastMessageWrittenByOtherParticipant * thread.datesOfLastMessageWrittenByParticipant * thread.isDeletedByParticipant - + The following new fields will be created: * message.metadata (array of embedded metadata documents) @@ -98,8 +98,8 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $registry = $this->getContainer()->get('doctrine.odm.mongodb'); - $this->messageCollection = $this->getMongoCollectionForClass($registry, $this->getContainer()->getParameter('ornicar_message.message_class')); - $this->threadCollection = $this->getMongoCollectionForClass($registry, $this->getContainer()->getParameter('ornicar_message.thread_class')); + $this->messageCollection = $this->getMongoCollectionForClass($registry, $this->getContainer()->getParameter('fos_message.message_class')); + $this->threadCollection = $this->getMongoCollectionForClass($registry, $this->getContainer()->getParameter('fos_message.thread_class')); $this->participantCollection = $this->getMongoCollectionForClass($registry, $input->getArgument('participantClass')); $this->updateOptions = array( @@ -253,7 +253,7 @@ private function createMessageMetadata(array &$message) /** * Sets the unreadForParticipants array on the message. * - * @see Ornicar\MessageBundle\Document\Message::doEnsureUnreadForParticipantsArray() + * @see FOS\MessageBundle\Document\Message::doEnsureUnreadForParticipantsArray() * @param array &$message */ private function createMessageUnreadForParticipants(array &$message) @@ -331,7 +331,7 @@ private function createThreadLastMessageDate(array &$thread) /** * Sets the active participant arrays on the thread. * - * @see Ornicar\MessageBundle\Document\Thread::doEnsureActiveParticipantArrays() + * @see FOS\MessageBundle\Document\Thread::doEnsureActiveParticipantArrays() * @param array $thread */ private function createThreadActiveParticipantArrays(array &$thread) diff --git a/Composer/Composer.php b/Composer/Composer.php index b059a913..b76a9e02 100644 --- a/Composer/Composer.php +++ b/Composer/Composer.php @@ -1,13 +1,13 @@ getProvider()->getInboxThreads(); - return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:inbox.html.twig', array( + return $this->container->get('templating')->renderResponse('FOSMessageBundle:Message:inbox.html.twig', array( 'threads' => $threads )); } @@ -32,7 +32,7 @@ public function sentAction() { $threads = $this->getProvider()->getSentThreads(); - return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:sent.html.twig', array( + return $this->container->get('templating')->renderResponse('FOSMessageBundle:Message:sent.html.twig', array( 'threads' => $threads )); } @@ -46,16 +46,16 @@ public function sentAction() public function threadAction($threadId) { $thread = $this->getProvider()->getThread($threadId); - $form = $this->container->get('ornicar_message.reply_form.factory')->create($thread); - $formHandler = $this->container->get('ornicar_message.reply_form.handler'); + $form = $this->container->get('fos_message.reply_form.factory')->create($thread); + $formHandler = $this->container->get('fos_message.reply_form.handler'); if ($message = $formHandler->process($form)) { - return new RedirectResponse($this->container->get('router')->generate('ornicar_message_thread_view', array( + return new RedirectResponse($this->container->get('router')->generate('fos_message_thread_view', array( 'threadId' => $message->getThread()->getId() ))); } - return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:thread.html.twig', array( + return $this->container->get('templating')->renderResponse('FOSMessageBundle:Message:thread.html.twig', array( 'form' => $form->createView(), 'thread' => $thread )); @@ -68,16 +68,16 @@ public function threadAction($threadId) */ public function newThreadAction() { - $form = $this->container->get('ornicar_message.new_thread_form.factory')->create(); - $formHandler = $this->container->get('ornicar_message.new_thread_form.handler'); + $form = $this->container->get('fos_message.new_thread_form.factory')->create(); + $formHandler = $this->container->get('fos_message.new_thread_form.handler'); if ($message = $formHandler->process($form)) { - return new RedirectResponse($this->container->get('router')->generate('ornicar_message_thread_view', array( + return new RedirectResponse($this->container->get('router')->generate('fos_message_thread_view', array( 'threadId' => $message->getThread()->getId() ))); } - return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:newThread.html.twig', array( + return $this->container->get('templating')->renderResponse('FOSMessageBundle:Message:newThread.html.twig', array( 'form' => $form->createView(), 'data' => $form->getData() )); @@ -91,10 +91,10 @@ public function newThreadAction() public function deleteAction($threadId) { $thread = $this->getProvider()->getThread($threadId); - $this->container->get('ornicar_message.deleter')->markAsDeleted($thread); - $this->container->get('ornicar_message.thread_manager')->saveThread($thread); + $this->container->get('fos_message.deleter')->markAsDeleted($thread); + $this->container->get('fos_message.thread_manager')->saveThread($thread); - return new RedirectResponse($this->container->get('router')->generate('ornicar_message_inbox')); + return new RedirectResponse($this->container->get('router')->generate('fos_message_inbox')); } /** @@ -104,10 +104,10 @@ public function deleteAction($threadId) */ public function searchAction() { - $query = $this->container->get('ornicar_message.search_query_factory')->createFromRequest(); - $threads = $this->container->get('ornicar_message.search_finder')->find($query); + $query = $this->container->get('fos_message.search_query_factory')->createFromRequest(); + $threads = $this->container->get('fos_message.search_finder')->find($query); - return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:search.html.twig', array( + return $this->container->get('templating')->renderResponse('FOSMessageBundle:Message:search.html.twig', array( 'query' => $query, 'threads' => $threads )); @@ -120,6 +120,6 @@ public function searchAction() */ protected function getProvider() { - return $this->container->get('ornicar_message.provider'); + return $this->container->get('fos_message.provider'); } } diff --git a/Deleter/Deleter.php b/Deleter/Deleter.php index 98b7d225..c1a943ad 100644 --- a/Deleter/Deleter.php +++ b/Deleter/Deleter.php @@ -1,12 +1,12 @@ setIsDeletedByParticipant($this->getAuthenticatedParticipant(), true); - $this->dispatcher->dispatch(OrnicarMessageEvents::POST_DELETE, new ThreadEvent($thread)); + $this->dispatcher->dispatch(FOSMessageEvents::POST_DELETE, new ThreadEvent($thread)); } /** @@ -72,7 +72,7 @@ public function markAsUndeleted(ThreadInterface $thread) } $thread->setIsDeletedByParticipant($this->getAuthenticatedParticipant(), false); - $this->dispatcher->dispatch(OrnicarMessageEvents::POST_UNDELETE, new ThreadEvent($thread)); + $this->dispatcher->dispatch(FOSMessageEvents::POST_UNDELETE, new ThreadEvent($thread)); } /** diff --git a/Deleter/DeleterInterface.php b/Deleter/DeleterInterface.php index 506f67b8..76c9b4f0 100644 --- a/Deleter/DeleterInterface.php +++ b/Deleter/DeleterInterface.php @@ -1,8 +1,8 @@ root('ornicar_message'); + $rootNode = $treeBuilder->root('fos_message'); $rootNode ->children() ->scalarNode('db_driver')->cannotBeOverwritten()->isRequired()->cannotBeEmpty()->end() ->scalarNode('thread_class')->isRequired()->cannotBeEmpty()->end() ->scalarNode('message_class')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('message_manager')->defaultValue('ornicar_message.message_manager.default')->cannotBeEmpty()->end() - ->scalarNode('thread_manager')->defaultValue('ornicar_message.thread_manager.default')->cannotBeEmpty()->end() - ->scalarNode('sender')->defaultValue('ornicar_message.sender.default')->cannotBeEmpty()->end() - ->scalarNode('composer')->defaultValue('ornicar_message.composer.default')->cannotBeEmpty()->end() - ->scalarNode('provider')->defaultValue('ornicar_message.provider.default')->cannotBeEmpty()->end() - ->scalarNode('participant_provider')->defaultValue('ornicar_message.participant_provider.default')->cannotBeEmpty()->end() - ->scalarNode('authorizer')->defaultValue('ornicar_message.authorizer.default')->cannotBeEmpty()->end() - ->scalarNode('message_reader')->defaultValue('ornicar_message.message_reader.default')->cannotBeEmpty()->end() - ->scalarNode('thread_reader')->defaultValue('ornicar_message.thread_reader.default')->cannotBeEmpty()->end() - ->scalarNode('deleter')->defaultValue('ornicar_message.deleter.default')->cannotBeEmpty()->end() - ->scalarNode('spam_detector')->defaultValue('ornicar_message.noop_spam_detector')->cannotBeEmpty()->end() - ->scalarNode('twig_extension')->defaultValue('ornicar_message.twig_extension.default')->cannotBeEmpty()->end() + ->scalarNode('message_manager')->defaultValue('fos_message.message_manager.default')->cannotBeEmpty()->end() + ->scalarNode('thread_manager')->defaultValue('fos_message.thread_manager.default')->cannotBeEmpty()->end() + ->scalarNode('sender')->defaultValue('fos_message.sender.default')->cannotBeEmpty()->end() + ->scalarNode('composer')->defaultValue('fos_message.composer.default')->cannotBeEmpty()->end() + ->scalarNode('provider')->defaultValue('fos_message.provider.default')->cannotBeEmpty()->end() + ->scalarNode('participant_provider')->defaultValue('fos_message.participant_provider.default')->cannotBeEmpty()->end() + ->scalarNode('authorizer')->defaultValue('fos_message.authorizer.default')->cannotBeEmpty()->end() + ->scalarNode('message_reader')->defaultValue('fos_message.message_reader.default')->cannotBeEmpty()->end() + ->scalarNode('thread_reader')->defaultValue('fos_message.thread_reader.default')->cannotBeEmpty()->end() + ->scalarNode('deleter')->defaultValue('fos_message.deleter.default')->cannotBeEmpty()->end() + ->scalarNode('spam_detector')->defaultValue('fos_message.noop_spam_detector')->cannotBeEmpty()->end() + ->scalarNode('twig_extension')->defaultValue('fos_message.twig_extension.default')->cannotBeEmpty()->end() ->arrayNode('search') ->addDefaultsIfNotSet() ->children() - ->scalarNode('query_factory')->defaultValue('ornicar_message.search_query_factory.default')->cannotBeEmpty()->end() - ->scalarNode('finder')->defaultValue('ornicar_message.search_finder.default')->cannotBeEmpty()->end() + ->scalarNode('query_factory')->defaultValue('fos_message.search_query_factory.default')->cannotBeEmpty()->end() + ->scalarNode('finder')->defaultValue('fos_message.search_finder.default')->cannotBeEmpty()->end() ->scalarNode('query_parameter')->defaultValue('q')->cannotBeEmpty()->end() ->end() ->end() ->arrayNode('new_thread_form') ->addDefaultsIfNotSet() ->children() - ->scalarNode('factory')->defaultValue('ornicar_message.new_thread_form.factory.default')->cannotBeEmpty()->end() - ->scalarNode('type')->defaultValue('ornicar_message.new_thread_form.type.default')->cannotBeEmpty()->end() - ->scalarNode('handler')->defaultValue('ornicar_message.new_thread_form.handler.default')->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue('fos_message.new_thread_form.factory.default')->cannotBeEmpty()->end() + ->scalarNode('type')->defaultValue('fos_message.new_thread_form.type.default')->cannotBeEmpty()->end() + ->scalarNode('handler')->defaultValue('fos_message.new_thread_form.handler.default')->cannotBeEmpty()->end() ->scalarNode('name')->defaultValue('message')->cannotBeEmpty()->end() - ->scalarNode('model')->defaultValue('Ornicar\MessageBundle\FormModel\NewThreadMessage')->end() + ->scalarNode('model')->defaultValue('FOS\MessageBundle\FormModel\NewThreadMessage')->end() ->end() ->end() ->arrayNode('reply_form') ->addDefaultsIfNotSet() ->children() - ->scalarNode('factory')->defaultValue('ornicar_message.reply_form.factory.default')->cannotBeEmpty()->end() - ->scalarNode('type')->defaultValue('ornicar_message.reply_form.type.default')->cannotBeEmpty()->end() - ->scalarNode('handler')->defaultValue('ornicar_message.reply_form.handler.default')->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue('fos_message.reply_form.factory.default')->cannotBeEmpty()->end() + ->scalarNode('type')->defaultValue('fos_message.reply_form.type.default')->cannotBeEmpty()->end() + ->scalarNode('handler')->defaultValue('fos_message.reply_form.handler.default')->cannotBeEmpty()->end() ->scalarNode('name')->defaultValue('message')->cannotBeEmpty()->end() - ->scalarNode('model')->defaultValue('Ornicar\MessageBundle\FormModel\ReplyMessage')->end() + ->scalarNode('model')->defaultValue('FOS\MessageBundle\FormModel\ReplyMessage')->end() ->end() ->end() ->end(); diff --git a/DependencyInjection/FOSMessageExtension.php b/DependencyInjection/FOSMessageExtension.php new file mode 100644 index 00000000..191cca3f --- /dev/null +++ b/DependencyInjection/FOSMessageExtension.php @@ -0,0 +1,65 @@ +processConfiguration($configuration, $configs); + + $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + + if (!in_array(strtolower($config['db_driver']), array('orm', 'mongodb'))) { + throw new \InvalidArgumentException(sprintf('Invalid db driver "%s".', $config['db_driver'])); + } + $loader->load(sprintf('%s.xml', $config['db_driver'])); + $loader->load('config.xml'); + $loader->load('form.xml'); + $loader->load('validator.xml'); + $loader->load('spam_detection.xml'); + + $container->setParameter('fos_message.message_class', $config['message_class']); + $container->setParameter('fos_message.thread_class', $config['thread_class']); + + $container->setParameter('fos_message.new_thread_form.model', $config['new_thread_form']['model']); + $container->setParameter('fos_message.new_thread_form.name', $config['new_thread_form']['name']); + $container->setParameter('fos_message.reply_form.model', $config['reply_form']['model']); + $container->setParameter('fos_message.reply_form.name', $config['reply_form']['name']); + + $container->setAlias('fos_message.message_manager', $config['message_manager']); + $container->setAlias('fos_message.thread_manager', $config['thread_manager']); + + $container->setAlias('fos_message.sender', $config['sender']); + $container->setAlias('fos_message.composer', $config['composer']); + $container->setAlias('fos_message.provider', $config['provider']); + $container->setAlias('fos_message.participant_provider', $config['participant_provider']); + $container->setAlias('fos_message.authorizer', $config['authorizer']); + $container->setAlias('fos_message.message_reader', $config['message_reader']); + $container->setAlias('fos_message.thread_reader', $config['thread_reader']); + $container->setAlias('fos_message.deleter', $config['deleter']); + $container->setAlias('fos_message.spam_detector', $config['spam_detector']); + $container->setAlias('fos_message.twig_extension', $config['twig_extension']); + + $container->setAlias('fos_message.new_thread_form.type', $config['new_thread_form']['type']); + $container->setAlias('fos_message.new_thread_form.factory', $config['new_thread_form']['factory']); + $container->setAlias('fos_message.new_thread_form.handler', $config['new_thread_form']['handler']); + $container->setAlias('fos_message.reply_form.type', $config['reply_form']['type']); + $container->setAlias('fos_message.reply_form.factory', $config['reply_form']['factory']); + $container->setAlias('fos_message.reply_form.handler', $config['reply_form']['handler']); + + $container->setAlias('fos_message.search_query_factory', $config['search']['query_factory']); + $container->setAlias('fos_message.search_finder', $config['search']['finder']); + $container->getDefinition('fos_message.search_query_factory.default') + ->replaceArgument(1, $config['search']['query_parameter']); + } +} diff --git a/DependencyInjection/OrnicarMessageExtension.php b/DependencyInjection/OrnicarMessageExtension.php deleted file mode 100644 index f01fd5a4..00000000 --- a/DependencyInjection/OrnicarMessageExtension.php +++ /dev/null @@ -1,65 +0,0 @@ -processConfiguration($configuration, $configs); - - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - - if (!in_array(strtolower($config['db_driver']), array('orm', 'mongodb'))) { - throw new \InvalidArgumentException(sprintf('Invalid db driver "%s".', $config['db_driver'])); - } - $loader->load(sprintf('%s.xml', $config['db_driver'])); - $loader->load('config.xml'); - $loader->load('form.xml'); - $loader->load('validator.xml'); - $loader->load('spam_detection.xml'); - - $container->setParameter('ornicar_message.message_class', $config['message_class']); - $container->setParameter('ornicar_message.thread_class', $config['thread_class']); - - $container->setParameter('ornicar_message.new_thread_form.model', $config['new_thread_form']['model']); - $container->setParameter('ornicar_message.new_thread_form.name', $config['new_thread_form']['name']); - $container->setParameter('ornicar_message.reply_form.model', $config['reply_form']['model']); - $container->setParameter('ornicar_message.reply_form.name', $config['reply_form']['name']); - - $container->setAlias('ornicar_message.message_manager', $config['message_manager']); - $container->setAlias('ornicar_message.thread_manager', $config['thread_manager']); - - $container->setAlias('ornicar_message.sender', $config['sender']); - $container->setAlias('ornicar_message.composer', $config['composer']); - $container->setAlias('ornicar_message.provider', $config['provider']); - $container->setAlias('ornicar_message.participant_provider', $config['participant_provider']); - $container->setAlias('ornicar_message.authorizer', $config['authorizer']); - $container->setAlias('ornicar_message.message_reader', $config['message_reader']); - $container->setAlias('ornicar_message.thread_reader', $config['thread_reader']); - $container->setAlias('ornicar_message.deleter', $config['deleter']); - $container->setAlias('ornicar_message.spam_detector', $config['spam_detector']); - $container->setAlias('ornicar_message.twig_extension', $config['twig_extension']); - - $container->setAlias('ornicar_message.new_thread_form.type', $config['new_thread_form']['type']); - $container->setAlias('ornicar_message.new_thread_form.factory', $config['new_thread_form']['factory']); - $container->setAlias('ornicar_message.new_thread_form.handler', $config['new_thread_form']['handler']); - $container->setAlias('ornicar_message.reply_form.type', $config['reply_form']['type']); - $container->setAlias('ornicar_message.reply_form.factory', $config['reply_form']['factory']); - $container->setAlias('ornicar_message.reply_form.handler', $config['reply_form']['handler']); - - $container->setAlias('ornicar_message.search_query_factory', $config['search']['query_factory']); - $container->setAlias('ornicar_message.search_finder', $config['search']['finder']); - $container->getDefinition('ornicar_message.search_query_factory.default') - ->replaceArgument(1, $config['search']['query_parameter']); - } -} diff --git a/Document/Message.php b/Document/Message.php index 8ec07e9d..e951a1bc 100644 --- a/Document/Message.php +++ b/Document/Message.php @@ -1,8 +1,8 @@ readableManager->markAsReadByParticipant($readable, $participant); - $this->dispatcher->dispatch(OrnicarMessageEvents::POST_READ, new ReadableEvent($readable)); + $this->dispatcher->dispatch(FOSMessageEvents::POST_READ, new ReadableEvent($readable)); } /** @@ -73,7 +73,7 @@ public function markAsUnread(ReadableInterface $readable) } $this->readableManager->markAsUnreadByParticipant($readable, $participant); - $this->dispatcher->dispatch(OrnicarMessageEvents::POST_UNREAD, new ReadableEvent($readable)); + $this->dispatcher->dispatch(FOSMessageEvents::POST_UNREAD, new ReadableEvent($readable)); } /** diff --git a/Reader/ReaderInterface.php b/Reader/ReaderInterface.php index bb23db66..e31d98ee 100644 --- a/Reader/ReaderInterface.php +++ b/Reader/ReaderInterface.php @@ -1,8 +1,8 @@ - - - + + + - - - + + + - + - - + + - - - - - - + + + + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - + - - - + + + diff --git a/Resources/config/doctrine/Message.mongodb.xml b/Resources/config/doctrine/Message.mongodb.xml index 23a9bf2a..3b09a7d0 100644 --- a/Resources/config/doctrine/Message.mongodb.xml +++ b/Resources/config/doctrine/Message.mongodb.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd"> - + @@ -14,11 +14,11 @@ - + - + diff --git a/Resources/config/doctrine/Message.orm.xml b/Resources/config/doctrine/Message.orm.xml index 61da6db3..406cc90e 100644 --- a/Resources/config/doctrine/Message.orm.xml +++ b/Resources/config/doctrine/Message.orm.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + diff --git a/Resources/config/doctrine/MessageMetadata.mongodb.xml b/Resources/config/doctrine/MessageMetadata.mongodb.xml index 51cbf7cf..90a4b89f 100644 --- a/Resources/config/doctrine/MessageMetadata.mongodb.xml +++ b/Resources/config/doctrine/MessageMetadata.mongodb.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd"> - + diff --git a/Resources/config/doctrine/MessageMetadata.orm.xml b/Resources/config/doctrine/MessageMetadata.orm.xml index c7e839fc..5939523d 100644 --- a/Resources/config/doctrine/MessageMetadata.orm.xml +++ b/Resources/config/doctrine/MessageMetadata.orm.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + diff --git a/Resources/config/doctrine/Thread.mongodb.xml b/Resources/config/doctrine/Thread.mongodb.xml index 933ccdb0..cbb119c4 100644 --- a/Resources/config/doctrine/Thread.mongodb.xml +++ b/Resources/config/doctrine/Thread.mongodb.xml @@ -4,11 +4,11 @@ xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd"> - + - + diff --git a/Resources/config/doctrine/Thread.orm.xml b/Resources/config/doctrine/Thread.orm.xml index 32fc3c97..4a696d73 100644 --- a/Resources/config/doctrine/Thread.orm.xml +++ b/Resources/config/doctrine/Thread.orm.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + diff --git a/Resources/config/doctrine/ThreadMetadata.mongodb.xml b/Resources/config/doctrine/ThreadMetadata.mongodb.xml index 1680e7ba..089e8943 100644 --- a/Resources/config/doctrine/ThreadMetadata.mongodb.xml +++ b/Resources/config/doctrine/ThreadMetadata.mongodb.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + diff --git a/Resources/config/doctrine/ThreadMetadata.orm.xml b/Resources/config/doctrine/ThreadMetadata.orm.xml index 4dbb8e74..459ea18c 100644 --- a/Resources/config/doctrine/ThreadMetadata.orm.xml +++ b/Resources/config/doctrine/ThreadMetadata.orm.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + diff --git a/Resources/config/form.xml b/Resources/config/form.xml index f7819102..58e8c702 100644 --- a/Resources/config/form.xml +++ b/Resources/config/form.xml @@ -6,36 +6,36 @@ - + - + - + - - %ornicar_message.new_thread_form.name% - %ornicar_message.new_thread_form.model% + + %fos_message.new_thread_form.name% + %fos_message.new_thread_form.model% - + - - %ornicar_message.reply_form.name% - %ornicar_message.reply_form.model% + + %fos_message.reply_form.name% + %fos_message.reply_form.model% - + - - - + + + - + - - - + + + diff --git a/Resources/config/mongodb.xml b/Resources/config/mongodb.xml index 6fa1b7c9..622414a9 100644 --- a/Resources/config/mongodb.xml +++ b/Resources/config/mongodb.xml @@ -6,24 +6,24 @@ - %ornicar_message.message_class%Metadata - %ornicar_message.thread_class%Metadata + %fos_message.message_class%Metadata + %fos_message.thread_class%Metadata - + - %ornicar_message.message_class% - %ornicar_message.message_meta_class% + %fos_message.message_class% + %fos_message.message_meta_class% - + - %ornicar_message.thread_class% - %ornicar_message.thread_meta_class% - + %fos_message.thread_class% + %fos_message.thread_meta_class% + diff --git a/Resources/config/orm.xml b/Resources/config/orm.xml index 7e7e82c8..12b11148 100644 --- a/Resources/config/orm.xml +++ b/Resources/config/orm.xml @@ -6,25 +6,25 @@ - %ornicar_message.message_class%Metadata - %ornicar_message.thread_class%Metadata + %fos_message.message_class%Metadata + %fos_message.thread_class%Metadata - + - %ornicar_message.message_class% - %ornicar_message.message_meta_class% + %fos_message.message_class% + %fos_message.message_meta_class% - + - %ornicar_message.thread_class% - %ornicar_message.thread_meta_class% - + %fos_message.thread_class% + %fos_message.thread_meta_class% + diff --git a/Resources/config/routing.xml b/Resources/config/routing.xml index 85a1394c..b52209e9 100644 --- a/Resources/config/routing.xml +++ b/Resources/config/routing.xml @@ -4,28 +4,28 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - - OrnicarMessageBundle:Message:inbox + + FOSMessageBundle:Message:inbox - - OrnicarMessageBundle:Message:sent + + FOSMessageBundle:Message:sent - - OrnicarMessageBundle:Message:search + + FOSMessageBundle:Message:search - - OrnicarMessageBundle:Message:newThread + + FOSMessageBundle:Message:newThread - - OrnicarMessageBundle:Message:thread + + FOSMessageBundle:Message:thread - - OrnicarMessageBundle:Message:delete + + FOSMessageBundle:Message:delete POST|DELETE diff --git a/Resources/config/spam_detection.xml b/Resources/config/spam_detection.xml index e4ed32b4..8e0e27d2 100644 --- a/Resources/config/spam_detection.xml +++ b/Resources/config/spam_detection.xml @@ -6,11 +6,11 @@ - + - + - + diff --git a/Resources/config/validation.xml b/Resources/config/validation.xml index 8f54ff6c..6ec0064e 100644 --- a/Resources/config/validation.xml +++ b/Resources/config/validation.xml @@ -4,18 +4,18 @@ xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd"> - + - + - - + + - + @@ -45,9 +45,9 @@ - + - + diff --git a/Resources/config/validator.xml b/Resources/config/validator.xml index 773ec79f..a7f111fb 100644 --- a/Resources/config/validator.xml +++ b/Resources/config/validator.xml @@ -6,25 +6,25 @@ - - - + + + - - - - + + + + - - - + + + - - - + + + diff --git a/Resources/doc/concrete_mongo.rst b/Resources/doc/concrete_mongo.rst index 43e7aad7..ba768860 100644 --- a/Resources/doc/concrete_mongo.rst +++ b/Resources/doc/concrete_mongo.rst @@ -14,7 +14,7 @@ Thread class namespace Acme\MessageBundle\Document; use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB; - use Ornicar\MessageBundle\Document\Thread as BaseThread; + use FOS\MessageBundle\Document\Thread as BaseThread; /** * @MongoDB\Document @@ -57,7 +57,7 @@ Message class namespace Acme\MessageBundle\Document; use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB; - use Ornicar\MessageBundle\Document\Message as BaseMessage; + use FOS\MessageBundle\Document\Message as BaseMessage; /** * @MongoDB\Document @@ -94,7 +94,7 @@ ThreadMetaData class namespace Mashup\MessageBundle\Document; use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; - use Ornicar\MessageBundle\Document\ThreadMetadata as BaseThreadMetadata; + use FOS\MessageBundle\Document\ThreadMetadata as BaseThreadMetadata; /** * @ODM\EmbeddedDocument @@ -116,7 +116,7 @@ MessageMetaData class namespace Mashup\MessageBundle\Document; use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; - use Ornicar\MessageBundle\Document\MessageMetadata as BaseMessageMetadata; + use FOS\MessageBundle\Document\MessageMetadata as BaseMessageMetadata; /** * @ODM\EmbeddedDocument @@ -133,7 +133,7 @@ Configure your application:: # app/config/config.yml - ornicar_message: + fos_message: db_driver: mongodb thread_class: Acme\MessageBundle\Document\Thread message_class: Acme\MessageBundle\Document\Message \ No newline at end of file diff --git a/Resources/doc/concrete_orm.rst b/Resources/doc/concrete_orm.rst index c45e590f..bf725bda 100644 --- a/Resources/doc/concrete_orm.rst +++ b/Resources/doc/concrete_orm.rst @@ -15,7 +15,7 @@ Message class use Doctrine\ORM\Mapping as ORM; - use Ornicar\MessageBundle\Entity\Message as BaseMessage; + use FOS\MessageBundle\Entity\Message as BaseMessage; /** * @ORM\Entity @@ -58,7 +58,7 @@ MessageMetadata class use Doctrine\ORM\Mapping as ORM; - use Ornicar\MessageBundle\Entity\MessageMetadata as BaseMessageMetadata; + use FOS\MessageBundle\Entity\MessageMetadata as BaseMessageMetadata; /** * @ORM\Entity @@ -95,7 +95,7 @@ Thread class use Doctrine\ORM\Mapping as ORM; - use Ornicar\MessageBundle\Entity\Thread as BaseThread; + use FOS\MessageBundle\Entity\Thread as BaseThread; /** * @ORM\Entity @@ -144,7 +144,7 @@ ThreadMetadata class use Doctrine\ORM\Mapping as ORM; - use Ornicar\MessageBundle\Entity\ThreadMetadata as BaseThreadMetadata; + use FOS\MessageBundle\Entity\ThreadMetadata as BaseThreadMetadata; /** * @ORM\Entity @@ -175,7 +175,7 @@ Configure your application:: # app/config/config.yml - ornicar_message: + fos_message: db_driver: orm thread_class: Acme\MessageBundle\Entity\Thread message_class: Acme\MessageBundle\Entity\Message \ No newline at end of file diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst index e4f7a796..09992fd5 100644 --- a/Resources/doc/index.rst +++ b/Resources/doc/index.rst @@ -27,7 +27,7 @@ Through submodules: :: - $ git submodule add git://github.com/ornicar/OrnicarMessageBundle.git vendor/bundles/Ornicar/MessageBundle + $ git submodule add git://github.com/FriendsOfSymfony/OrnicarMessageBundle.git vendor/bundles/FOS/MessageBundle Through composer: @@ -37,12 +37,12 @@ Through composer: "require": { ... - "ornicar/message-bundle": "dev-master" + "friendsofsymfony/message-bundle": "dev-master" ... } - -Add the Ornicar namespace to your autoloader + +Add the FOS namespace to your autoloader ---------------------------------------- :: @@ -50,7 +50,7 @@ Add the Ornicar namespace to your autoloader // app/autoload.php $loader->registerNamespaces(array( - 'Ornicar' => __DIR__.'/../vendor/bundles', + 'FOS' => __DIR__.'/../vendor/bundles', // your other namespaces ); @@ -65,7 +65,7 @@ Add MessageBundle to your application kernel { return array( // ... - new Ornicar\MessageBundle\OrnicarMessageBundle(), + new FOS\MessageBundle\FOSMessageBundle(), // ... ); } @@ -82,7 +82,7 @@ along with the bundle containing your custom Thread and Message classes:: document_managers: default: mappings: - OrnicarMessageBundle: ~ + FOSMessageBundle: ~ # your other bundles The above example assumes a MongoDB configuration, but the `mappings` configuration @@ -99,7 +99,7 @@ For exemple, if your user class is ``Acme\UserBundle\Document\User``:: // src/Acme/UserBundle/Document/User.php - use Ornicar\MessageBundle\Model\ParticipantInterface; + use FOS\MessageBundle\Model\ParticipantInterface; /** * @MongoDB\Document @@ -129,15 +129,15 @@ In YAML:: # app/config/routing.yml - ornicar_message: - resource: "@OrnicarMessageBundle/Resources/config/routing.xml" + fos_message: + resource: "@FOSMessageBundle/Resources/config/routing.xml" prefix: /optional_routing_prefix Or if you prefer XML:: # app/config/routing.xml - + Basic Usage =========== @@ -156,7 +156,7 @@ Get user threads Get the threads in the inbox of the authenticated user:: - $provider = $container->get('ornicar_message.provider'); + $provider = $container->get('fos_message.provider'); $threads = $provider->getInboxThreads(); @@ -171,7 +171,7 @@ To get a single thread, check it belongs to the authenticated user and mark it a Manipulate threads ------------------ -See ``Ornicar\\MessageBundle\\Model\\ThreadInterface`` for the complete list of available methods:: +See ``FOS\\MessageBundle\\Model\\ThreadInterface`` for the complete list of available methods:: // Print the thread subject echo $thread->getSubject(); @@ -189,7 +189,7 @@ See ``Ornicar\\MessageBundle\\Model\\ThreadInterface`` for the complete list of Manipulate messages ------------------- -See ``Ornicar\\MessageBundle\\Model\\MessageInterface`` for the complete list of available methods:: +See ``FOS\\MessageBundle\\Model\\MessageInterface`` for the complete list of available methods:: // Print the message body echo $message->getBody(); @@ -208,7 +208,7 @@ Compose a message Create a new message thread:: - $composer = $container->get('ornicar_message.composer'); + $composer = $container->get('fos_message.composer'); $message = $composer->newThread() ->setSender($jack) @@ -232,7 +232,7 @@ Send a message Nothing's easier than sending the message you've just composed:: - $sender = $container->get('ornicar_message.sender'); + $sender = $container->get('fos_message.sender'); $sender->send($message); @@ -244,13 +244,13 @@ MessageBundle provides a few twig functions:: {# template.html.twig #} {# Know if a message is read by the authenticated participant #} - {% if not ornicar_message_is_read(message) %} This message is new! {% endif %} + {% if not fos_message_is_read(message) %} This message is new! {% endif %} {# Know if a thread is read by the authenticated participant. Yes, it's the same function. #} - {% if not ornicar_message_is_read(thread) %} This thread is new! {% endif %} + {% if not fos_message_is_read(thread) %} This thread is new! {% endif %} {# Get the number of new threads for the authenticated participant #} - You have {{ ornicar_message_nb_unread() }} new messages + You have {{ fos_message_nb_unread() }} new messages Spam detection ============== @@ -264,14 +264,14 @@ Then, set the spam detector service accordingly:: # app/config/config.yml - ornicar_message: - spam_detector: ornicar_message.akismet_spam_detector + fos_message: + spam_detector: fos_message.akismet_spam_detector Other strategy -------------- You can use any spam dectetor service, including one of your own, provided the -class implements ``Ornicar\MessageBundle\SpamDetection\SpamDetectorInterface``. +class implements ``FOS\MessageBundle\SpamDetection\SpamDetectorInterface``. Messenging permissions ====================== @@ -280,10 +280,10 @@ You can change the security logic by replacing the ``authorizer`` service:: # app/config/config.yml - ornicar_message: + fos_message: authorizer: acme_message.authorizer -Your class must implement ``Ornicar\MessageBundle\Security\AuthorizerInterface``:: +Your class must implement ``FOS\MessageBundle\Security\AuthorizerInterface``:: interface AuthorizerInterface { @@ -316,7 +316,7 @@ Your class must implement ``Ornicar\MessageBundle\Security\AuthorizerInterface`` } You can tell whether the user can see or delete a thread, and if he can send a new message to another user. -See the default implementation in ``Ornicar\MessageBundle\Security\Authorizer``. +See the default implementation in ``FOS\MessageBundle\Security\Authorizer``. Listening to events @@ -324,7 +324,7 @@ Listening to events This bundles dispatches event when notable actions are performed. -See ``Ornicar\MessageBundle\Event\OrnicarMessageEvents`` for a documented +See ``FOS\MessageBundle\Event\FOSMessageEvents`` for a documented list of the available events. Configuration @@ -334,35 +334,35 @@ All configuration options are listed below:: # app/config/config.yml - ornicar_message + fos_message db_driver: mongodb thread_class: Acme\MessageBundle\Document\Thread message_class: Acme\MessageBundle\Document\Message - message_manager: ornicar_message.message_manager # See ModelManager\MessageManagerInterface - thread_manager: ornicar_message.thread_manager # See ModelManager\ThreadManagerInterface - sender: ornicar_message.sender # See Sender\SenderInterface - composer: ornicar_message.composer # See Composer\ComposerInterface - provider: ornicar_message.provider # See Provider\ProviderInterface - participant_provider: ornicar_message.participant_provider # See Security\ParticipantProviderInterface - authorizer: ornicar_message.authorizer # See Security\AuthorizerInterface - message_reader: ornicar_message.message_reader # See Reader\ReaderInterface - thread_reader: ornicar_message.thread_reader # See Reader\ReaderInterface - deleter: ornicar_message.deleter # See Deleter\DeleterInterface - spam_detector: ornicar_message.noop_spam_detector # See SpamDetection\SpamDetectorInterface - twig_extension: ornicar_message.twig_extension # See Twig\Extension\MessageExtension + message_manager: fos_message.message_manager # See ModelManager\MessageManagerInterface + thread_manager: fos_message.thread_manager # See ModelManager\ThreadManagerInterface + sender: fos_message.sender # See Sender\SenderInterface + composer: fos_message.composer # See Composer\ComposerInterface + provider: fos_message.provider # See Provider\ProviderInterface + participant_provider: fos_message.participant_provider # See Security\ParticipantProviderInterface + authorizer: fos_message.authorizer # See Security\AuthorizerInterface + message_reader: fos_message.message_reader # See Reader\ReaderInterface + thread_reader: fos_message.thread_reader # See Reader\ReaderInterface + deleter: fos_message.deleter # See Deleter\DeleterInterface + spam_detector: fos_message.noop_spam_detector # See SpamDetection\SpamDetectorInterface + twig_extension: fos_message.twig_extension # See Twig\Extension\MessageExtension search: - finder: ornicar_message.search_finder # See Finder\FinderInterface - query_factory: ornicar_message.search_query_factory # See Finder\QueryFactoryInterface + finder: fos_message.search_finder # See Finder\FinderInterface + query_factory: fos_message.search_query_factory # See Finder\QueryFactoryInterface query_parameter: 'q' # Request query parameter containing the term new_thread_form: - factory: ornicar_message.new_thread_form.factory # See FormFactory\NewThreadMessageFormFactory - type: ornicar_message.new_thread_form.type # See FormType\NewThreadMessageFormType - handler: ornicar_message.new_thread_form.handler # See FormHandler\NewThreadMessageFormHandler + factory: fos_message.new_thread_form.factory # See FormFactory\NewThreadMessageFormFactory + type: fos_message.new_thread_form.type # See FormType\NewThreadMessageFormType + handler: fos_message.new_thread_form.handler # See FormHandler\NewThreadMessageFormHandler name: message reply_form: - factory: ornicar_message.reply_form.factory # See FormFactory\ReplyMessageFormFactory - type: ornicar_message.reply_form.type # See FormType\ReplyMessageFormType - handler: ornicar_message.reply_form.handler # See FormHandler\ReplyMessageFormHandler + factory: fos_message.reply_form.factory # See FormFactory\ReplyMessageFormFactory + type: fos_message.reply_form.type # See FormType\ReplyMessageFormType + handler: fos_message.reply_form.handler # See FormHandler\ReplyMessageFormHandler name: message Implement a new persistence backend @@ -398,5 +398,5 @@ You may also need to define mappings. MongoDB mapping examples: -- ``src/Ornicar/MessageBundle/Resources/config/doctrine/thread.mongodb.xml`` -- ``src/Ornicar/MessageBundle/Resources/config/doctrine/message.mongodb.xml`` +- ``src/FOS/MessageBundle/Resources/config/doctrine/thread.mongodb.xml`` +- ``src/FOS/MessageBundle/Resources/config/doctrine/message.mongodb.xml`` diff --git a/Resources/doc/sending_a_message.rst b/Resources/doc/sending_a_message.rst index dc5b53b3..77ae3749 100644 --- a/Resources/doc/sending_a_message.rst +++ b/Resources/doc/sending_a_message.rst @@ -20,7 +20,7 @@ To compose a message we retrieve the composer service and compose our message: :: $sender = $this->get('security.context')->getToken()->getUser(); - $threadBuilder = $this->get('ornicar_message.composer')->newThread(); + $threadBuilder = $this->get('fos_message.composer')->newThread(); $threadBuilder ->addRecipient($recipient) // Retrieved from your backend, your user manager or ... ->setSender($sender) @@ -35,8 +35,8 @@ Now all you have to do to send your message is get the sender and tell it to sen :: - $sender = $this->get('ornicar_message.sender'); + $sender = $this->get('fos_message.sender'); $sender->send($threadBuilder->getMessage()); -That's it, your message should now have been sent \ No newline at end of file +That's it, your message should now have been sent \ No newline at end of file diff --git a/Resources/translations/OrnicarMessageBundle.en.yml b/Resources/translations/FOSMessageBundle.en.yml similarity index 100% rename from Resources/translations/OrnicarMessageBundle.en.yml rename to Resources/translations/FOSMessageBundle.en.yml diff --git a/Resources/translations/OrnicarMessageBundle.fr.yml b/Resources/translations/FOSMessageBundle.fr.yml similarity index 100% rename from Resources/translations/OrnicarMessageBundle.fr.yml rename to Resources/translations/FOSMessageBundle.fr.yml diff --git a/Resources/translations/OrnicarMessageBundle.pl.yml b/Resources/translations/FOSMessageBundle.pl.yml similarity index 100% rename from Resources/translations/OrnicarMessageBundle.pl.yml rename to Resources/translations/FOSMessageBundle.pl.yml diff --git a/Resources/translations/OrnicarMessageBundle.ru.yml b/Resources/translations/FOSMessageBundle.ru.yml similarity index 100% rename from Resources/translations/OrnicarMessageBundle.ru.yml rename to Resources/translations/FOSMessageBundle.ru.yml diff --git a/Resources/translations/OrnicarMessageBundle.sl.yml b/Resources/translations/FOSMessageBundle.sl.yml similarity index 100% rename from Resources/translations/OrnicarMessageBundle.sl.yml rename to Resources/translations/FOSMessageBundle.sl.yml diff --git a/Resources/views/Message/inbox.html.twig b/Resources/views/Message/inbox.html.twig index 40425752..9d14169a 100644 --- a/Resources/views/Message/inbox.html.twig +++ b/Resources/views/Message/inbox.html.twig @@ -1,11 +1,11 @@ -{% extends 'OrnicarMessageBundle::layout.html.twig' %} +{% extends 'FOSMessageBundle::layout.html.twig' %} -{% block ornicar_message_content %} +{% block fos_message_content %} -

{% trans from 'OrnicarMessageBundle' %}inbox{% endtrans %}

+

{% trans from 'FOSMessageBundle' %}inbox{% endtrans %}

-{% trans from 'OrnicarMessageBundle' %}send_new{% endtrans %} +{% trans from 'FOSMessageBundle' %}send_new{% endtrans %} -{% include 'OrnicarMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %} +{% include 'FOSMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %} {% endblock %} diff --git a/Resources/views/Message/newThread.html.twig b/Resources/views/Message/newThread.html.twig index a9b9d65d..7ab5b6de 100644 --- a/Resources/views/Message/newThread.html.twig +++ b/Resources/views/Message/newThread.html.twig @@ -1,10 +1,10 @@ -{% extends 'OrnicarMessageBundle::layout.html.twig' %} +{% extends 'FOSMessageBundle::layout.html.twig' %} -{% block ornicar_message_content %} +{% block fos_message_content %} -

{% trans from 'OrnicarMessageBundle' %}send_new{% endtrans %}

+

{% trans from 'FOSMessageBundle' %}send_new{% endtrans %}

-
+ {{ form_widget(form) }} diff --git a/Resources/views/Message/search.html.twig b/Resources/views/Message/search.html.twig index 12e45a1c..1e5e8c70 100644 --- a/Resources/views/Message/search.html.twig +++ b/Resources/views/Message/search.html.twig @@ -1,13 +1,13 @@ -{% extends 'OrnicarMessageBundle::layout.html.twig' %} +{% extends 'FOSMessageBundle::layout.html.twig' %} -{% block ornicar_message_content %} +{% block fos_message_content %} -

{% trans from 'OrnicarMessageBundle' %}search{% endtrans %}

+

{% trans from 'FOSMessageBundle' %}search{% endtrans %}

-

{% transchoice threads|length with {'%num%': threads|length } from 'OrnicarMessageBundle' %} +

{% transchoice threads|length with {'%num%': threads|length } from 'FOSMessageBundle' %} threads_found {% endtranschoice %}

-{% include 'OrnicarMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %} +{% include 'FOSMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %} {% endblock %} diff --git a/Resources/views/Message/sent.html.twig b/Resources/views/Message/sent.html.twig index 347c970f..bc7f4cd6 100644 --- a/Resources/views/Message/sent.html.twig +++ b/Resources/views/Message/sent.html.twig @@ -1,9 +1,9 @@ -{% extends 'OrnicarMessageBundle::layout.html.twig' %} +{% extends 'FOSMessageBundle::layout.html.twig' %} -{% block ornicar_message_content %} +{% block fos_message_content %} -

{% trans from 'OrnicarMessageBundle' %}messenger{% endtrans %}

+

{% trans from 'FOSMessageBundle' %}messenger{% endtrans %}

-{% include 'OrnicarMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %} +{% include 'FOSMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %} {% endblock %} diff --git a/Resources/views/Message/thread.html.twig b/Resources/views/Message/thread.html.twig index bb8f16a2..c36238d6 100644 --- a/Resources/views/Message/thread.html.twig +++ b/Resources/views/Message/thread.html.twig @@ -1,13 +1,13 @@ -{% extends 'OrnicarMessageBundle::layout.html.twig' %} +{% extends 'FOSMessageBundle::layout.html.twig' %} -{% block ornicar_message_content %} +{% block fos_message_content %}

{{ thread.subject }}

{% for message in thread.messages %}
- {% trans with {'%sender%': message.sender|e, '%date%': message.createdAt|date} from 'OrnicarMessageBundle' %}by{% endtrans %} + {% trans with {'%sender%': message.sender|e, '%date%': message.createdAt|date} from 'FOSMessageBundle' %}by{% endtrans %}
@@ -16,9 +16,9 @@
{% endfor %} -

{% trans from 'OrnicarMessageBundle' %}reply{% endtrans %}

+

{% trans from 'FOSMessageBundle' %}reply{% endtrans %}

- + {{ form_widget(form) }} diff --git a/Resources/views/Message/threads_list.html.twig b/Resources/views/Message/threads_list.html.twig index 7a7b5882..645e8d14 100644 --- a/Resources/views/Message/threads_list.html.twig +++ b/Resources/views/Message/threads_list.html.twig @@ -2,12 +2,12 @@ - {% trans from 'OrnicarMessageBundle' %}subject{% endtrans %} - {% trans from 'OrnicarMessageBundle' %}starter{% endtrans %} - {% trans from 'OrnicarMessageBundle' %}startdate{% endtrans %} - {% trans from 'OrnicarMessageBundle' %}messages{% endtrans %} - {% trans from 'OrnicarMessageBundle' %}last_message{% endtrans %} - {% trans from 'OrnicarMessageBundle' %}actions{% endtrans %} + {% trans from 'FOSMessageBundle' %}subject{% endtrans %} + {% trans from 'FOSMessageBundle' %}starter{% endtrans %} + {% trans from 'FOSMessageBundle' %}startdate{% endtrans %} + {% trans from 'FOSMessageBundle' %}messages{% endtrans %} + {% trans from 'FOSMessageBundle' %}last_message{% endtrans %} + {% trans from 'FOSMessageBundle' %}actions{% endtrans %} @@ -17,12 +17,12 @@ {% for thread in threads %} - + {{ thread.subject }} - {% if not ornicar_message_is_read(thread) %} - ({% trans from 'OrnicarMessageBundle' %}new{% endtrans %}) + {% if not fos_message_is_read(thread) %} + ({% trans from 'FOSMessageBundle' %}new{% endtrans %}) {% endif %} @@ -36,18 +36,18 @@ {% if thread.lastMessage %} - + - {% trans with {'%date%': thread.lastMessage.createdAt|date} from 'OrnicarMessageBundle' %}on{% endtrans %} + {% trans with {'%date%': thread.lastMessage.createdAt|date} from 'FOSMessageBundle' %}on{% endtrans %}
- {% trans with {'%sender%': thread.lastMessage.sender|e } from 'OrnicarMessageBundle' %}by{% endtrans %} + {% trans with {'%sender%': thread.lastMessage.sender|e } from 'FOSMessageBundle' %}by{% endtrans %} {% else %} ---- {% endif %} - + @@ -56,7 +56,7 @@ {% else %} - {% trans from 'OrnicarMessageBundle' %}no_thread{% endtrans %}. + {% trans from 'FOSMessageBundle' %}no_thread{% endtrans %}. {% endif %} diff --git a/Resources/views/layout.html.twig b/Resources/views/layout.html.twig index a7348987..1629cb71 100644 --- a/Resources/views/layout.html.twig +++ b/Resources/views/layout.html.twig @@ -2,19 +2,19 @@ - {% trans from 'OrnicarMessageBundle' %}messenger{% endtrans %} + {% trans from 'FOSMessageBundle' %}messenger{% endtrans %} -

{% trans from 'OrnicarMessageBundle' %}messenger{% endtrans %}

+

{% trans from 'FOSMessageBundle' %}messenger{% endtrans %}

- {% block ornicar_message_content %}{% endblock %} + {% block fos_message_content %}{% endblock %} \ No newline at end of file diff --git a/Search/Finder.php b/Search/Finder.php index b4d09d17..4e4e43d9 100644 --- a/Search/Finder.php +++ b/Search/Finder.php @@ -1,9 +1,9 @@ getThread()->setIsDeleted(false); $this->messageManager->saveMessage($message); - $this->dispatcher->dispatch(OrnicarMessageEvents::POST_SEND, new MessageEvent($message)); + $this->dispatcher->dispatch(FOSMessageEvents::POST_SEND, new MessageEvent($message)); } } diff --git a/Sender/SenderInterface.php b/Sender/SenderInterface.php index 236b1fec..9f3873e9 100644 --- a/Sender/SenderInterface.php +++ b/Sender/SenderInterface.php @@ -1,8 +1,8 @@ getMockBuilder('Ornicar\MessageBundle\Document\Message') + $message = $this->getMockBuilder('FOS\MessageBundle\Document\Message') ->getMock(); $message->expects($this->atLeastOnce()) @@ -95,7 +95,7 @@ protected function createMessageMock($sender, $recipient, DateTime $date) protected function createParticipantMock($id) { - $user = $this->getMockBuilder('Ornicar\MessageBundle\Model\ParticipantInterface') + $user = $this->getMockBuilder('FOS\MessageBundle\Model\ParticipantInterface') ->disableOriginalConstructor(true) ->getMock(); diff --git a/Tests/Model/ThreadTest.php b/Tests/Model/ThreadTest.php index e3f332b2..7f0b4555 100644 --- a/Tests/Model/ThreadTest.php +++ b/Tests/Model/ThreadTest.php @@ -1,8 +1,8 @@ createParticipantMock('u2'); $u3 = $this->createParticipantMock('u3'); - $thread = $this->getMockForAbstractClass('Ornicar\MessageBundle\Model\Thread'); + $thread = $this->getMockForAbstractClass('FOS\MessageBundle\Model\Thread'); $thread->expects($this->atLeastOnce()) ->method('getParticipants') ->will($this->returnValue(array($u1, $u2, $u3))); @@ -30,7 +30,7 @@ public function testGetOtherParticipants() protected function createParticipantMock($id) { - $participant = $this->getMockBuilder('Ornicar\MessageBundle\Model\ParticipantInterface') + $participant = $this->getMockBuilder('FOS\MessageBundle\Model\ParticipantInterface') ->disableOriginalConstructor(true) ->getMock(); diff --git a/Twig/Extension/MessageExtension.php b/Twig/Extension/MessageExtension.php index c51cf596..7acec85c 100644 --- a/Twig/Extension/MessageExtension.php +++ b/Twig/Extension/MessageExtension.php @@ -1,10 +1,10 @@ new \Twig_Function_Method($this, 'isRead'), - 'ornicar_message_nb_unread' => new \Twig_Function_Method($this, 'getNbUnread') + 'fos_message_is_read' => new \Twig_Function_Method($this, 'isRead'), + 'fos_message_nb_unread' => new \Twig_Function_Method($this, 'getNbUnread') ); } @@ -73,6 +73,6 @@ protected function getAuthenticatedParticipant() */ public function getName() { - return 'ornicar_message'; + return 'fos_message'; } } diff --git a/Validator/Authorization.php b/Validator/Authorization.php index 3fc5f0ef..337bea13 100644 --- a/Validator/Authorization.php +++ b/Validator/Authorization.php @@ -1,6 +1,6 @@