forked from wallabag/wallabag
Move Import form type to Core
This commit is contained in:
@ -7,8 +7,8 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Controller\AbstractController;
|
||||
use Wallabag\CoreBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\CoreBundle\Import\ImportInterface;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
|
||||
abstract class BrowserController extends AbstractController
|
||||
{
|
||||
|
||||
@ -8,8 +8,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Controller\AbstractController;
|
||||
use Wallabag\CoreBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\CoreBundle\Import\DeliciousImport;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class DeliciousController extends AbstractController
|
||||
|
||||
@ -7,8 +7,8 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Controller\AbstractController;
|
||||
use Wallabag\CoreBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\CoreBundle\Import\ImportInterface;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
|
||||
abstract class HtmlController extends AbstractController
|
||||
{
|
||||
|
||||
@ -8,8 +8,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Controller\AbstractController;
|
||||
use Wallabag\CoreBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\CoreBundle\Import\InstapaperImport;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class InstapaperController extends AbstractController
|
||||
|
||||
@ -8,8 +8,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Controller\AbstractController;
|
||||
use Wallabag\CoreBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\CoreBundle\Import\PinboardImport;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class PinboardController extends AbstractController
|
||||
|
||||
@ -8,8 +8,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Controller\AbstractController;
|
||||
use Wallabag\CoreBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\CoreBundle\Import\ReadabilityImport;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class ReadabilityController extends AbstractController
|
||||
|
||||
@ -7,8 +7,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Controller\AbstractController;
|
||||
use Wallabag\CoreBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\CoreBundle\Import\ImportInterface;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
|
||||
/**
|
||||
* Define Wallabag import for v1 and v2, since there are very similar.
|
||||
|
||||
34
src/Wallabag/CoreBundle/Form/Type/UploadImportType.php
Normal file
34
src/Wallabag/CoreBundle/Form/Type/UploadImportType.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class UploadImportType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('file', FileType::class, [
|
||||
'label' => 'import.form.file_label',
|
||||
'required' => true,
|
||||
])
|
||||
->add('mark_as_read', CheckboxType::class, [
|
||||
'label' => 'import.form.mark_as_read_label',
|
||||
'required' => false,
|
||||
])
|
||||
->add('save', SubmitType::class, [
|
||||
'label' => 'import.form.save_label',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'upload_import_file';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user