aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-12-12 17:41:03 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-12-12 17:41:03 +0100
commit24879db1f73c85b121702ba8c6ea36bae285c7c3 (patch)
tree9caa9e59d581ea0be79193635683bac5f1065438 /src/Wallabag
parent2c1eed8051160499d40ed033c83dd003c81b371e (diff)
downloadwallabag-24879db1f73c85b121702ba8c6ea36bae285c7c3.tar.gz
wallabag-24879db1f73c85b121702ba8c6ea36bae285c7c3.tar.zst
wallabag-24879db1f73c85b121702ba8c6ea36bae285c7c3.zip
Add default value for list_mode
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php3
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/Configuration.php6
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php2
-rw-r--r--src/Wallabag/UserBundle/EventListener/CreateConfigListener.php8
-rw-r--r--src/Wallabag/UserBundle/Resources/config/services.yml2
5 files changed, 20 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
index 45358022..3d4d5def 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
@@ -22,6 +22,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
22 $adminConfig->setLanguage('en'); 22 $adminConfig->setLanguage('en');
23 $adminConfig->setPocketConsumerKey('xxxxx'); 23 $adminConfig->setPocketConsumerKey('xxxxx');
24 $adminConfig->setActionMarkAsRead(0); 24 $adminConfig->setActionMarkAsRead(0);
25 $adminConfig->setListMode(0);
25 26
26 $manager->persist($adminConfig); 27 $manager->persist($adminConfig);
27 28
@@ -34,6 +35,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
34 $bobConfig->setLanguage('fr'); 35 $bobConfig->setLanguage('fr');
35 $bobConfig->setPocketConsumerKey(null); 36 $bobConfig->setPocketConsumerKey(null);
36 $bobConfig->setActionMarkAsRead(1); 37 $bobConfig->setActionMarkAsRead(1);
38 $bobConfig->setListMode(1);
37 39
38 $manager->persist($bobConfig); 40 $manager->persist($bobConfig);
39 41
@@ -46,6 +48,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
46 $emptyConfig->setLanguage('en'); 48 $emptyConfig->setLanguage('en');
47 $emptyConfig->setPocketConsumerKey(null); 49 $emptyConfig->setPocketConsumerKey(null);
48 $emptyConfig->setActionMarkAsRead(0); 50 $emptyConfig->setActionMarkAsRead(0);
51 $emptyConfig->setListMode(0);
49 52
50 $manager->persist($emptyConfig); 53 $manager->persist($emptyConfig);
51 54
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
index 3a3da024..006a18c3 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
@@ -41,6 +41,12 @@ class Configuration implements ConfigurationInterface
41 ->end() 41 ->end()
42 ->scalarNode('fetching_error_message') 42 ->scalarNode('fetching_error_message')
43 ->end() 43 ->end()
44 ->scalarNode('action_mark_as_read')
45 ->defaultValue(1)
46 ->end()
47 ->scalarNode('list_mode')
48 ->defaultValue(1)
49 ->end()
44 ->end() 50 ->end()
45 ; 51 ;
46 52
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
index b4992d54..aa9ee339 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
@@ -23,6 +23,8 @@ class WallabagCoreExtension extends Extension
23 $container->setParameter('wallabag_core.version', $config['version']); 23 $container->setParameter('wallabag_core.version', $config['version']);
24 $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']); 24 $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']);
25 $container->setParameter('wallabag_core.cache_lifetime', $config['cache_lifetime']); 25 $container->setParameter('wallabag_core.cache_lifetime', $config['cache_lifetime']);
26 $container->setParameter('wallabag_core.action_mark_as_read', $config['action_mark_as_read']);
27 $container->setParameter('wallabag_core.list_mode', $config['list_mode']);
26 $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']); 28 $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']);
27 29
28 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 30 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
diff --git a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
index 8e2f04e9..0bdd1cae 100644
--- a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
+++ b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
@@ -21,8 +21,10 @@ class CreateConfigListener implements EventSubscriberInterface
21 private $rssLimit; 21 private $rssLimit;
22 private $language; 22 private $language;
23 private $readingSpeed; 23 private $readingSpeed;
24 private $actionMarkAsRead;
25 private $listMode;
24 26
25 public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed) 27 public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode)
26 { 28 {
27 $this->em = $em; 29 $this->em = $em;
28 $this->theme = $theme; 30 $this->theme = $theme;
@@ -30,6 +32,8 @@ class CreateConfigListener implements EventSubscriberInterface
30 $this->rssLimit = $rssLimit; 32 $this->rssLimit = $rssLimit;
31 $this->language = $language; 33 $this->language = $language;
32 $this->readingSpeed = $readingSpeed; 34 $this->readingSpeed = $readingSpeed;
35 $this->actionMarkAsRead = $actionMarkAsRead;
36 $this->listMode = $listMode;
33 } 37 }
34 38
35 public static function getSubscribedEvents() 39 public static function getSubscribedEvents()
@@ -51,6 +55,8 @@ class CreateConfigListener implements EventSubscriberInterface
51 $config->setRssLimit($this->rssLimit); 55 $config->setRssLimit($this->rssLimit);
52 $config->setLanguage($this->language); 56 $config->setLanguage($this->language);
53 $config->setReadingSpeed($this->readingSpeed); 57 $config->setReadingSpeed($this->readingSpeed);
58 $config->setActionMarkAsRead($this->actionMarkAsRead);
59 $config->setListMode($this->listMode);
54 60
55 $this->em->persist($config); 61 $this->em->persist($config);
56 $this->em->flush(); 62 $this->em->flush();
diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml
index 164a25ec..72f6f12c 100644
--- a/src/Wallabag/UserBundle/Resources/config/services.yml
+++ b/src/Wallabag/UserBundle/Resources/config/services.yml
@@ -31,5 +31,7 @@ services:
31 - "%wallabag_core.rss_limit%" 31 - "%wallabag_core.rss_limit%"
32 - "%wallabag_core.language%" 32 - "%wallabag_core.language%"
33 - "%wallabag_core.reading_speed%" 33 - "%wallabag_core.reading_speed%"
34 - "%wallabag_core.action_mark_as_read%"
35 - "%wallabag_core.list_mode%"
34 tags: 36 tags:
35 - { name: kernel.event_subscriber } 37 - { name: kernel.event_subscriber }