@@ -48,7 +48,7 @@ public function indexAction(): void
4848
4949 $ this ->addTitle ($ this ->translate ('Feed ' ), $ controlWrapper );
5050
51- [$ url , $ type , $ name ] = $ this ->getFeedInfo ();
51+ [$ url , $ type , $ name, $ interval ] = $ this ->getFeedInfo ();
5252
5353 if ($ url === null ) {
5454 $ this ->displayError ($ this ->translate ('No such feed configured ' ));
@@ -66,7 +66,7 @@ public function indexAction(): void
6666
6767 try {
6868 $ reader = new FeedReader ($ url , $ this ->Config (), $ type );
69- $ data = $ reader ->fetch ($ name );
69+ $ data = $ reader ->fetch ($ name, $ interval );
7070 } catch (Exception $ ex ) {
7171 $ this ->displayError ($ ex ->getMessage ());
7272 return ;
@@ -103,24 +103,24 @@ protected function getFeedInfo(): array
103103 $ feed = $ storage ->getFeedByName ($ name );
104104
105105 if ($ feed === null ) {
106- return [null , null , null ];
106+ return [null , null , null , null ];
107107 }
108108
109- return [$ feed ->url , $ feed ->type , 'feed- ' . $ feed ->name ];
109+ return [$ feed ->url , $ feed ->type , 'feed- ' . $ feed ->name , $ feed -> pollingInterval ];
110110 }
111111
112112 $ url = $ this ->params ->shift ('url ' );
113113
114114 if ($ url === null or $ url === '' ) {
115- return [null , null , null ];
115+ return [null , null , null , null ];
116116 }
117117
118118 $ this ->assertPermission ('feeds/view/arbitrary ' );
119119
120120 $ type = $ this ->params ->shift ('type ' ) ?? 'auto ' ;
121121 $ name = 'url- ' . sha1 ($ url . ': ' . $ type );
122122
123- return [$ url , FeedType::fromDisplay ($ type ), $ name ];
123+ return [$ url , FeedType::fromDisplay ($ type ), $ name, null ];
124124 }
125125
126126 /**
@@ -140,7 +140,7 @@ public function createAction(): void
140140 $ this ->addTitle ($ this ->translate ('Create a new feed ' ));
141141
142142 $ storage = StorageFactory::getStorage ();
143- $ form = new FeedForm ($ storage , null );
143+ $ form = new FeedForm ($ this -> Config (), $ storage , null );
144144
145145 $ form ->on (Form::ON_SUCCESS , function () {
146146 Notification::success ($ this ->translate ('Created new feed ' ));
@@ -181,14 +181,15 @@ public function editAction(): void
181181 $ title = $ this ->translate ('Edit feed ' );
182182 $ this ->setTitle ($ title );
183183
184- $ form = new FeedForm ($ storage , $ feed );
184+ $ form = new FeedForm ($ this -> Config (), $ storage , $ feed );
185185
186186 $ form ->populate ([
187187 'name ' => $ feed ->name ,
188188 'url ' => $ feed ->url ,
189189 'description ' => $ feed ->description ,
190190 'is_visible ' => $ feed ->isVisible ,
191191 'type ' => $ feed ->type ->display (),
192+ 'polling_interval ' => $ feed ->pollingInterval ,
192193 ]);
193194
194195 $ form ->on (Form::ON_SUCCESS , function () {
0 commit comments