Move Import form type to Core

This commit is contained in:
Yassine Guedidi
2023-12-31 18:40:02 +01:00
parent 47b3a08284
commit 48a6948abc
8 changed files with 8 additions and 8 deletions

View File

@ -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
{

View File

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

View File

@ -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
{

View File

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

View File

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

View File

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

View File

@ -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.

View 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';
}
}